From 071b5f2d6ca710d048a58ee40e32bc623033c46e Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 20 Nov 2001 18:23:25 +0000 Subject: [PATCH] Some changes --- bs/bsview.cpp | 48 ++- bs/main.cpp | 4 +- bs/ui/fleetviewbase.ui | 804 +++++++++++++++++++++++---------------- bs/ui/fleetviewbase.ui.h | 16 +- bs/ui/tickviewbase.ui | 143 ++++--- bs/ui/tickviewbase.ui.h | 31 +- hbs.kdevses | 12 +- 7 files changed, 663 insertions(+), 395 deletions(-) diff --git a/bs/bsview.cpp b/bs/bsview.cpp index 76d812f..5da0e06 100644 --- a/bs/bsview.cpp +++ b/bs/bsview.cpp @@ -27,6 +27,9 @@ #include #include +#include +using namespace std; + BSView::BSView(QWidget *parent, BSDoc *doc) : QSplitter(parent) { /** connect doc with the view*/ @@ -66,9 +69,10 @@ BSView::~BSView() void BSView::addBattle(QString name) { - QListViewItem *battle = new QListViewItem(m_NumberView, name); - (void) new QListViewItem(battle, "Defenders"); - (void) new QListViewItem(battle, "Attackers"); + QListViewItem* battle = new QListViewItem(m_NumberView, name); + QListViewItem* def = new QListViewItem(battle, tr("Defenders"),"", "","1"); + (void) new QListViewItem(battle, tr("Attackers"),"", "","2"); + (void) new QListViewItem(def, tr("Home Planet"), "","","1"); } void BSView::slotDocumentChanged() @@ -77,14 +81,50 @@ void BSView::slotDocumentChanged() } /** No descriptions */ -void BSView::slotFleetSelection(QListViewItem *lvi){ +void BSView::slotFleetSelection(QListViewItem *lvi) +{ + //cout << lvi->parent()->text(2).toLocal8bit() << endl; +// for (int i = 0; i < 5; i++) +// cout << lvi->text(i).local8Bit() << endl; + + if (lvi->parent() == '\0') { m_FleetViews->raiseWidget(0); } else if (lvi->parent()->parent() == '\0') { + m_FleetView->slotHomePlanet(false); + if (lvi->text(3) == "1") + { + m_FleetView->slotAttacker(false); + } + else + { + m_FleetView->slotAttacker(true); + } m_FleetViews->raiseWidget(1); + } + else + { + if (lvi->parent()->text(3) == "1") + { + m_FleetView->slotAttacker(false); + m_FleetView->slotHomePlanet(false); + if (lvi->text(3) == "1") + { + m_FleetView->slotHomePlanet(true); + } + } + else + { + m_FleetView->slotAttacker(true); + m_FleetView->slotHomePlanet(false); + } + m_FleetViews->raiseWidget(1); + + } + } diff --git a/bs/main.cpp b/bs/main.cpp index d62cf3f..387e302 100644 --- a/bs/main.cpp +++ b/bs/main.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "../config.h" @@ -27,14 +26,13 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); - a.setStyle(new QPlatinumStyle); //QStyle* s = new QCDEStyle(); //QTranslator translator( 0 ); //translator.load( "se_SE.qm", "/home/whale/src/hbs" ); //a.installTranslator( &translator ); - a.setFont(QFont("times", 12)); + //a.setFont(QFont("times", 12)); /* uncomment the following line, if you want a Windows 95 look*/ // a.setStyle(WindowsStyle); //a.setStyle(s); diff --git a/bs/ui/fleetviewbase.ui b/bs/ui/fleetviewbase.ui index 84fa863..eb940f0 100644 --- a/bs/ui/fleetviewbase.ui +++ b/bs/ui/fleetviewbase.ui @@ -8,8 +8,8 @@ 0 0 - 605 - 332 + 627 + 414 @@ -25,14 +25,14 @@ 6 - + - CaptureBox + RoidsGroup - Captured roids + Roids - + unnamed @@ -42,326 +42,136 @@ 6 - + - TextLabel18 + TextLabel1 Metal - + - LineEdit23 - - - NoFocus + LineEdit27 true - + - TextLabel19 - - - Crystal + LineEdit29 - + - LineEdit24 - - - NoFocus + LineEdit28 true - + - TextLabel20 + TextLabel2 - Eonium + Crystal - + - LineEdit25 - - - NoFocus - - - true + LineEdit31 - - - - - Spacer4 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - Spacer2 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - Layout16 - - - - unnamed - - - 0 - - - 6 - - + - LineEdit9_2 - - - NoFocus + LineEdit30 true - - - LineEdit3_2 - - - - - LineEdit1_2 - - - + - BlackWidowLabel + TextLabel3 - BlackWidow + Eonium - + - SpiderLabel + TextLabel4 - Spider - - - - - LineEdit10_2 - - - NoFocus - - - true - - - - - LineEdit4_2 + Uninit - + - WraithLabel - - - Wraith + LineEdit32 - + - LineEdit7_2 - - - NoFocus + LineEdit33 true - - - TextLabel17 - - - L/S - - - - - TextLabel15 - - - Name - - - - - LineEdit2_2 - - - - - SpectreLabel - - - Spectre - - - - - LineEdit5_2 - - - + - TextLabel16 + TextLabel5 Total - - - LineEdit8_2 - - - NoFocus - - - true - - - + - LineEdit11_2 - - - NoFocus + TextLabel6 - - true + + Lost - + - TarantulaLabel - - - Tarantula + LineEdit26 - + - Layout15 + CaptureBox - + + Captured roids + + unnamed - 0 + 11 6 - - - TextLabel13 - - - Total - - - - - LineEdit3 - - - - - TextLabel12 - - - Name - - - - - LineEdit12 - - - NoFocus - - - true - - - - - LineEdit6 - - - - - LineEdit2 - - - + - TextLabel14 + TextLabel18 - L/S + Metal - + - LineEdit8 + MetalLine NoFocus @@ -370,25 +180,17 @@ true - - - WarfrigateLabel - - - Warfrigate - - - + - DevistatorLabel + TextLabel19 - Devistator + Crystal - + - LineEdit9 + CrystalLine NoFocus @@ -397,30 +199,17 @@ true - - - LineEdit4 - - - - - StarCruiserLabel - - - StarCruiser - - - + - PheonixLabel + TextLabel20 - Pheonix + Eonium - + - LineEdit10 + EoniumLine NoFocus @@ -429,62 +218,30 @@ true - - - LineEdit1 - - - + - DreadnaughLabel + TextLabel7 - Dreadnaught + Uninit - - - LineEdit5 - - - - - LineEdit7 - - - NoFocus - - - true - - - + - LineEdit11 - - - NoFocus + UninitLine true - - - InterceptorLabel - - - Interceptor - - - + - - - Spacer1 + + + Spacer4 - Horizontal + Vertical Expanding @@ -496,6 +253,416 @@ + + + Layout6 + + + + unnamed + + + 0 + + + 6 + + + + Layout15 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel13 + + + Total + + + + + LineEdit3 + + + + + TextLabel12 + + + Name + + + + + LineEdit12 + + + NoFocus + + + true + + + + + LineEdit6 + + + + + LineEdit2 + + + + + TextLabel14 + + + L/S + + + + + LineEdit8 + + + NoFocus + + + true + + + + + WarfrigateLabel + + + Warfrigate + + + + + DevistatorLabel + + + Devistator + + + + + LineEdit9 + + + NoFocus + + + true + + + + + LineEdit4 + + + + + StarCruiserLabel + + + StarCruiser + + + + + PheonixLabel + + + Pheonix + + + + + LineEdit10 + + + NoFocus + + + true + + + + + LineEdit1 + + + + + DreadnaughLabel + + + Dreadnaught + + + + + LineEdit5 + + + + + LineEdit7 + + + NoFocus + + + true + + + + + LineEdit11 + + + NoFocus + + + true + + + + + InterceptorLabel + + + Interceptor + + + + + + + Spacer5 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + Layout4 + + + + unnamed + + + 0 + + + 6 + + + + Layout16 + + + + unnamed + + + 0 + + + 6 + + + + LineEdit9_2 + + + NoFocus + + + true + + + + + LineEdit3_2 + + + + + LineEdit1_2 + + + + + BlackWidowLabel + + + BlackWidow + + + + + SpiderLabel + + + Spider + + + + + LineEdit10_2 + + + NoFocus + + + true + + + + + LineEdit4_2 + + + + + WraithLabel + + + Wraith + + + + + LineEdit7_2 + + + NoFocus + + + true + + + + + TextLabel17 + + + L/S + + + + + TextLabel15 + + + Name + + + + + LineEdit2_2 + + + + + SpectreLabel + + + Spectre + + + + + LineEdit5_2 + + + + + TextLabel16 + + + Total + + + + + LineEdit8_2 + + + NoFocus + + + true + + + + + LineEdit11_2 + + + NoFocus + + + true + + + + + TarantulaLabel + + + Tarantula + + + + + + + Spacer2 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + @@ -513,9 +680,9 @@ LineEdit4_2 LineEdit5_2 LineEdit8 - LineEdit23 - LineEdit24 - LineEdit25 + MetalLine + CrystalLine + EoniumLine LineEdit7 LineEdit9 LineEdit10 @@ -531,7 +698,8 @@ fleetviewbase.ui.h - slotAttacker(bool b) + slotAttacker( bool b ) + slotHomePlanet( bool b ) diff --git a/bs/ui/fleetviewbase.ui.h b/bs/ui/fleetviewbase.ui.h index 05111a4..5d3e4dc 100644 --- a/bs/ui/fleetviewbase.ui.h +++ b/bs/ui/fleetviewbase.ui.h @@ -11,10 +11,22 @@ void FleetViewBase::slotAttacker(bool b) { if (b) { - CaptureBox->setCaption("Captured roids"); + CaptureBox->setTitle(tr("Captured roids")); } else { - CaptureBox->setCaption("Salvage"); + CaptureBox->setTitle(tr("Salvage")); + } +} + +void FleetViewBase::slotHomePlanet( bool b ) +{ + if (b) + { + RoidsGroup->show(); + } + else + { + RoidsGroup->hide(); } } \ No newline at end of file diff --git a/bs/ui/tickviewbase.ui b/bs/ui/tickviewbase.ui index 2ea6579..387d7bd 100644 --- a/bs/ui/tickviewbase.ui +++ b/bs/ui/tickviewbase.ui @@ -1,8 +1,5 @@ CTickViewBase -tickviewbase.ui.h - - CTickViewBase @@ -11,14 +8,14 @@ 0 0 - 371 - 34 + 478 + 37 Form1 - + unnamed @@ -28,73 +25,95 @@ 3 - + + + TextLabel45 + + + Show result from tick: + + + + + minTickSpin + + + 1 + + + 1 + + + + + TextLabel47 + + + to: + + + - Layout26 + maxTickSpin + + + 1 - - - unnamed - - - 0 - - - 6 - - - - TextLabel45 - - - Show result from tick: - - - - - minTickSpin - - - 1 - - - 1 - - - - - TextLabel47 - - - to: - - - - - maxTickSpin - - - 1 - - - - + + + oneTickCheck + + + one tick + + + Check this option if you only want the result from for one tick. + + + - - minTickSpin + + maxTickSpin valueChanged(int) CTickViewBase - slotMinTick(int) + slotMaxTick(int) - + maxTickSpin valueChanged(int) CTickViewBase - slotMaxTick(int) + slotTickChanged(int) + + + minTickSpin + valueChanged(int) + CTickViewBase + slotTickChanged(int) + + + minTickSpin + valueChanged(int) + CTickViewBase + slotMinTick(int) + + + oneTickCheck + toggled(bool) + CTickViewBase + slotOneTick(bool) - slotMaxTick( int i ) - slotMinTick( int i ) + + tickviewbase.ui.h + + + slotMaxTick( int i ) + slotMinTick( int i ) + slotTickChanged( int i ) + slotOneTick( bool b ) + + + diff --git a/bs/ui/tickviewbase.ui.h b/bs/ui/tickviewbase.ui.h index 4b8f126..741e407 100644 --- a/bs/ui/tickviewbase.ui.h +++ b/bs/ui/tickviewbase.ui.h @@ -10,12 +10,37 @@ *****************************************************************************/ -void CTickViewBase::slotMaxTick( int i ) +void CTickViewBase::slotMaxTick(int i) { - minTickSpin->setMaxValue(i); + if ( !oneTickCheck->isChecked()) + minTickSpin->setMaxValue(i); } void CTickViewBase::slotMinTick( int i ) { - maxTickSpin->setMinValue(i); + if ( !oneTickCheck->isChecked()) + maxTickSpin->setMinValue(i); +} + +void CTickViewBase::slotTickChanged(int i) +{ + if ( oneTickCheck->isChecked()) + { + maxTickSpin->setValue(i); + minTickSpin->setValue(i); + } +} + +void CTickViewBase::slotOneTick( bool b ) +{ + if(b) + { + maxTickSpin->setMinValue(0); + minTickSpin->setMaxValue(99); + } + else + { + maxTickSpin->setMinValue( minTickSpin->value()); + minTickSpin->setMaxValue( maxTickSpin->value()); + } } \ No newline at end of file diff --git a/hbs.kdevses b/hbs.kdevses index 7d79bcf..cd5c715 100644 --- a/hbs.kdevses +++ b/hbs.kdevses @@ -1,8 +1,14 @@ - - - + + + + + + + + + -- 2.39.2