]> ruin.nu Git - hbs.git/blob - bs/ui/bsappbase.ui.h
much better indenting.. (thnx vim ;)
[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         QApplication::restoreOverrideCursor();
112 }
113
114 void BSAppBase::oneTickCheck_toggled( bool b)
115 {
116         if(b)
117         {
118                 maxTickSpin->setMinValue(0);
119                 minTickSpin->setDisabled(true);
120                 minTickSpin->setMaxValue(99);
121                 emit ticksChanged( maxTickSpin->value() - 1, maxTickSpin->value());
122         }
123         else
124         {
125                 minTickSpin->setEnabled(true);
126                 minTickSpin->setMaxValue( maxTickSpin->value());
127                 if (minTickSpin->value() < maxTickSpin->value())
128                         maxTickSpin->setMinValue( minTickSpin->value());
129                 else
130                 {
131                         maxTickSpin->setMinValue( maxTickSpin->value());
132                         minTickSpin->setValue(maxTickSpin->value());
133                 }
134                 emit ticksChanged( minTickSpin->value(), maxTickSpin->value());
135         }
136 }
137
138 void BSAppBase::minTickSpin_valueChanged( int i )
139 {
140         if ( !oneTickCheck->isChecked())
141                 maxTickSpin->setMinValue(i);
142 }
143
144 void BSAppBase::maxTickSpin_valueChanged( int i )
145 {
146         if ( !oneTickCheck->isChecked())
147                 minTickSpin->setMaxValue(i);
148 }
149
150 void BSAppBase::slotTicksChanged( int i )
151 {
152         if ( oneTickCheck->isChecked())
153         {
154                 maxTickSpin->setValue(i);
155                 //minTickSpin->setValue(i-1);
156                 emit ticksChanged( maxTickSpin->value() - 1, maxTickSpin->value());
157                 return;
158         }
159         emit ticksChanged( minTickSpin->value(), maxTickSpin->value());
160 }
161
162
163
164 void BSAppBase::resultModeCombo_activated( int i )
165 {
166         emit resultModeChanged(i);
167 }