Diffstat (limited to 'noncore/games/solitaire/canvascardwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/solitaire/canvascardwindow.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index e836eb2..317a02d 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp | |||
@@ -49,79 +49,79 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
49 | canvas.setBackgroundPixmap(bg); | 49 | canvas.setBackgroundPixmap(bg); |
50 | } | 50 | } |
51 | 51 | ||
52 | #if defined( QT_QWS_CASSIOPEIA ) | 52 | #if defined( QT_QWS_CASSIOPEIA ) |
53 | canvas.setAdvancePeriod(70); | 53 | canvas.setAdvancePeriod(70); |
54 | #else | 54 | #else |
55 | canvas.setAdvancePeriod(30); | 55 | canvas.setAdvancePeriod(30); |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | 58 | ||
59 | #ifdef _PATIENCE_USE_ACCELS_ | 59 | #ifdef _PATIENCE_USE_ACCELS_ |
60 | QPEMenuBar* menu = menuBar(); | 60 | QPEMenuBar* menu = menuBar(); |
61 | 61 | ||
62 | QPopupMenu* file = new QPopupMenu; | 62 | QPopupMenu* file = new QPopupMenu; |
63 | file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F); | 63 | file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F); |
64 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F); | 64 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F); |
65 | file->insertItem(tr("Chicane"), this, SLOT(initChicane()), CTRL+Key_F); | 65 | file->insertItem(tr("Chicane"), this, SLOT(initChicane()), CTRL+Key_F); |
66 | file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); | 66 | file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); |
67 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); | 67 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); |
68 | menu->insertItem(tr("&Game"), file); | 68 | menu->insertItem(tr("&Game"), file); |
69 | 69 | ||
70 | menu->insertSeparator(); | 70 | menu->insertSeparator(); |
71 | 71 | ||
72 | settings = new QPopupMenu; | 72 | settings = new QPopupMenu; |
73 | settings->insertItem(tr("&Change Card Backs"), this, SLOT(changeCardBacks()), Key_F2); | 73 | settings->insertItem(tr("&Change card backs"), this, SLOT(changeCardBacks()), Key_F2); |
74 | snap_id = settings->insertItem(tr("&Snap To Position"), this, SLOT(snapToggle()), Key_F3); | 74 | snap_id = settings->insertItem(tr("&Snap to position"), this, SLOT(snapToggle()), Key_F3); |
75 | settings->setCheckable(TRUE); | 75 | settings->setCheckable(TRUE); |
76 | menu->insertItem(tr("&Settings"),settings); | 76 | menu->insertItem(tr("&Settings"),settings); |
77 | 77 | ||
78 | menu->insertSeparator(); | 78 | menu->insertSeparator(); |
79 | 79 | ||
80 | QPopupMenu* help = new QPopupMenu; | 80 | QPopupMenu* help = new QPopupMenu; |
81 | help->insertItem(tr("&About"), this, SLOT(help()), Key_F1); | 81 | help->insertItem(tr("&About"), this, SLOT(help()), Key_F1); |
82 | help->setItemChecked(dbf_id, TRUE); | 82 | help->setItemChecked(dbf_id, TRUE); |
83 | menu->insertItem(tr("&Help"),help); | 83 | menu->insertItem(tr("&Help"),help); |
84 | #else | 84 | #else |
85 | QMenuBar* menu = menuBar(); | 85 | QMenuBar* menu = menuBar(); |
86 | 86 | ||
87 | QPopupMenu* file = new QPopupMenu; | 87 | QPopupMenu* file = new QPopupMenu; |
88 | file->insertItem(tr("Patience"), this, SLOT(initPatience())); | 88 | file->insertItem(tr("Patience"), this, SLOT(initPatience())); |
89 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell())); | 89 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell())); |
90 | file->insertItem(tr("Chicane"), this, SLOT(initChicane())); | 90 | file->insertItem(tr("Chicane"), this, SLOT(initChicane())); |
91 | file->insertItem(tr("Harp"), this, SLOT(initHarp())); | 91 | file->insertItem(tr("Harp"), this, SLOT(initHarp())); |
92 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub())); | 92 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub())); |
93 | menu->insertItem(tr("Play"), file); | 93 | menu->insertItem(tr("Play"), file); |
94 | 94 | ||
95 | menu->insertSeparator(); | 95 | menu->insertSeparator(); |
96 | 96 | ||
97 | settings = new QPopupMenu; | 97 | settings = new QPopupMenu; |
98 | settings->setCheckable(TRUE); | 98 | settings->setCheckable(TRUE); |
99 | settings->insertItem(tr("Change Card Backs"), this, SLOT(changeCardBacks())); | 99 | settings->insertItem(tr("Change card backs"), this, SLOT(changeCardBacks())); |
100 | snap_id = settings->insertItem(tr("Snap To Position"), this, SLOT(snapToggle())); | 100 | snap_id = settings->insertItem(tr("Snap to position"), this, SLOT(snapToggle())); |
101 | QString m; | 101 | QString m; |
102 | 102 | ||
103 | drawId = settings->insertItem(tr("Turn One Card"), this, SLOT(drawnToggle())); | 103 | drawId = settings->insertItem(tr("Turn one card"), this, SLOT(drawnToggle())); |
104 | menu->insertItem(tr("Settings"),settings); | 104 | menu->insertItem(tr("Settings"),settings); |
105 | settings->setCheckable(TRUE); | 105 | settings->setCheckable(TRUE); |
106 | 106 | ||
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | menu->show(); | 109 | menu->show(); |
110 | 110 | ||
111 | Config cfg( "Patience" ); | 111 | Config cfg( "Patience" ); |
112 | cfg.setGroup( "GlobalSettings" ); | 112 | cfg.setGroup( "GlobalSettings" ); |
113 | snapOn = cfg.readBoolEntry( "SnapOn", TRUE); | 113 | snapOn = cfg.readBoolEntry( "SnapOn", TRUE); |
114 | settings->setItemChecked(snap_id, snapOn); | 114 | settings->setItemChecked(snap_id, snapOn); |
115 | 115 | ||
116 | gameType = cfg.readNumEntry( "GameType", -1 ); | 116 | gameType = cfg.readNumEntry( "GameType", -1 ); |
117 | drawThree = cfg.readBoolEntry( "DrawThree", FALSE); | 117 | drawThree = cfg.readBoolEntry( "DrawThree", FALSE); |
118 | if ( gameType == 0 ) { | 118 | if ( gameType == 0 ) { |
119 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); | 119 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); |
120 | cardGame->setNumberToDraw(drawThree ? 3 : 1); | 120 | cardGame->setNumberToDraw(drawThree ? 3 : 1); |
121 | 121 | ||
122 | setCaption(tr("Patience")); | 122 | setCaption(tr("Patience")); |
123 | setCentralWidget(cardGame); | 123 | setCentralWidget(cardGame); |
124 | cardGame->readConfig( cfg ); | 124 | cardGame->readConfig( cfg ); |
125 | setCardBacks(); | 125 | setCardBacks(); |
126 | } else if ( gameType == 1 ) { | 126 | } else if ( gameType == 1 ) { |
127 | cardGame = new FreecellCardGame( &canvas, snapOn, this ); | 127 | cardGame = new FreecellCardGame( &canvas, snapOn, this ); |
@@ -262,51 +262,51 @@ void CanvasCardWindow::initTeeclub() | |||
262 | } | 262 | } |
263 | 263 | ||
264 | 264 | ||
265 | void CanvasCardWindow::snapToggle() | 265 | void CanvasCardWindow::snapToggle() |
266 | { | 266 | { |
267 | snapOn = !snapOn; | 267 | snapOn = !snapOn; |
268 | settings->setItemChecked(snap_id, snapOn); | 268 | settings->setItemChecked(snap_id, snapOn); |
269 | cardGame->toggleSnap(); | 269 | cardGame->toggleSnap(); |
270 | } | 270 | } |
271 | 271 | ||
272 | 272 | ||
273 | void CanvasCardWindow::drawnToggle() | 273 | void CanvasCardWindow::drawnToggle() |
274 | { | 274 | { |
275 | drawThree=!drawThree; | 275 | drawThree=!drawThree; |
276 | Config cfg( "Patience" ); | 276 | Config cfg( "Patience" ); |
277 | cfg.setGroup( "GlobalSettings" ); | 277 | cfg.setGroup( "GlobalSettings" ); |
278 | cardGame->toggleCardsDrawn(); | 278 | cardGame->toggleCardsDrawn(); |
279 | updateDraw(); | 279 | updateDraw(); |
280 | cfg.writeEntry( "DrawThree", drawThree); | 280 | cfg.writeEntry( "DrawThree", drawThree); |
281 | cfg.write(); | 281 | cfg.write(); |
282 | } | 282 | } |
283 | 283 | ||
284 | void CanvasCardWindow::updateDraw() { | 284 | void CanvasCardWindow::updateDraw() { |
285 | if(cardGame->cardsDrawn() == 3){ | 285 | if(cardGame->cardsDrawn() == 3){ |
286 | settings->changeItem(drawId, tr("Turn One Card")); | 286 | settings->changeItem(drawId, tr("Turn one card")); |
287 | } else { | 287 | } else { |
288 | settings->changeItem(drawId, tr("Turn Three Cards")); | 288 | settings->changeItem(drawId, tr("Turn three cards")); |
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
293 | void CanvasCardWindow::setCardBacks() | 293 | void CanvasCardWindow::setCardBacks() |
294 | { | 294 | { |
295 | QCanvasItemList l = canvas.allItems(); | 295 | QCanvasItemList l = canvas.allItems(); |
296 | 296 | ||
297 | for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { | 297 | for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { |
298 | if ( (*it)->rtti() == canvasCardId ) | 298 | if ( (*it)->rtti() == canvasCardId ) |
299 | ((CanvasCard *)(*it))->setCardBack( cardBack ); | 299 | ((CanvasCard *)(*it))->setCardBack( cardBack ); |
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | void CanvasCardWindow::changeCardBacks() | 304 | void CanvasCardWindow::changeCardBacks() |
305 | { | 305 | { |
306 | cardBack++; | 306 | cardBack++; |
307 | 307 | ||
308 | if (cardBack == 5) | 308 | if (cardBack == 5) |
309 | cardBack = 0; | 309 | cardBack = 0; |
310 | 310 | ||
311 | setCardBacks(); | 311 | setCardBacks(); |
312 | } | 312 | } |