X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Fui%2Finfoview.ui.h;fp=bs%2Fui%2Finfoview.ui.h;h=a50bb950a2749e12be7666902e979f4bfe250321;hb=6a5514b426dda24837138301f7bd6f68cb58cb39;hp=0000000000000000000000000000000000000000;hpb=eba582b38f8b12085c166177a9d80a9f8429d1ec;p=hbs.git diff --git a/bs/ui/infoview.ui.h b/bs/ui/infoview.ui.h new file mode 100644 index 0000000..a50bb95 --- /dev/null +++ b/bs/ui/infoview.ui.h @@ -0,0 +1,151 @@ +void InfoView::init() +{ + +} + +void InfoView::destroy() +{ + +} + +void InfoView::setRaces( std::vector races) +{ + for (std::vector::iterator i = races.begin(); i != races.end(); ++i) + { + RaceCombo->insertItem((*i)); + } + if ( RaceCombo->count() != 0) + NewButton->setEnabled(true); +} + +void InfoView::setEta( int eta ) +{ + EtaSpin->setValue(eta); +} + +void InfoView::setFleetName( QString name ) +{ + NameLine->setText(name); + m_Name = name; + if (m_Name == "Home Planet" && m_Group == "Friendly") + { + GroupCombo->setEnabled(false); + BattleCombo->setEnabled(false); + ApplyButton->setEnabled(true); + NewButton->setEnabled(false); + RemoveButton->setEnabled(false); + return; + } + GroupCombo->setEnabled(true); + BattleCombo->setEnabled(true); + ApplyButton->setEnabled(true); + NewButton->setEnabled(true); + RemoveButton->setEnabled(true); +} + +void InfoView::setRace( QString name ) +{ + RaceCombo->setCurrentText(name); +} + +void InfoView::InfoView_destroyed( QObject * ) +{ + +} + +void InfoView::CancelButton_clicked() +{ + emit cancel(); +} + +void InfoView::NewButton_clicked() +{ + emit add(); +} + +void InfoView::RemoveButton_clicked() +{ + emit remove(); +} + +void InfoView::setGroup( QString s ) +{ + GroupCombo->setCurrentText(s); + m_Group = s; +} + +void InfoView::setBattles( std::vector battles ) +{ + BattleCombo->clear(); + + for (std::vector::iterator i = battles.begin(); i != battles.end(); ++i) + { + BattleCombo->insertItem(*i); + } +} + +void InfoView::setBattle( QString s ) +{ + BattleCombo->setCurrentText(s); + m_Battle = s; +} + +void InfoView::enableNameChange( bool b ) +{ + NameLine->setReadOnly(!b); +} + +void InfoView::enableRemove( bool b ) +{ + RemoveButton->setEnabled(b); +} + +void InfoView::ApplyButton_clicked() +{ + emit apply(); +} + +QString InfoView::battle() +{ + return BattleCombo->currentText(); +} + +int InfoView::eta() +{ + return EtaSpin->value(); +} + +QString InfoView::fleetName() +{ + return NameLine->text(); +} + +QString InfoView::group() +{ + return GroupCombo->currentText(); +} + +QString InfoView::race() +{ + return RaceCombo->currentText(); +} + +void InfoView::slotNameChanged( const QString & s ) +{ + if (s != "Home Planet" && m_Name == "Home Planet" && m_Group == "Friendly") + { + GroupCombo->setEnabled(true); + BattleCombo->setEnabled(true); + ApplyButton->setEnabled(false); + NewButton->setEnabled(true); + } + if (s == "Home Planet" && m_Name == "Home Planet" && m_Group == "Friendly") + { + GroupCombo->setEnabled(false); + GroupCombo->setCurrentText(m_Group); + BattleCombo->setEnabled(false); + BattleCombo->setCurrentText(m_Battle); + ApplyButton->setEnabled(true); + NewButton->setEnabled(false); + } +} \ No newline at end of file