Diffstat (limited to 'noncore/games/tetrix/qtetrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/tetrix/qtetrix.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/noncore/games/tetrix/qtetrix.cpp b/noncore/games/tetrix/qtetrix.cpp index f649894..6d29c3f 100644 --- a/noncore/games/tetrix/qtetrix.cpp +++ b/noncore/games/tetrix/qtetrix.cpp @@ -13,30 +13,33 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qtetrix.h" #include <qpe/resource.h> +#include <qpe/config.h> #include <qapplication.h> #include <qlabel.h> #include <qdatetime.h> #include <qlayout.h> +#include <qstring.h> +#include "ohighscoredlg.h" void drawTetrixButton( QPainter *p, int x, int y, int w, int h, const QColor *color ) { QColor fc; if ( color ) { QPointArray a; a.setPoints( 3, x,y+h-1, x,y, x+w-1,y ); p->setPen( color->light() ); p->drawPolyline( a ); a.setPoints( 3, x+1,y+h-1, x+w-1,y+h-1, x+w-1,y+1 ); @@ -152,19 +155,23 @@ QTetrix::QTetrix( QWidget *parent, const char *name, WFlags f ) connect( board, SIGNAL(updateRemovedSignal(int)), showLines, SLOT(setNum(int))); showScore->setNum( 0 ); showLevel->setNum( 0 ); showLines->setNum( 0 ); board->revealNextPiece(TRUE); board->setFocusPolicy( StrongFocus ); } void QTetrix::gameOver() { + OHighscore *hs = new OHighscore( showScore->text().toInt() , showLevel->text().toInt() ); + if ( hs->isNewhighscore ) + hs->insertData( hs->getName(), showScore->text().toInt() , showLevel->text().toInt() ); + OHighscoreDialog hscdlg( hs, this, "OHighscoreDialog", true ); + hscdlg.exec(); } - void QTetrix::quit() { close(); } |