]> ruin.nu Git - hbs.git/blob - bs/ui/bsappbase.ui.h
moving the tick changing to the toolbar instead of CTickView. adding a combobox to...
[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     }
122     else
123     {
124         minTickSpin->setEnabled(true);
125         minTickSpin->setMaxValue( maxTickSpin->value());
126         if (minTickSpin->value() < maxTickSpin->value())
127             maxTickSpin->setMinValue( minTickSpin->value());
128         else
129         {
130                 maxTickSpin->setMinValue( maxTickSpin->value());
131                 minTickSpin->setValue(maxTickSpin->value());
132         }
133     }
134 }
135
136 void BSAppBase::minTickSpin_valueChanged( int i )
137 {
138          if ( !oneTickCheck->isChecked())
139          maxTickSpin->setMinValue(i);
140 }
141
142 void BSAppBase::maxTickSpin_valueChanged( int i )
143 {
144          if ( !oneTickCheck->isChecked())
145          minTickSpin->setMaxValue(i);
146 }
147
148 void BSAppBase::slotTicksChanged( int i )
149 {
150    if ( oneTickCheck->isChecked())
151     {
152         maxTickSpin->setValue(i);
153         //minTickSpin->setValue(i-1);
154         emit ticksChanged( maxTickSpin->value() - 1, maxTickSpin->value());
155         return;
156     }
157    emit ticksChanged( minTickSpin->value(), maxTickSpin->value());
158 }
159
160
161
162 void BSAppBase::resultModeCombo_activated( int i )
163 {
164     emit resultModeChanged(i);
165 }