summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman/kpacman.cpp
authorzecke <zecke>2003-05-14 12:08:54 (UTC)
committer zecke <zecke>2003-05-14 12:08:54 (UTC)
commitc480b91a5afe1f259287c3c4173ec02f2b4854cb (patch) (unidiff)
treeffe59a2fc544f6067fd96065d94a877188f1ef88 /noncore/games/kpacman/kpacman.cpp
parent415a300230e10e29660b2af26a23798fd0b12e03 (diff)
downloadopie-c480b91a5afe1f259287c3c4173ec02f2b4854cb.zip
opie-c480b91a5afe1f259287c3c4173ec02f2b4854cb.tar.gz
opie-c480b91a5afe1f259287c3c4173ec02f2b4854cb.tar.bz2
patch by Scott Bronson
kill the duplicated config.cpp and config.h file add proper default values so that kpacman actually works out of the box Config wanted to read kpacman.conf but this file did only exist globally
Diffstat (limited to 'noncore/games/kpacman/kpacman.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/kpacman.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index aee8eea..812e9ea 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -1,253 +1,256 @@
1 1
2#include "portable.h" 2#include "portable.h"
3 3
4#if defined( KDE2_PORT ) 4#if defined( KDE2_PORT )
5#include <kpacman.h> 5#include <kpacman.h>
6#include <kpacman.moc> 6#include <kpacman.moc>
7#include <kcolordlg.h> 7#include <kcolordlg.h>
8#elif defined( QPE_PORT ) 8#elif defined( QPE_PORT )
9#include <qmenubar.h> 9#include <qmenubar.h>
10#include "config.h" 10#include <qpe/config.h>
11#include <qapplication.h> 11#include <qapplication.h>
12#include "kpacman.h" 12#include "kpacman.h"
13#endif 13#endif
14 14
15#include <qkeycode.h> 15#include <qkeycode.h>
16#include <qcolor.h> 16#include <qcolor.h>
17#include <qstring.h> 17#include <qstring.h>
18#include <qpopmenu.h> 18#include <qpopmenu.h>
19#include <qmsgbox.h> 19#include <qmsgbox.h>
20 20
21Kpacman::Kpacman(QWidget *parent, const char *name) 21Kpacman::Kpacman(QWidget *parent, const char *name)
22 : KTMainWindow(parent, name) 22 : KTMainWindow(parent, name)
23{ 23{
24 schemesPopup = new QList<QPopupMenu>; 24 schemesPopup = new QList<QPopupMenu>;
25 schemesPopup->setAutoDelete(TRUE); 25 schemesPopup->setAutoDelete(TRUE);
26 26
27 menu(); 27 menu();
28 28
29 m_view = new QWidget( this, "m_view" ); 29 m_view = new QWidget( this, "m_view" );
30 m_view->setBackgroundColor( black ); 30 m_view->setBackgroundColor( black );
31 m_layout = new QGridLayout( m_view ); 31 m_layout = new QGridLayout( m_view );
32 m_layout->setMargin( 7 ); 32 m_layout->setMargin( 7 );
33 33
34 view = new KpacmanWidget( this, QString(name)+"widget"); 34 view = new KpacmanWidget( this, QString(name)+"widget");
35 m_layout->addWidget( view, 0, 0 ); 35 m_layout->addWidget( view, 0, 0 );
36 36
37 setCaption( "KPacman" ); 37 setCaption( "KPacman" );
38 38
39 view->referee->setFocus(); 39 view->referee->setFocus();
40 40
41 connect(view->referee, SIGNAL(setScore(int, int)), 41 connect(view->referee, SIGNAL(setScore(int, int)),
42 view->score, SLOT(setScore(int, int))); 42 view->score, SLOT(setScore(int, int)));
43 connect(view->referee, SIGNAL(setPoints(int)), 43 connect(view->referee, SIGNAL(setPoints(int)),
44 view->score, SLOT(set(int))); 44 view->score, SLOT(set(int)));
45 connect(view->referee, SIGNAL(setLifes(int)), 45 connect(view->referee, SIGNAL(setLifes(int)),
46 view->status, SLOT(setLifes(int))); 46 view->status, SLOT(setLifes(int)));
47 connect(view->referee, SIGNAL(setLevel(int)), 47 connect(view->referee, SIGNAL(setLevel(int)),
48 view->status, SLOT(setLevel(int))); 48 view->status, SLOT(setLevel(int)));
49 connect(view->referee, SIGNAL(forcedHallOfFame(bool)), 49 connect(view->referee, SIGNAL(forcedHallOfFame(bool)),
50 this, SLOT(forcedHallOfFame(bool))); 50 this, SLOT(forcedHallOfFame(bool)));
51 connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); 51 connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused()));
52 connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); 52 connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
53 53
54 connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); 54 connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
55 connect(view->score, SIGNAL(forcedHallOfFame(bool)), 55 connect(view->score, SIGNAL(forcedHallOfFame(bool)),
56 this, SLOT(forcedHallOfFame(bool))); 56 this, SLOT(forcedHallOfFame(bool)));
57 57
58 APP_CONFIG_BEGIN( cfg ); 58 APP_CONFIG_BEGIN( cfg );
59 focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); 59 focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE);
60 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); 60 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE);
61 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); 61 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE);
62 APP_CONFIG_END( cfg ); 62 APP_CONFIG_END( cfg );
63 63
64 toggleFocusOutPause(); 64 toggleFocusOutPause();
65 toggleFocusInContinue(); 65 toggleFocusInContinue();
66 toggleHideMouseCursor(); 66 toggleHideMouseCursor();
67 67
68 setCentralWidget( m_view ); 68 setCentralWidget( m_view );
69} 69}
70 70
71Kpacman::~Kpacman() 71Kpacman::~Kpacman()
72{ 72{
73 APP_CONFIG_BEGIN( cfg ); 73 /* APP_CONFIG_BEGIN( cfg );
74 cfg->writeEntry("FocusOutPause", focusOutPause); 74 cfg->writeEntry("FocusOutPause", focusOutPause);
75 cfg->writeEntry("FocusInContinue", focusInContinue); 75 cfg->writeEntry("FocusInContinue", focusInContinue);
76 cfg->writeEntry("HideMouseCursor", hideMouseCursor); 76 cfg->writeEntry("HideMouseCursor", hideMouseCursor);
77 APP_CONFIG_END( cfg ); 77 APP_CONFIG_END( cfg );
78 */
78 delete _menuBar; 79 delete _menuBar;
79} 80}
80 81
81void Kpacman::menu() 82void Kpacman::menu()
82{ 83{
83 gamePopup = new QPopupMenu(); 84 gamePopup = new QPopupMenu();
84 CHECK_PTR( gamePopup ); 85 CHECK_PTR( gamePopup );
85 newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); 86 newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2);
86 pauseID = gamePopup->insertItem(tr("&Pause"), 87 pauseID = gamePopup->insertItem(tr("&Pause"),
87 this, SLOT(pauseKpacman()), Key_F3); 88 this, SLOT(pauseKpacman()), Key_F3);
88 hofID = gamePopup->insertItem(tr("&Hall of fame"), 89 hofID = gamePopup->insertItem(tr("&Hall of fame"),
89 this, SLOT(toggleHallOfFame()), Key_F4); 90 this, SLOT(toggleHallOfFame()), Key_F4);
90 gamePopup->insertSeparator(); 91 gamePopup->insertSeparator();
91 gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q); 92 gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q);
92 gamePopup->setCheckable(TRUE); 93 gamePopup->setCheckable(TRUE);
93 94
94 optionsPopup = new QPopupMenu(); 95 optionsPopup = new QPopupMenu();
95 CHECK_PTR(optionsPopup); 96 CHECK_PTR(optionsPopup);
96 97
97 modesPopup = new QPopupMenu(); 98 modesPopup = new QPopupMenu();
98 CHECK_PTR(modesPopup); 99 CHECK_PTR(modesPopup);
99 100
100 hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"), 101 hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"),
101 this, SLOT(toggleHideMouseCursor()), 102 this, SLOT(toggleHideMouseCursor()),
102 CTRL+Key_H); 103 CTRL+Key_H);
103 optionsPopup->insertSeparator(); 104 optionsPopup->insertSeparator();
104 105
105 if (lookupSchemes() > 0) { 106 if (lookupSchemes() > 0) {
106 optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup); 107 optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup);
107 optionsPopup->insertSeparator(); 108 optionsPopup->insertSeparator();
108 } 109 }
109 110
110 focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"), 111 focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"),
111 this, SLOT(toggleFocusOutPause())); 112 this, SLOT(toggleFocusOutPause()));
112 focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"), 113 focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"),
113 this, SLOT(toggleFocusInContinue())); 114 this, SLOT(toggleFocusInContinue()));
114 optionsPopup->insertSeparator(); 115 optionsPopup->insertSeparator();
115 116
116 optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys())); 117 optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys()));
117 118
118#ifndef QPE_PORT 119#ifndef QPE_PORT
119 QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n" 120 QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n"
120 "Joerg Thoennissen (joe@dsite.de)\n\n" 121 "Joerg Thoennissen (joe@dsite.de)\n\n"
121 "A pacman game for the KDE Desktop\n\n" 122 "A pacman game for the KDE Desktop\n\n"
122 "The program based on the source of ksnake\n" 123 "The program based on the source of ksnake\n"
123 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" 124 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n"
124 "The design was strongly influenced by the pacman\n" 125 "The design was strongly influenced by the pacman\n"
125 "(c) 1980 MIDWAY MFG.CO.\n\n" 126 "(c) 1980 MIDWAY MFG.CO.\n\n"
126 "I like to thank my girlfriend Elke Krueers for\n" 127 "I like to thank my girlfriend Elke Krueers for\n"
127 "the last 10 years of her friendship.\n"); 128 "the last 10 years of her friendship.\n");
128 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); 129 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE);
129 aboutText.replace(QRegExp("@VERSION@"), VERSION); 130 aboutText.replace(QRegExp("@VERSION@"), VERSION);
130 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); 131 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE);
131#endif 132#endif
132 133
133 //_menuBar = new KMenuBar(this); 134 //_menuBar = new KMenuBar(this);
134 //CHECK_PTR( _menuBar ); 135 //CHECK_PTR( _menuBar );
135 //_menuBar->insertItem(tr("&Game"), gamePopup); 136 //_menuBar->insertItem(tr("&Game"), gamePopup);
136 //_menuBar->insertItem(tr("&Options"), optionsPopup); 137 //_menuBar->insertItem(tr("&Options"), optionsPopup);
137 //_menuBar->insertSeparator(); 138 //_menuBar->insertSeparator();
138#ifndef QPE_PORT 139#ifndef QPE_PORT
139 _menuBar->insertItem(tr("&Help"), helpPopup); 140 _menuBar->insertItem(tr("&Help"), helpPopup);
140#endif 141#endif
141} 142}
142 143
143int Kpacman::lookupSchemes() 144int Kpacman::lookupSchemes()
144{ 145{
145 APP_CONFIG_BEGIN( cfg ); 146 APP_CONFIG_BEGIN( cfg );
146 int ModeCount = cfg->readNumEntry("ModeCount", -1); 147 int ModeCount = cfg->readNumEntry("ModeCount", 0);
147 int Mode = cfg->readNumEntry("Mode", -1); 148 int Mode = cfg->readNumEntry("Mode", 0);
148 int SchemeCount = cfg->readNumEntry("SchemeCount"); 149 int SchemeCount = cfg->readNumEntry("SchemeCount", 0);
149 int Scheme = cfg->readNumEntry("Scheme", -1); 150 int Scheme = cfg->readNumEntry("Scheme", 0);
150 151
152 /*
151 if (SchemeCount == 0 || Scheme == -1) { 153 if (SchemeCount == 0 || Scheme == -1) {
152 QMessageBox::warning(this, tr("Configuration Error"), 154 QMessageBox::warning(this, tr("Configuration Error"),
153 tr("There are no schemes defined,\n" 155 tr("There are no schemes defined,\n"
154 "or no scheme is selected.")); 156 "or no scheme is selected."));
155 APP_CONFIG_END( cfg ); 157 APP_CONFIG_END( cfg );
156 return 0; 158 return 0;
157 } 159 }
160 */
158 161
159 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); 162 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int)));
160 modeID.resize(ModeCount > 0 ? ModeCount : 0); 163 modeID.resize(ModeCount > 0 ? ModeCount : 0);
161 164
162 if (!schemesPopup->isEmpty()) 165 if (!schemesPopup->isEmpty())
163 schemesPopup->clear(); 166 schemesPopup->clear();
164 167
165 SAVE_CONFIG_GROUP( cfg, oldgroup ); 168 SAVE_CONFIG_GROUP( cfg, oldgroup );
166 169
167 QString ModeGroup; 170 QString ModeGroup;
168 QString ModeName; 171 QString ModeName;
169 172
170 for (int m = 0; m < ModeCount; m++) { 173 for (int m = 0; m < ModeCount; m++) {
171 ModeGroup.sprintf("Mode %d", m); 174 ModeGroup.sprintf("Mode %d", m);
172 cfg->setGroup(ModeGroup); 175 cfg->setGroup(ModeGroup);
173 176
174 ModeName = cfg->readEntry("Description", ModeGroup); 177 ModeName = cfg->readEntry("Description", ModeGroup);
175 178
176 QPopupMenu *p = new QPopupMenu; 179 QPopupMenu *p = new QPopupMenu;
177 p->setCheckable(TRUE); 180 p->setCheckable(TRUE);
178 connect(p, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); 181 connect(p, SIGNAL(activated(int)), this, SLOT(schemeChecked(int)));
179 schemesPopup->append(p); 182 schemesPopup->append(p);
180 183
181 modeID[m] = modesPopup->insertItem(ModeName, schemesPopup->at(m)); 184 modeID[m] = modesPopup->insertItem(ModeName, schemesPopup->at(m));
182 modesPopup->setItemEnabled(modeID[m], FALSE); 185 modesPopup->setItemEnabled(modeID[m], FALSE);
183 modesPopup->setItemChecked(modeID[m], m == Mode); 186 modesPopup->setItemChecked(modeID[m], m == Mode);
184 } 187 }
185 188
186 schemeID.resize(SchemeCount); 189 schemeID.resize(SchemeCount);
187 schemeMode.resize(SchemeCount); 190 schemeMode.resize(SchemeCount);
188 191
189 QString SchemeGroup; 192 QString SchemeGroup;
190 QString SchemeName; 193 QString SchemeName;
191 int SchemeMode; 194 int SchemeMode;
192 195
193 for (int i = 0; i < SchemeCount; i++) { 196 for (int i = 0; i < SchemeCount; i++) {
194 SchemeGroup.sprintf("Scheme %d", i); 197 SchemeGroup.sprintf("Scheme %d", i);
195 cfg->setGroup(SchemeGroup); 198 cfg->setGroup(SchemeGroup);
196 199
197 SchemeName = cfg->readEntry("Description", SchemeGroup); 200 SchemeName = cfg->readEntry("Description", SchemeGroup);
198 SchemeMode = cfg->readNumEntry("Mode", -1); 201 SchemeMode = cfg->readNumEntry("Mode", -1);
199 202
200 schemeMode[i] = SchemeMode; 203 schemeMode[i] = SchemeMode;
201 if (SchemeMode == -1) { 204 if (SchemeMode == -1) {
202 schemeID[i] = modesPopup->insertItem(SchemeName); 205 schemeID[i] = modesPopup->insertItem(SchemeName);
203 modesPopup->setItemChecked(schemeID[i], i == Scheme); 206 modesPopup->setItemChecked(schemeID[i], i == Scheme);
204 } else { 207 } else {
205 schemeID[i] = schemesPopup->at(SchemeMode)->insertItem(SchemeName); 208 schemeID[i] = schemesPopup->at(SchemeMode)->insertItem(SchemeName);
206 schemesPopup->at(SchemeMode)-> 209 schemesPopup->at(SchemeMode)->
207 setItemChecked(schemeID[i], i == Scheme); 210 setItemChecked(schemeID[i], i == Scheme);
208 modesPopup->setItemEnabled(modeID[SchemeMode], TRUE); 211 modesPopup->setItemEnabled(modeID[SchemeMode], TRUE);
209 } 212 }
210 } 213 }
211 214
212 RESTORE_CONFIG_GROUP( cfg, oldgroup ); 215 RESTORE_CONFIG_GROUP( cfg, oldgroup );
213 216
214 APP_CONFIG_END( cfg ); 217 APP_CONFIG_END( cfg );
215 return SchemeCount; 218 return SchemeCount;
216} 219}
217 220
218void Kpacman::quitKpacman() 221void Kpacman::quitKpacman()
219{ 222{
220 APP_QUIT(); 223 APP_QUIT();
221} 224}
222 225
223void Kpacman::newKpacman() 226void Kpacman::newKpacman()
224{ 227{
225 if (!gamePopup->isItemEnabled(hofID)) 228 if (!gamePopup->isItemEnabled(hofID))
226 gamePopup->setItemEnabled(hofID, TRUE); 229 gamePopup->setItemEnabled(hofID, TRUE);
227 230
228 if (gamePopup->isItemChecked(hofID)) 231 if (gamePopup->isItemChecked(hofID))
229 toggleHallOfFame(); 232 toggleHallOfFame();
230 233
231 if (gamePopup->isItemChecked(pauseID)) 234 if (gamePopup->isItemChecked(pauseID))
232 pauseKpacman(); 235 pauseKpacman();
233 236
234 view->referee->play(); 237 view->referee->play();
235} 238}
236 239
237void Kpacman::pauseKpacman() 240void Kpacman::pauseKpacman()
238{ 241{
239 view->referee->pause(); 242 view->referee->pause();
240 view->score->setPause(gamePopup->isItemChecked(pauseID)); 243 view->score->setPause(gamePopup->isItemChecked(pauseID));
241} 244}
242 245
243void Kpacman::toggleHallOfFame() 246void Kpacman::toggleHallOfFame()
244{ 247{
245 gamePopup->setItemChecked(hofID, !gamePopup->isItemChecked(hofID)); 248 gamePopup->setItemChecked(hofID, !gamePopup->isItemChecked(hofID));
246 view->referee->toggleHallOfFame(); 249 view->referee->toggleHallOfFame();
247 250
248 if (gamePopup->isItemChecked(hofID)) { 251 if (gamePopup->isItemChecked(hofID)) {
249 view->referee->lower(); 252 view->referee->lower();
250 view->status->lower(); 253 view->status->lower();
251 } else { 254 } else {
252 view->status->raise(); 255 view->status->raise();
253 view->referee->raise(); 256 view->referee->raise();
@@ -256,109 +259,110 @@ void Kpacman::toggleHallOfFame()
256} 259}
257 260
258/* 261/*
259 * Disable or enable the "Hall of fame"-menuitem if the referee says so. 262 * Disable or enable the "Hall of fame"-menuitem if the referee says so.
260 * This is done, to disable turning off the "hall of fame"-display, in the automated 263 * This is done, to disable turning off the "hall of fame"-display, in the automated
261 * sequence of displaying the introduction, the demonstration (or playing) and the 264 * sequence of displaying the introduction, the demonstration (or playing) and the
262 * hall of fame. 265 * hall of fame.
263 * If on == TRUE then also lower the referee and the status widgets. 266 * If on == TRUE then also lower the referee and the status widgets.
264 */ 267 */
265void Kpacman::forcedHallOfFame(bool on) 268void Kpacman::forcedHallOfFame(bool on)
266{ 269{
267 if (!on && !gamePopup->isItemChecked(hofID)) 270 if (!on && !gamePopup->isItemChecked(hofID))
268 return; 271 return;
269 272
270 gamePopup->setItemEnabled(hofID, !on); 273 gamePopup->setItemEnabled(hofID, !on);
271 gamePopup->setItemChecked(hofID, on); 274 gamePopup->setItemChecked(hofID, on);
272 275
273 view->referee->toggleHallOfFame(); 276 view->referee->toggleHallOfFame();
274 if (on) { 277 if (on) {
275 view->referee->lower(); 278 view->referee->lower();
276 view->status->lower(); 279 view->status->lower();
277 } else { 280 } else {
278 view->status->raise(); 281 view->status->raise();
279 view->referee->raise(); 282 view->referee->raise();
280 view->referee->setFocus(); 283 view->referee->setFocus();
281 view->referee->intro(); 284 view->referee->intro();
282 } 285 }
283} 286}
284 287
285void Kpacman::togglePaused() 288void Kpacman::togglePaused()
286{ 289{
287 static bool checked = FALSE; 290 static bool checked = FALSE;
288 checked = !checked; 291 checked = !checked;
289 gamePopup->setItemChecked( pauseID, checked ); 292 gamePopup->setItemChecked( pauseID, checked );
290 view->score->setPause(gamePopup->isItemChecked(pauseID)); 293 view->score->setPause(gamePopup->isItemChecked(pauseID));
291} 294}
292 295
293/* 296/*
294 * This disables the "New Game" menuitem to prevent interruptions of the current 297 * This disables the "New Game" menuitem to prevent interruptions of the current
295 * play. 298 * play.
296 */ 299 */
297void Kpacman::toggleNew() 300void Kpacman::toggleNew()
298{ 301{
299 gamePopup->setItemEnabled(newID, !gamePopup->isItemEnabled(newID)); 302 gamePopup->setItemEnabled(newID, !gamePopup->isItemEnabled(newID));
300} 303}
301 304
302void Kpacman::toggleHideMouseCursor() 305void Kpacman::toggleHideMouseCursor()
303{ 306{
304 hideMouseCursor = !hideMouseCursor; 307 hideMouseCursor = !hideMouseCursor;
305 optionsPopup->setItemChecked(hideMouseCursorID, hideMouseCursor); 308 optionsPopup->setItemChecked(hideMouseCursorID, hideMouseCursor);
306 if (hideMouseCursor) 309 if (hideMouseCursor)
307 view->setCursor(blankCursor); 310 view->setCursor(blankCursor);
308 else 311 else
309 view->setCursor(arrowCursor); 312 view->setCursor(arrowCursor);
310} 313}
311 314
312void Kpacman::toggleFocusOutPause() 315void Kpacman::toggleFocusOutPause()
313{ 316{
314 focusOutPause = !focusOutPause; 317 focusOutPause = !focusOutPause;
315 optionsPopup->setItemChecked(focusOutPauseID, focusOutPause); 318 optionsPopup->setItemChecked(focusOutPauseID, focusOutPause);
316 view->referee->setFocusOutPause(focusOutPause); 319 view->referee->setFocusOutPause(focusOutPause);
317} 320}
318 321
319void Kpacman::toggleFocusInContinue() 322void Kpacman::toggleFocusInContinue()
320{ 323{
321 focusInContinue = !focusInContinue; 324 focusInContinue = !focusInContinue;
322 optionsPopup->setItemChecked(focusInContinueID, focusInContinue); 325 optionsPopup->setItemChecked(focusInContinueID, focusInContinue);
323 view->referee->setFocusInContinue(focusInContinue); 326 view->referee->setFocusInContinue(focusInContinue);
324} 327}
325 328
326void Kpacman::confKeys() 329void Kpacman::confKeys()
327{ 330{
328 Keys *keys = new Keys(); 331 Keys *keys = new Keys();
329 if (keys->exec() == QDialog::Accepted) { 332 if (keys->exec() == QDialog::Accepted) {
330 view->referee->initKeys(); 333 view->referee->initKeys();
331 view->score->initKeys(); 334 view->score->initKeys();
332 } 335 }
333 delete keys; 336 delete keys;
334} 337}
335 338
336void Kpacman::schemeChecked(int id) 339void Kpacman::schemeChecked(int id)
337{ 340{
338 int mode = 0, scheme = -1; 341 int mode = 0, scheme = -1;
339 342
340 for (uint s = 0; s < schemeID.size(); s++) { 343 for (uint s = 0; s < schemeID.size(); s++) {
341 if (schemeID[s] == id) { 344 if (schemeID[s] == id) {
342 scheme = s; 345 scheme = s;
343 mode = schemeMode[s]; 346 mode = schemeMode[s];
344 } 347 }
345 if (schemeMode[s] == -1) { 348 if (schemeMode[s] == -1) {
346 modesPopup->setItemChecked(schemeID[s], schemeID[s] == id); 349 modesPopup->setItemChecked(schemeID[s], schemeID[s] == id);
347 } else { 350 } else {
348 modesPopup->setItemChecked(modeID[schemeMode[s]], schemeMode[s] == mode); 351 modesPopup->setItemChecked(modeID[schemeMode[s]], schemeMode[s] == mode);
349 schemesPopup->at(schemeMode[s])->setItemChecked(schemeID[s], schemeID[s] == id); 352 schemesPopup->at(schemeMode[s])->setItemChecked(schemeID[s], schemeID[s] == id);
350 } 353 }
351 } 354 }
352 355 /*
353 APP_CONFIG_BEGIN( cfg ); 356 APP_CONFIG_BEGIN( cfg );
354 cfg->writeEntry("Scheme", scheme); 357 cfg->writeEntry("Scheme", scheme);
355 cfg->writeEntry("Mode", mode); 358 cfg->writeEntry("Mode", mode);
356 APP_CONFIG_END( cfg ); 359 APP_CONFIG_END( cfg );
360 */
357 361
358 view->setScheme(scheme, mode); 362 view->setScheme(scheme, mode);
359 view->updateGeometry(); 363 view->updateGeometry();
360 updateGeometry(); 364 updateGeometry();
361 update(); 365 update();
362 repaint(TRUE); 366 repaint(TRUE);
363 show(); 367 show();
364} 368}