6 void InfoView::destroy()
11 void InfoView::setRaces( std::vector<QString> races)
13 for (std::vector<QString>::iterator i = races.begin(); i != races.end(); ++i)
15 RaceCombo->insertItem((*i));
17 if ( RaceCombo->count() != 0)
18 NewButton->setEnabled(true);
21 void InfoView::setEta( int eta )
23 EtaSpin->setValue(eta);
26 void InfoView::setFleetName( QString name )
28 NameLine->setText(name);
30 if (m_Name == "Home Planet" && m_Group == "Friendly")
32 GroupCombo->setEnabled(false);
33 BattleCombo->setEnabled(false);
34 ApplyButton->setEnabled(true);
35 NewButton->setEnabled(false);
36 RemoveButton->setEnabled(false);
39 GroupCombo->setEnabled(true);
40 BattleCombo->setEnabled(true);
41 ApplyButton->setEnabled(true);
42 NewButton->setEnabled(true);
43 RemoveButton->setEnabled(true);
46 void InfoView::setRace( QString name )
48 RaceCombo->setCurrentText(name);
51 void InfoView::InfoView_destroyed( QObject * )
56 void InfoView::CancelButton_clicked()
61 void InfoView::NewButton_clicked()
66 void InfoView::RemoveButton_clicked()
71 void InfoView::setGroup( QString s )
73 GroupCombo->setCurrentText(s);
77 void InfoView::setBattles( std::vector<QString> battles )
81 for (std::vector<QString>::iterator i = battles.begin(); i != battles.end(); ++i)
83 BattleCombo->insertItem(*i);
87 void InfoView::setBattle( QString s )
89 BattleCombo->setCurrentText(s);
93 void InfoView::enableNameChange( bool b )
95 NameLine->setReadOnly(!b);
98 void InfoView::enableRemove( bool b )
100 RemoveButton->setEnabled(b);
103 void InfoView::ApplyButton_clicked()
108 QString InfoView::battle()
110 return BattleCombo->currentText();
115 return EtaSpin->value();
118 QString InfoView::fleetName()
120 return NameLine->text();
123 QString InfoView::group()
125 return GroupCombo->currentText();
128 QString InfoView::race()
130 return RaceCombo->currentText();
133 void InfoView::slotNameChanged( const QString & s )
135 if (s != "Home Planet" && m_Name == "Home Planet" && m_Group == "Friendly")
137 GroupCombo->setEnabled(true);
138 BattleCombo->setEnabled(true);
139 ApplyButton->setEnabled(false);
140 NewButton->setEnabled(true);
142 if (s == "Home Planet" && m_Name == "Home Planet" && m_Group == "Friendly")
144 GroupCombo->setEnabled(false);
145 GroupCombo->setCurrentText(m_Group);
146 BattleCombo->setEnabled(false);
147 BattleCombo->setCurrentText(m_Battle);
148 ApplyButton->setEnabled(true);
149 NewButton->setEnabled(false);