author | zecke <zecke> | 2004-02-06 12:28:33 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-06 12:28:33 (UTC) |
commit | c0207d7284d0f91a3a20f4abda2c6846c8dd8595 (patch) (unidiff) | |
tree | c95157ef87c805d870a68400858ff65b1ded03ac /noncore/games/minesweep/minesweep.cpp | |
parent | 0c74629e8f5c12a9b5a282b817f884fa10dee491 (diff) | |
download | opie-c0207d7284d0f91a3a20f4abda2c6846c8dd8595.zip opie-c0207d7284d0f91a3a20f4abda2c6846c8dd8595.tar.gz opie-c0207d7284d0f91a3a20f4abda2c6846c8dd8595.tar.bz2 |
Merge with Qtopia sources
Diffstat (limited to 'noncore/games/minesweep/minesweep.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/minesweep/minesweep.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp index 7214a73..d707dab 100644 --- a/noncore/games/minesweep/minesweep.cpp +++ b/noncore/games/minesweep/minesweep.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qtopia/qpeapplication.h> |
25 | #include <qpe/resource.h> | 25 | #include <qtopia/resource.h> |
26 | #include <qpe/config.h> | 26 | #include <qtopia/config.h> |
27 | 27 | ||
28 | #include <qpe/qpetoolbar.h> | 28 | #include <qtoolbar.h> |
29 | #include <qmenubar.h> | 29 | #include <qmenubar.h> |
@@ -200,2 +200,3 @@ void ResultIndicator::center() | |||
200 | QSize s = sizeHint()*3; | 200 | QSize s = sizeHint()*3; |
201 | s.setWidth( QMIN(s.width(), w->width()) ); | ||
201 | pp = QPoint( pp.x() + w->width()/2 - s.width()/2, | 202 | pp = QPoint( pp.x() + w->width()/2 - s.width()/2, |
@@ -226,4 +227,7 @@ public: | |||
226 | MineFrame( QWidget *parent, const char *name = 0 ) | 227 | MineFrame( QWidget *parent, const char *name = 0 ) |
227 | :QFrame( parent, name ) {} | 228 | :QFrame( parent, name ), field(0) {} |
228 | void setField( MineField *f ) { field = f; } | 229 | void setField( MineField *f ) { |
230 | field = f; | ||
231 | setMinimumSize( field->sizeHint() ); | ||
232 | } | ||
229 | protected: | 233 | protected: |
@@ -242,6 +246,6 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
242 | { | 246 | { |
243 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); | ||
244 | srand(::time(0)); | 247 | srand(::time(0)); |
245 | setCaption( tr("Mine Hunt") ); | 248 | setCaption( tr("Mine Hunt") ); |
246 | setIcon( Resource::loadPixmap( "minesweep_icon" ) ); | 249 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); |
250 | setIcon( Resource::loadPixmap( "minesweep/MineHunt" ) ); | ||
247 | 251 | ||
@@ -255,3 +259,6 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
255 | gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) ); | 259 | gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) ); |
256 | gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); | 260 | |
261 | if (qApp->desktop()->width() >= 240) { | ||
262 | gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); | ||
263 | } | ||
257 | 264 | ||
@@ -301,4 +308,4 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
301 | 308 | ||
302 | connect( field, SIGNAL( gameOver( bool ) ), this, SLOT( gameOver( bool ) ) ); | 309 | connect( field, SIGNAL( gameOver(bool) ), this, SLOT( gameOver(bool) ) ); |
303 | connect( field, SIGNAL( mineCount( int ) ), this, SLOT( setCounter( int ) ) ); | 310 | connect( field, SIGNAL( mineCount(int) ), this, SLOT( setCounter(int) ) ); |
304 | connect( field, SIGNAL( gameStarted()), this, SLOT( startPlaying() ) ); | 311 | connect( field, SIGNAL( gameStarted()), this, SLOT( startPlaying() ) ); |
@@ -306,3 +313,2 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
306 | timer = new QTimer( this ); | 313 | timer = new QTimer( this ); |
307 | |||
308 | connect( timer, SIGNAL( timeout() ), this, SLOT( updateTime() ) ); | 314 | connect( timer, SIGNAL( timeout() ), this, SLOT( updateTime() ) ); |