Diffstat (limited to 'noncore/games/solitaire/canvascardwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/canvascardwindow.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index 4c365a5..e1c021e 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp | |||
@@ -22,4 +22,6 @@ | |||
22 | #include "patiencecardgame.h" | 22 | #include "patiencecardgame.h" |
23 | #include "freecellcardgame.h" | 23 | #include "freecellcardgame.h" |
24 | #include "chicanecardgame.h" | ||
25 | #include "harpcardgame.h" | ||
24 | 26 | ||
25 | #include <qpe/resource.h> | 27 | #include <qpe/resource.h> |
@@ -60,4 +62,6 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
60 | file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F); | 62 | file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F); |
61 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F); | 63 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F); |
64 | file->insertItem(tr("Chicane"), this, SLOT(initChicane()), CTRL+Key_F); | ||
65 | file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); | ||
62 | menu->insertItem(tr("&Game"), file); | 66 | menu->insertItem(tr("&Game"), file); |
63 | 67 | ||
@@ -82,4 +86,6 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
82 | file->insertItem(tr("Patience"), this, SLOT(initPatience())); | 86 | file->insertItem(tr("Patience"), this, SLOT(initPatience())); |
83 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell())); | 87 | file->insertItem(tr("Freecell"), this, SLOT(initFreecell())); |
88 | file->insertItem(tr("Chicane"), this, SLOT(initChicane())); | ||
89 | file->insertItem(tr("Harp"), this, SLOT(initHarp())); | ||
84 | menu->insertItem(tr("Play"), file); | 90 | menu->insertItem(tr("Play"), file); |
85 | 91 | ||
@@ -119,4 +125,20 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
119 | cardGame->readConfig( cfg ); | 125 | cardGame->readConfig( cfg ); |
120 | setCardBacks(); | 126 | setCardBacks(); |
127 | } else if ( gameType == 2 ) { | ||
128 | cardGame = new ChicaneCardGame( &canvas, snapOn, this ); | ||
129 | cardGame->setNumberToDraw(1); | ||
130 | setCaption(tr("Chicane")); | ||
131 | setCentralWidget(cardGame); | ||
132 | //cardGame->newGame(); // Until we know how to handle reading freecell config | ||
133 | cardGame->readConfig( cfg ); | ||
134 | setCardBacks(); | ||
135 | } else if ( gameType == 3 ) { | ||
136 | cardGame = new HarpCardGame( &canvas, snapOn, this ); | ||
137 | cardGame->setNumberToDraw(1); | ||
138 | setCaption(tr("Harp")); | ||
139 | setCentralWidget(cardGame); | ||
140 | //cardGame->newGame(); // Until we know how to handle reading freecell config | ||
141 | cardGame->readConfig( cfg ); | ||
142 | setCardBacks(); | ||
121 | } else { | 143 | } else { |
122 | // Probably there isn't a config file or it is broken | 144 | // Probably there isn't a config file or it is broken |
@@ -182,4 +204,35 @@ void CanvasCardWindow::initFreecell() | |||
182 | 204 | ||
183 | 205 | ||
206 | void CanvasCardWindow::initChicane() | ||
207 | { | ||
208 | // Create New Game | ||
209 | if ( cardGame ) { | ||
210 | delete cardGame; | ||
211 | } | ||
212 | cardGame = new ChicaneCardGame( &canvas, snapOn, this ); | ||
213 | cardGame->setNumberToDraw(1); | ||
214 | gameType = 2; | ||
215 | setCaption(tr("Chicane")); | ||
216 | setCentralWidget(cardGame); | ||
217 | cardGame->newGame(); | ||
218 | setCardBacks(); | ||
219 | } | ||
220 | |||
221 | void CanvasCardWindow::initHarp() | ||
222 | { | ||
223 | // Create New Game | ||
224 | if ( cardGame ) { | ||
225 | delete cardGame; | ||
226 | } | ||
227 | cardGame = new HarpCardGame( &canvas, snapOn, this ); | ||
228 | cardGame->setNumberToDraw(1); | ||
229 | gameType = 3; | ||
230 | setCaption(tr("Harp")); | ||
231 | setCentralWidget(cardGame); | ||
232 | cardGame->newGame(); | ||
233 | setCardBacks(); | ||
234 | } | ||
235 | |||
236 | |||
184 | void CanvasCardWindow::snapToggle() | 237 | void CanvasCardWindow::snapToggle() |
185 | { | 238 | { |