Diffstat (limited to 'noncore/games/tetrix/ohighscoredlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/tetrix/ohighscoredlg.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/games/tetrix/ohighscoredlg.cpp b/noncore/games/tetrix/ohighscoredlg.cpp index cf0dcf7..7581f51 100644 --- a/noncore/games/tetrix/ohighscoredlg.cpp +++ b/noncore/games/tetrix/ohighscoredlg.cpp @@ -1,43 +1,44 @@ /*************************************************************************** begin : January 2003 copyright : ( C ) 2003 by Carsten Niehaus email : cniehaus@handhelds.org **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #include <qdialog.h> #include <qpe/config.h> #include <qlayout.h> #include <qpe/config.h> +#include <qpe/qpeapplication.h> #include <qstring.h> #include <qhbox.h> #include <qvbox.h> #include <qlabel.h> #include <qlistview.h> #include <qlineedit.h> #include "ohighscoredlg.h" OHighscore::OHighscore( int score , int playerLevel ) { pLevel = playerLevel; getList(); checkIfItIsANewhighscore( score ); } OHighscore::~OHighscore() { std::list<t_playerData*>::iterator deleteIterator = playerData.begin(); for ( ; deleteIterator != playerData.end() ; deleteIterator++ ) { delete ( *deleteIterator ); } @@ -148,49 +149,49 @@ QString OHighscore::getName() ed->setFocus ( ); if ( d->exec() == QDialog::Accepted ) { name = ed->text(); } //delete d; return name; } OHighscoreDialog::OHighscoreDialog(OHighscore *highscore, QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) { hs_ = highscore; setCaption( tr( "Highscores" ) ); vbox_layout = new QVBoxLayout( this, 4 , 4 ); list = new QListView( this ); list->setSorting( -1 ); list->addColumn( tr( "#" )); list->addColumn( tr( "Name" )); list->addColumn( tr( "Points" )); list->addColumn( tr( "Level" )); createHighscoreListView(); vbox_layout->addWidget( list ); - showMaximized(); + QPEApplication::showDialog( this ); } void OHighscoreDialog::createHighscoreListView() { int pos = 10; int points_ = 0; int level_ = 0; std::list<t_playerData*>::reverse_iterator iListe = hs_->playerData.rbegin(); for ( ; iListe != hs_->playerData.rend() ; ++iListe ) { QListViewItem *item = new QListViewItem( list ); item->setText( 0 , QString::number( pos ) ); //number item->setText( 1 , ( *iListe )->sName ); //name if ( ( *iListe )->points == -1 ) points_ = 0; else points_ = ( *iListe )->points; if ( ( *iListe )->level == -1 ) level_ = 0; else level_ = ( *iListe )->level; item->setText( 2 , QString::number( points_ ) ); //points item->setText( 3 , QString::number( level_ ) ); //level pos--; |