]> ruin.nu Git - hbs.git/blobdiff - bs/bsview.cpp
added comboboxes for the battle and group in the info view
[hbs.git] / bs / bsview.cpp
index 5158fe40a5c44264e71f1af7e96a42147cf49fc7..6f0bf311fd01af1d5b219282107a996d38f1faf8 100644 (file)
@@ -119,9 +119,12 @@ void BSView::slotDocumentChanged()
        
        const BattleList& battles = m_doc->battles();   
 
+       vector<QString> 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);