summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman/kpacman.cpp
Unidiff
Diffstat (limited to 'noncore/games/kpacman/kpacman.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/kpacman.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index 7df6ef0..d9d2d69 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -17,31 +17,33 @@
17#include <qstring.h> 17#include <qstring.h>
18#include <qpopmenu.h> 18#include <qpopmenu.h>
19#include <qmsgbox.h> 19#include <qmsgbox.h>
20 20
21Kpacman::Kpacman(QWidget *parent, const char *name) 21Kpacman::Kpacman(QWidget *parent, const char *name)
22 : KTMainWindow(parent, name) 22 : KTMainWindow(parent, name)
23{ 23{
24 schemesPopup = new QList<QPopupMenu>; 24 schemesPopup = new QList<QPopupMenu>;
25 schemesPopup->setAutoDelete(TRUE); 25 schemesPopup->setAutoDelete(TRUE);
26 26
27 menu(); 27 menu();
28 28
29 view = new KpacmanWidget( this, QString(name)+"widget"); 29 m_view = new QWidget( this, "m_view" );
30 m_view->setBackgroundColor( black );
31 m_layout = new QGridLayout( m_view );
32 m_layout->setMargin( 7 );
30 33
31#ifndef QWS 34 view = new KpacmanWidget( this, QString(name)+"widget");
32 setFixedSize(view->width(), view->height()); 35 m_layout->addWidget( view, 0, 0 );
33#else 36
34 setCaption( "Kpacman" ); 37 setCaption( "KPacman" );
35#endif
36 38
37 view->referee->setFocus(); 39 view->referee->setFocus();
38 40
39 connect(view->referee, SIGNAL(setScore(int, int)), 41 connect(view->referee, SIGNAL(setScore(int, int)),
40 view->score, SLOT(setScore(int, int))); 42 view->score, SLOT(setScore(int, int)));
41 connect(view->referee, SIGNAL(setPoints(int)), 43 connect(view->referee, SIGNAL(setPoints(int)),
42 view->score, SLOT(set(int))); 44 view->score, SLOT(set(int)));
43 connect(view->referee, SIGNAL(setLifes(int)), 45 connect(view->referee, SIGNAL(setLifes(int)),
44 view->status, SLOT(setLifes(int))); 46 view->status, SLOT(setLifes(int)));
45 connect(view->referee, SIGNAL(setLevel(int)), 47 connect(view->referee, SIGNAL(setLevel(int)),
46 view->status, SLOT(setLevel(int))); 48 view->status, SLOT(setLevel(int)));
47 connect(view->referee, SIGNAL(forcedHallOfFame(bool)), 49 connect(view->referee, SIGNAL(forcedHallOfFame(bool)),
@@ -54,32 +56,25 @@ Kpacman::Kpacman(QWidget *parent, const char *name)
54 this, SLOT(forcedHallOfFame(bool))); 56 this, SLOT(forcedHallOfFame(bool)));
55 57
56 APP_CONFIG_BEGIN( cfg ); 58 APP_CONFIG_BEGIN( cfg );
57 focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); 59 focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE);
58 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); 60 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE);
59 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); 61 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE);
60 APP_CONFIG_END( cfg ); 62 APP_CONFIG_END( cfg );
61 63
62 toggleFocusOutPause(); 64 toggleFocusOutPause();
63 toggleFocusInContinue(); 65 toggleFocusInContinue();
64 toggleHideMouseCursor(); 66 toggleHideMouseCursor();
65 67
66#ifndef QWS 68 setCentralWidget( m_view );
67 menuBar->show();
68 view->show();
69 setMenu(menuBar);
70 setView(view);
71#else
72 setCentralWidget( view );
73#endif
74} 69}
75 70
76Kpacman::~Kpacman() 71Kpacman::~Kpacman()
77{ 72{
78 APP_CONFIG_BEGIN( cfg ); 73 APP_CONFIG_BEGIN( cfg );
79 cfg->writeEntry("FocusOutPause", focusOutPause); 74 cfg->writeEntry("FocusOutPause", focusOutPause);
80 cfg->writeEntry("FocusInContinue", focusInContinue); 75 cfg->writeEntry("FocusInContinue", focusInContinue);
81 cfg->writeEntry("HideMouseCursor", hideMouseCursor); 76 cfg->writeEntry("HideMouseCursor", hideMouseCursor);
82 APP_CONFIG_END( cfg ); 77 APP_CONFIG_END( cfg );
83 delete _menuBar; 78 delete _menuBar;
84} 79}
85 80