]> ruin.nu Git - hbs.git/blob - bs/ui/bsappbase.ui.h
started to work on the battle report.. almost there =)
[hbs.git] / bs / ui / bsappbase.ui.h
1 /****************************************************************************
2  ** ui.h extension file, included from the uic-generated form implementation.
3  **
4  ** If you wish to add, delete or rename slots use Qt Designer which will
5  ** update this file, preserving your code. Create an init() slot in place of
6  ** a constructor, and a destroy() slot in place of a destructor.
7  *****************************************************************************/
8
9
10
11 void BSAppBase::fileNew()
12 {
13
14 }
15
16 void BSAppBase::fileOpen()
17 {
18
19 }
20
21 void BSAppBase::fileSave()
22 {
23
24 }
25
26 void BSAppBase::fileSaveAs()
27 {
28
29 }
30
31 void BSAppBase::filePrint()
32 {
33
34 }
35
36 void BSAppBase::fileExit()
37 {
38
39 }
40
41 void BSAppBase::editUndo()
42 {
43
44 }
45
46 void BSAppBase::editRedo()
47 {
48
49 }
50
51 void BSAppBase::editCut()
52 {
53
54 }
55
56 void BSAppBase::init()
57 {
58         conf = new BSConf();
59         doc = new BSDoc();
60         view = new BSView(this,doc);
61         connect(this, SIGNAL(ticksChanged(int, int) ), view, SLOT(slotTickChanged(int, int)));
62         connect(this, SIGNAL(resultModeChanged(int) ), view, SLOT(slotResultModeChanged(int)));
63         setCentralWidget(view);
64 }
65
66 void BSAppBase::editPaste()
67 {
68
69 }
70
71 void BSAppBase::editFind()
72 {
73
74 }
75
76 void BSAppBase::helpIndex()
77 {
78
79 }
80
81 void BSAppBase::helpContents()
82 {
83
84 }
85
86 void BSAppBase::helpAbout()
87 {
88
89 }
90
91 void BSAppBase::battleNew()
92 {
93         bool ok = FALSE;
94         QString text = QInputDialog::getText(
95                         tr( "Harvalen's Battlesystem" ),
96                         tr( "Please enter the name of the battle (for example coords)" ),
97                         QLineEdit::Normal, QString::null, &ok, this );
98         if ( ok && !text.isEmpty() )
99                 doc->newBattle(text);
100         else
101         {
102                 // user entered nothing or pressed Cancel
103         }
104 }
105
106 void BSAppBase::battleSimulate()
107 {
108         QApplication::setOverrideCursor( Qt::WaitCursor );
109
110         doc->runBattleSimulation();
111         view->slotGenerateReport();
112         QApplication::restoreOverrideCursor();
113 }
114
115 void BSAppBase::oneTickCheck_toggled( bool b)
116 {
117         if(b)
118         {
119                 maxTickSpin->setMinValue(0);
120                 minTickSpin->setDisabled(true);
121                 minTickSpin->setMaxValue(99);
122                 emit ticksChanged( maxTickSpin->value() - 1, maxTickSpin->value());
123         }
124         else
125         {
126                 minTickSpin->setEnabled(true);
127                 minTickSpin->setMaxValue( maxTickSpin->value());
128                 if (minTickSpin->value() < maxTickSpin->value())
129                         maxTickSpin->setMinValue( minTickSpin->value());
130                 else
131                 {
132                         maxTickSpin->setMinValue( maxTickSpin->value());
133                         minTickSpin->setValue(maxTickSpin->value());
134                 }
135                 emit ticksChanged( minTickSpin->value(), maxTickSpin->value());
136         }
137 }
138
139 void BSAppBase::minTickSpin_valueChanged( int i )
140 {
141         if ( !oneTickCheck->isChecked())
142                 maxTickSpin->setMinValue(i);
143 }
144
145 void BSAppBase::maxTickSpin_valueChanged( int i )
146 {
147         if ( !oneTickCheck->isChecked())
148                 minTickSpin->setMaxValue(i);
149 }
150
151 void BSAppBase::slotTicksChanged( int i )
152 {
153         if ( oneTickCheck->isChecked())
154         {
155                 maxTickSpin->setValue(i);
156                 //minTickSpin->setValue(i-1);
157                 emit ticksChanged( maxTickSpin->value() - 1, maxTickSpin->value());
158                 return;
159         }
160         emit ticksChanged( minTickSpin->value(), maxTickSpin->value());
161 }
162
163
164
165 void BSAppBase::resultModeCombo_activated( int i )
166 {
167         emit resultModeChanged(i);
168 }