X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Fbsview.cpp;fp=bs%2Fbsview.cpp;h=6f0bf311fd01af1d5b219282107a996d38f1faf8;hb=33b6dc7ca95a05c26a78879413395c1588066b77;hp=5158fe40a5c44264e71f1af7e96a42147cf49fc7;hpb=bf9477417304837c7caa6fac90de3eecb5a9dc43;p=hbs.git diff --git a/bs/bsview.cpp b/bs/bsview.cpp index 5158fe4..6f0bf31 100644 --- a/bs/bsview.cpp +++ b/bs/bsview.cpp @@ -119,9 +119,12 @@ void BSView::slotDocumentChanged() const BattleList& battles = m_doc->battles(); + vector battlenames; + for (BattleList::const_iterator i = battles.begin(); i != battles.end(); ++i) { QString b = (*i).first; + battlenames.push_back(i->first); QListViewItem* battle = new QListViewItem(m_NumberView, b); battle->setOpen(m_TreeExpanded[b]["--"]); @@ -140,12 +143,17 @@ void BSView::slotDocumentChanged() unsigned score = k->second->score(); groupShips += ships; groupScore += score; - (void) new QListViewItem(group, (*k).first, QString("%1").arg(ships), QString("%1").arg(k->second->ETA()), QString("%1").arg(score)); + //if(k->first == tr("Home Planet")) + (void) new QListViewItem(group, (*k).first, QString("%1").arg(ships), QString("%1").arg(k->second->ETA()), QString("%1").arg(score)); + /*else + (void) new QCheckListItem(group, (*k).first, QString("%1").arg(ships), QString("%1").arg(k->second->ETA()), QString("%1").arg(score), QCheckListItem::CheckBox);*/ + } group->setText(1, QString("%1").arg(groupShips)); group->setText(3, QString("%1").arg(groupScore)); } } + m_InfoView->setBattles(battlenames); } ////////////////////////////////////////////////////////////////////////////// @@ -182,16 +190,22 @@ void BSView::slotFleetSelection(QListViewItem *lvi) m_sFleet = lvi->text(0); m_sGroup = lvi->parent()->text(0); m_sBattle = lvi->parent()->parent()->text(0); + if ( m_sGroup == tr("Friendly")) { friendly = true; if(m_sFleet == tr("Home Planet")) home=true; } + const Fleet* fl = m_doc->specificFleet(m_sBattle, m_sGroup, m_sFleet); + m_InfoView->setRace(fl->race().c_str()); m_InfoView->setFleetName(m_sFleet); m_InfoView->setEta(fl->ETA()); + m_InfoView->setGroup(m_sGroup); + m_InfoView->setBattle(m_sBattle); + if (fl->race() == tr("Generic").latin1()) { m_GenericFleetView->viewFleet(fl, friendly);