Diffstat (limited to 'noncore/games/kpacman/kpacman.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/kpacman/kpacman.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp index aee8eea..812e9ea 100644 --- a/noncore/games/kpacman/kpacman.cpp +++ b/noncore/games/kpacman/kpacman.cpp @@ -1,22 +1,22 @@ #include "portable.h" #if defined( KDE2_PORT ) #include <kpacman.h> #include <kpacman.moc> #include <kcolordlg.h> #elif defined( QPE_PORT ) #include <qmenubar.h> -#include "config.h" +#include <qpe/config.h> #include <qapplication.h> #include "kpacman.h" #endif #include <qkeycode.h> #include <qcolor.h> #include <qstring.h> #include <qpopmenu.h> #include <qmsgbox.h> Kpacman::Kpacman(QWidget *parent, const char *name) : KTMainWindow(parent, name) @@ -61,29 +61,30 @@ Kpacman::Kpacman(QWidget *parent, const char *name) hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); APP_CONFIG_END( cfg ); toggleFocusOutPause(); toggleFocusInContinue(); toggleHideMouseCursor(); setCentralWidget( m_view ); } Kpacman::~Kpacman() { - APP_CONFIG_BEGIN( cfg ); + /* APP_CONFIG_BEGIN( cfg ); cfg->writeEntry("FocusOutPause", focusOutPause); cfg->writeEntry("FocusInContinue", focusInContinue); cfg->writeEntry("HideMouseCursor", hideMouseCursor); APP_CONFIG_END( cfg ); + */ delete _menuBar; } void Kpacman::menu() { gamePopup = new QPopupMenu(); CHECK_PTR( gamePopup ); newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); pauseID = gamePopup->insertItem(tr("&Pause"), this, SLOT(pauseKpacman()), Key_F3); hofID = gamePopup->insertItem(tr("&Hall of fame"), this, SLOT(toggleHallOfFame()), Key_F4); @@ -134,36 +135,38 @@ void Kpacman::menu() //CHECK_PTR( _menuBar ); //_menuBar->insertItem(tr("&Game"), gamePopup); //_menuBar->insertItem(tr("&Options"), optionsPopup); //_menuBar->insertSeparator(); #ifndef QPE_PORT _menuBar->insertItem(tr("&Help"), helpPopup); #endif } int Kpacman::lookupSchemes() { APP_CONFIG_BEGIN( cfg ); - int ModeCount = cfg->readNumEntry("ModeCount", -1); - int Mode = cfg->readNumEntry("Mode", -1); - int SchemeCount = cfg->readNumEntry("SchemeCount"); - int Scheme = cfg->readNumEntry("Scheme", -1); + int ModeCount = cfg->readNumEntry("ModeCount", 0); + int Mode = cfg->readNumEntry("Mode", 0); + int SchemeCount = cfg->readNumEntry("SchemeCount", 0); + int Scheme = cfg->readNumEntry("Scheme", 0); + /* if (SchemeCount == 0 || Scheme == -1) { QMessageBox::warning(this, tr("Configuration Error"), tr("There are no schemes defined,\n" "or no scheme is selected.")); APP_CONFIG_END( cfg ); return 0; } + */ connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); modeID.resize(ModeCount > 0 ? ModeCount : 0); if (!schemesPopup->isEmpty()) schemesPopup->clear(); SAVE_CONFIG_GROUP( cfg, oldgroup ); QString ModeGroup; QString ModeName; @@ -340,25 +343,26 @@ void Kpacman::schemeChecked(int id) for (uint s = 0; s < schemeID.size(); s++) { if (schemeID[s] == id) { scheme = s; mode = schemeMode[s]; } if (schemeMode[s] == -1) { modesPopup->setItemChecked(schemeID[s], schemeID[s] == id); } else { modesPopup->setItemChecked(modeID[schemeMode[s]], schemeMode[s] == mode); schemesPopup->at(schemeMode[s])->setItemChecked(schemeID[s], schemeID[s] == id); } } - + /* APP_CONFIG_BEGIN( cfg ); cfg->writeEntry("Scheme", scheme); cfg->writeEntry("Mode", mode); APP_CONFIG_END( cfg ); + */ view->setScheme(scheme, mode); view->updateGeometry(); updateGeometry(); update(); repaint(TRUE); show(); } |