//QT includes
#include <qlistview.h>
#include <qwidgetstack.h>
+#include <qtabwidget.h>
+#include <qtextedit.h>
#include "battlesum.h"
#include "scanview.h"
m_doc = doc;
m_LeftSplit = new QSplitter(QSplitter::Vertical, this);
- m_RightSplit = new QSplitter(QSplitter::Vertical, this);
+
+ m_Pages = new QTabWidget(this);
+
+ m_RightSplit = new QSplitter(QSplitter::Vertical);
+ m_Pages->addTab(m_RightSplit, tr("Units"));
+
+ m_Report = new QTextEdit();
+ m_Report->setReadOnly(true);
+ m_Pages->addTab(m_Report, tr("Report"));
+
//setting up the listview
m_NumberView = new QListView(m_LeftSplit);
{
m_sFleet = lvi->text(0);
m_sGroup = lvi->parent()->text(0);
- m_sBattle = lvi->parent()->parent()->text(0);
+ QString temp = lvi->parent()->parent()->text(0);
+
+ if (temp != m_sBattle)
+ {
+ m_sBattle = temp;
+ slotGenerateReport();
+ }
updateInfoView();
updateFleetView();
cerr << "Text: " << text.latin1() << endl;
cerr << "Fleets: " << fleets << endl;
}
+
+
+//////////////////////////////////////////////////////////////////////////
+//
+void BSView::slotGenerateReport()
+{
+ const Fleet *fl = m_doc->specificFleet(m_sBattle, "Friendly", "Home Planet");
+
+ const Planet* pl = dynamic_cast<const Planet*>(fl);
+ if (pl)
+ {
+ ReportList report = pl->report();
+ QString t;
+
+ t.append("<qt>\n");
+
+
+ for (ReportList::iterator i = report.begin(); i != report.end(); ++i)
+ {
+ t.append(QString("Tick number: %0\n").arg(i->first));
+ t.append("<ul>\n");
+ for(map<int, map<string, map<string, map<string, int> > > >::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ {
+ t.append(QString("<li>Now handling initiative: %0\n").arg(j->first));
+ t.append("<ul type=circle>\n");
+ for(map<string, map<string, map<string, int> > >::iterator k = j->second.begin(); k != j->second.end(); ++k)
+ {
+ for(map<string, map<string, int> >::iterator l = k->second.begin(); l != k->second.end(); ++l)
+ {
+ t.append(QString("<li>%0 %1 %2 killing/blocking at: \n").arg(l->second["000"]).arg(k->first.c_str()).arg(l->first.c_str()));
+ t.append("<ul type=square>\n");
+
+ t.append("</ul>\n");
+ t.append("</li>\n");
+ }
+ }
+ t.append("</ul>\n");
+ t.append("</li>\n");
+ }
+ t.append("</ul>\n");
+
+ t.append("<hr>\n");
+ }
+ t.append("</qt>\n");
+ //cerr << t.latin1();
+ m_Report->clear();
+ m_Report->setText(t);
+
+ }
+ //m_Report->append("<b>test\n<b>");
+}