summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-26 21:48:55 (UTC)
committer llornkcor <llornkcor>2002-10-26 21:48:55 (UTC)
commit995821ed8070504d482212b27d9f616a4eb07a3f (patch) (side-by-side diff)
treecb3ebda16107248544d4153743aacd73d2f81c19
parentff2c581b50252714fb4621d088cbf0961ed23f2b (diff)
downloadopie-995821ed8070504d482212b27d9f616a4eb07a3f.zip
opie-995821ed8070504d482212b27d9f616a4eb07a3f.tar.gz
opie-995821ed8070504d482212b27d9f616a4eb07a3f.tar.bz2
now remembers how many cards to turn
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/solitaire/canvascardwindow.cpp16
-rw-r--r--noncore/games/solitaire/opie-solitaire.control0
2 files changed, 13 insertions, 3 deletions
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp
index 450b4db..e836eb2 100644
--- a/noncore/games/solitaire/canvascardwindow.cpp
+++ b/noncore/games/solitaire/canvascardwindow.cpp
@@ -102,6 +102,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
drawId = settings->insertItem(tr("Turn One Card"), this, SLOT(drawnToggle()));
menu->insertItem(tr("Settings"),settings);
+ settings->setCheckable(TRUE);
#endif
@@ -111,11 +112,13 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f)
cfg.setGroup( "GlobalSettings" );
snapOn = cfg.readBoolEntry( "SnapOn", TRUE);
settings->setItemChecked(snap_id, snapOn);
+
gameType = cfg.readNumEntry( "GameType", -1 );
- drawThree = cfg.readBoolEntry( "DrawThree", TRUE);
+ drawThree = cfg.readBoolEntry( "DrawThree", FALSE);
if ( gameType == 0 ) {
cardGame = new PatienceCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(drawThree ? 3 : 1);
+
setCaption(tr("Patience"));
setCentralWidget(cardGame);
cardGame->readConfig( cfg );
@@ -166,6 +169,7 @@ CanvasCardWindow::~CanvasCardWindow()
cfg.writeEntry( "GameType", gameType );
cfg.writeEntry( "SnapOn", snapOn );
cfg.writeEntry( "DrawThree", drawThree);
+ cfg.write();
cardGame->writeConfig( cfg );
delete cardGame;
}
@@ -268,16 +272,22 @@ void CanvasCardWindow::snapToggle()
void CanvasCardWindow::drawnToggle()
{
+ drawThree=!drawThree;
+ Config cfg( "Patience" );
+ cfg.setGroup( "GlobalSettings" );
cardGame->toggleCardsDrawn();
updateDraw();
+ cfg.writeEntry( "DrawThree", drawThree);
+ cfg.write();
}
void CanvasCardWindow::updateDraw() {
- if(cardGame->cardsDrawn() == 3)
+ if(cardGame->cardsDrawn() == 3){
settings->changeItem(drawId, tr("Turn One Card"));
- else
+ } else {
settings->changeItem(drawId, tr("Turn Three Cards"));
}
+}
void CanvasCardWindow::setCardBacks()
diff --git a/noncore/games/solitaire/opie-solitaire.control b/noncore/games/solitaire/opie-solitaire.control
index f70fefa..4389360 100644
--- a/noncore/games/solitaire/opie-solitaire.control
+++ b/noncore/games/solitaire/opie-solitaire.control