Diffstat (limited to 'noncore/games/solitaire/canvascardwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/solitaire/canvascardwindow.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index e1c021e..450b4db 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp @@ -22,8 +22,9 @@ #include "patiencecardgame.h" #include "freecellcardgame.h" #include "chicanecardgame.h" #include "harpcardgame.h" +#include "teeclubcardgame.h" #include <qpe/resource.h> #include <qmainwindow.h> @@ -62,8 +63,9 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F); file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F); file->insertItem(tr("Chicane"), this, SLOT(initChicane()), CTRL+Key_F); file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); + file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); menu->insertItem(tr("&Game"), file); menu->insertSeparator(); @@ -86,8 +88,9 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) file->insertItem(tr("Patience"), this, SLOT(initPatience())); file->insertItem(tr("Freecell"), this, SLOT(initFreecell())); file->insertItem(tr("Chicane"), this, SLOT(initChicane())); file->insertItem(tr("Harp"), this, SLOT(initHarp())); + file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub())); menu->insertItem(tr("Play"), file); menu->insertSeparator(); @@ -128,17 +131,22 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) cardGame = new ChicaneCardGame( &canvas, snapOn, this ); cardGame->setNumberToDraw(1); setCaption(tr("Chicane")); setCentralWidget(cardGame); - //cardGame->newGame(); // Until we know how to handle reading freecell config cardGame->readConfig( cfg ); setCardBacks(); } else if ( gameType == 3 ) { cardGame = new HarpCardGame( &canvas, snapOn, this ); cardGame->setNumberToDraw(1); setCaption(tr("Harp")); setCentralWidget(cardGame); - //cardGame->newGame(); // Until we know how to handle reading freecell config + cardGame->readConfig( cfg ); + setCardBacks(); + } else if ( gameType == 4 ) { + cardGame = new TeeclubCardGame( &canvas, snapOn, this ); + cardGame->setNumberToDraw(1); + setCaption(tr("Teeclub")); + setCentralWidget(cardGame); cardGame->readConfig( cfg ); setCardBacks(); } else { // Probably there isn't a config file or it is broken @@ -233,8 +241,24 @@ void CanvasCardWindow::initHarp() setCardBacks(); } +void CanvasCardWindow::initTeeclub() +{ + // Create New Game + if ( cardGame ) { + delete cardGame; + } + cardGame = new TeeclubCardGame( &canvas, snapOn, this ); + cardGame->setNumberToDraw(1); + gameType = 4; + setCaption(tr("Teeclub")); + setCentralWidget(cardGame); + cardGame->newGame(); + setCardBacks(); +} + + void CanvasCardWindow::snapToggle() { snapOn = !snapOn; settings->setItemChecked(snap_id, snapOn); |