-rw-r--r-- | noncore/games/solitaire/canvascardwindow.cpp | 15 | ||||
-rw-r--r-- | noncore/games/solitaire/canvascardwindow.h | 1 | ||||
-rw-r--r-- | noncore/games/solitaire/carddeck.cpp | 2 | ||||
-rw-r--r-- | noncore/games/solitaire/main.cpp | 14 | ||||
-rwxr-xr-x | noncore/games/solitaire/solitaire.pro | 5 |
5 files changed, 14 insertions, 23 deletions
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index dec5591..c12344a 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp | |||
@@ -37,6 +37,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
37 | cardGame(NULL) | 37 | cardGame(NULL) |
38 | { | 38 | { |
39 | setIcon( Resource::loadPixmap( "cards" ) ); | 39 | setIcon( Resource::loadPixmap( "cards" ) ); |
40 | setCaption(tr("Patience")); | ||
40 | 41 | ||
41 | // Create Playing Area for Games | 42 | // Create Playing Area for Games |
42 | if ( QPixmap::defaultDepth() < 12 ) { | 43 | if ( QPixmap::defaultDepth() < 12 ) { |
@@ -45,7 +46,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
45 | canvas.setBackgroundColor(QColor(0x08, 0x98, 0x2D)); | 46 | canvas.setBackgroundColor(QColor(0x08, 0x98, 0x2D)); |
46 | } else { | 47 | } else { |
47 | QPixmap bg; | 48 | QPixmap bg; |
48 | bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither ); | 49 | bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither ); |
49 | canvas.setBackgroundPixmap(bg); | 50 | canvas.setBackgroundPixmap(bg); |
50 | } | 51 | } |
51 | 52 | ||
@@ -66,7 +67,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
66 | file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); | 67 | file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F); |
67 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); | 68 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F); |
68 | menu->insertItem(tr("&Game"), file); | 69 | menu->insertItem(tr("&Game"), file); |
69 | 70 | ||
70 | menu->insertSeparator(); | 71 | menu->insertSeparator(); |
71 | 72 | ||
72 | settings = new QPopupMenu; | 73 | settings = new QPopupMenu; |
@@ -91,7 +92,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
91 | file->insertItem(tr("Harp"), this, SLOT(initHarp())); | 92 | file->insertItem(tr("Harp"), this, SLOT(initHarp())); |
92 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub())); | 93 | file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub())); |
93 | menu->insertItem(tr("Play"), file); | 94 | menu->insertItem(tr("Play"), file); |
94 | 95 | ||
95 | menu->insertSeparator(); | 96 | menu->insertSeparator(); |
96 | 97 | ||
97 | settings = new QPopupMenu; | 98 | settings = new QPopupMenu; |
@@ -118,7 +119,7 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) | |||
118 | if ( gameType == 0 ) { | 119 | if ( gameType == 0 ) { |
119 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); | 120 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); |
120 | cardGame->setNumberToDraw(drawThree ? 3 : 1); | 121 | cardGame->setNumberToDraw(drawThree ? 3 : 1); |
121 | 122 | ||
122 | setCaption(tr("Patience")); | 123 | setCaption(tr("Patience")); |
123 | setCentralWidget(cardGame); | 124 | setCentralWidget(cardGame); |
124 | cardGame->readConfig( cfg ); | 125 | cardGame->readConfig( cfg ); |
@@ -186,7 +187,7 @@ void CanvasCardWindow::resizeEvent(QResizeEvent *) | |||
186 | 187 | ||
187 | void CanvasCardWindow::initPatience() | 188 | void CanvasCardWindow::initPatience() |
188 | { | 189 | { |
189 | // Create New Game | 190 | // Create New Game |
190 | if ( cardGame ) | 191 | if ( cardGame ) |
191 | delete cardGame; | 192 | delete cardGame; |
192 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); | 193 | cardGame = new PatienceCardGame( &canvas, snapOn, this ); |
@@ -253,13 +254,13 @@ void CanvasCardWindow::initTeeclub() | |||
253 | delete cardGame; | 254 | delete cardGame; |
254 | } | 255 | } |
255 | cardGame = new TeeclubCardGame( &canvas, snapOn, this ); | 256 | cardGame = new TeeclubCardGame( &canvas, snapOn, this ); |
256 | cardGame->setNumberToDraw(1); | 257 | cardGame->setNumberToDraw(1); |
257 | gameType = 4; | 258 | gameType = 4; |
258 | setCaption(tr("Teeclub")); | 259 | setCaption(tr("Teeclub")); |
259 | setCentralWidget(cardGame); | 260 | setCentralWidget(cardGame); |
260 | cardGame->newGame(); | 261 | cardGame->newGame(); |
261 | setCardBacks(); | 262 | setCardBacks(); |
262 | } | 263 | } |
263 | 264 | ||
264 | 265 | ||
265 | void CanvasCardWindow::snapToggle() | 266 | void CanvasCardWindow::snapToggle() |
diff --git a/noncore/games/solitaire/canvascardwindow.h b/noncore/games/solitaire/canvascardwindow.h index eddb184..abd6af6 100644 --- a/noncore/games/solitaire/canvascardwindow.h +++ b/noncore/games/solitaire/canvascardwindow.h | |||
@@ -33,6 +33,7 @@ class CanvasCardWindow : public QMainWindow { | |||
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | 34 | ||
35 | public: | 35 | public: |
36 | static QString appName() { return QString::fromLatin1("patience"); } | ||
36 | CanvasCardWindow(QWidget* parent=0, const char* name=0, WFlags f=0); | 37 | CanvasCardWindow(QWidget* parent=0, const char* name=0, WFlags f=0); |
37 | virtual ~CanvasCardWindow(); | 38 | virtual ~CanvasCardWindow(); |
38 | 39 | ||
diff --git a/noncore/games/solitaire/carddeck.cpp b/noncore/games/solitaire/carddeck.cpp index a2d0076..b130131 100644 --- a/noncore/games/solitaire/carddeck.cpp +++ b/noncore/games/solitaire/carddeck.cpp | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | CardDeck::CardDeck(int jokers, int numOfDecks) : numberOfJokers(jokers), numberOfDecks(numOfDecks), deckCreated(FALSE) | 26 | CardDeck::CardDeck(int jokers, int numOfDecks) : numberOfJokers(jokers), numberOfDecks(numOfDecks), deckCreated(FALSE) |
27 | { | 27 | { |
28 | cards = new (Card *)[getNumberOfCards()]; | 28 | cards = new Card *[getNumberOfCards()]; |
29 | } | 29 | } |
30 | 30 | ||
31 | 31 | ||
diff --git a/noncore/games/solitaire/main.cpp b/noncore/games/solitaire/main.cpp index f81aa3c..bd3cf8b 100644 --- a/noncore/games/solitaire/main.cpp +++ b/noncore/games/solitaire/main.cpp | |||
@@ -21,16 +21,6 @@ | |||
21 | #include "canvascardwindow.h" | 21 | #include "canvascardwindow.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <opie/oapplicationfactory.h> | ||
24 | 25 | ||
25 | 26 | OPIE_EXPORT_APP( OApplicationFactory<CanvasCardWindow> ) \ No newline at end of file | |
26 | int main( int argc, char ** argv ) | ||
27 | { | ||
28 | QPEApplication a( argc, argv ); | ||
29 | |||
30 | CanvasCardWindow m; | ||
31 | m.setCaption( CanvasCardWindow::tr("Patience") ); | ||
32 | a.showMainWidget( &m ); | ||
33 | |||
34 | return a.exec(); | ||
35 | } | ||
36 | |||
diff --git a/noncore/games/solitaire/solitaire.pro b/noncore/games/solitaire/solitaire.pro index 1ac62c3..b1b8bda 100755 --- a/noncore/games/solitaire/solitaire.pro +++ b/noncore/games/solitaire/solitaire.pro | |||
@@ -1,7 +1,5 @@ | |||
1 | TEMPLATE = app | ||
2 | 1 | ||
3 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release quick-app |
4 | DESTDIR = $(OPIEDIR)/bin | ||
5 | 3 | ||
6 | HEADERS = canvascard.h canvasshapes.h cardgame.h cardgamelayout.h cardpile.h card.h carddeck.h \ | 4 | HEADERS = canvascard.h canvasshapes.h cardgame.h cardgamelayout.h cardpile.h card.h carddeck.h \ |
7 | canvascardgame.h freecellcardgame.h chicanecardgame.h harpcardgame.h teeclubcardgame.h \ | 5 | canvascardgame.h freecellcardgame.h chicanecardgame.h harpcardgame.h teeclubcardgame.h \ |
@@ -18,4 +16,5 @@ INCLUDEPATH += $(OPIEDIR)/include | |||
18 | DEPENDPATH += $(OPIEDIR)/include | 16 | DEPENDPATH += $(OPIEDIR)/include |
19 | LIBS += -lqpe | 17 | LIBS += -lqpe |
20 | 18 | ||
19 | |||
21 | include ( $(OPIEDIR)/include.pro ) | 20 | include ( $(OPIEDIR)/include.pro ) |