Diffstat (limited to 'noncore/games/kpacman/kpacman.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/kpacman/kpacman.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp index be2e46d..9820e5a 100644 --- a/noncore/games/kpacman/kpacman.cpp +++ b/noncore/games/kpacman/kpacman.cpp | |||
@@ -1,133 +1,133 @@ | |||
1 | 1 | ||
2 | #include "portable.h" | 2 | #include "portable.h" |
3 | 3 | ||
4 | #if defined( KDE2_PORT ) | 4 | #if defined( KDE2_PORT ) |
5 | #include <kpacman.h> | 5 | #include <kpacman.h> |
6 | #include <kpacman.moc> | 6 | #include <kpacman.moc> |
7 | #include <kcolordlg.h> | 7 | #include <kcolordlg.h> |
8 | #elif defined( QPE_PORT ) | 8 | #elif defined( QPE_PORT ) |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
11 | #include <qapplication.h> | 11 | #include <qapplication.h> |
12 | #include "kpacman.h" | 12 | #include "kpacman.h" |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | 15 | ||
16 | Kpacman::Kpacman(QWidget *parent, const char *name) | 16 | Kpacman::Kpacman(QWidget *parent, const char *name) |
17 | : KTMainWindow(parent, name) | 17 | : KTMainWindow(parent, name) |
18 | { | 18 | { |
19 | schemesPopup = new QList<QPopupMenu>; | 19 | schemesPopup = new QList<QPopupMenu>; |
20 | schemesPopup->setAutoDelete(TRUE); | 20 | schemesPopup->setAutoDelete(TRUE); |
21 | 21 | ||
22 | menu(); | 22 | menu(); |
23 | 23 | ||
24 | m_view = new QWidget( this, "m_view" ); | 24 | m_view = new QWidget( this, "m_view" ); |
25 | m_view->setBackgroundColor( black ); | 25 | m_view->setBackgroundColor( black ); |
26 | m_layout = new QGridLayout( m_view ); | 26 | m_layout = new QGridLayout( m_view ); |
27 | m_layout->setMargin( 7 ); | 27 | m_layout->setMargin( 7 ); |
28 | 28 | ||
29 | view = new KpacmanWidget( this, QString(name)+"widget"); | 29 | view = new KpacmanWidget( this, QString(name)+"widget"); |
30 | m_layout->addWidget( view, 0, 0 ); | 30 | m_layout->addWidget( view, 0, 0 ); |
31 | 31 | ||
32 | setCaption( tr("KPacman") ); | 32 | setCaption( tr("KPacman") ); |
33 | 33 | ||
34 | view->referee->setFocus(); | 34 | view->referee->setFocus(); |
35 | 35 | ||
36 | connect(view->referee, SIGNAL(setScore(int, int)), | 36 | connect(view->referee, SIGNAL(setScore(int,int)), |
37 | view->score, SLOT(setScore(int, int))); | 37 | view->score, SLOT(setScore(int,int))); |
38 | connect(view->referee, SIGNAL(setPoints(int)), | 38 | connect(view->referee, SIGNAL(setPoints(int)), |
39 | view->score, SLOT(set(int))); | 39 | view->score, SLOT(set(int))); |
40 | connect(view->referee, SIGNAL(setLifes(int)), | 40 | connect(view->referee, SIGNAL(setLifes(int)), |
41 | view->status, SLOT(setLifes(int))); | 41 | view->status, SLOT(setLifes(int))); |
42 | connect(view->referee, SIGNAL(setLevel(int)), | 42 | connect(view->referee, SIGNAL(setLevel(int)), |
43 | view->status, SLOT(setLevel(int))); | 43 | view->status, SLOT(setLevel(int))); |
44 | connect(view->referee, SIGNAL(forcedHallOfFame(bool)), | 44 | connect(view->referee, SIGNAL(forcedHallOfFame(bool)), |
45 | this, SLOT(forcedHallOfFame(bool))); | 45 | this, SLOT(forcedHallOfFame(bool))); |
46 | connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); | 46 | connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused())); |
47 | connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); | 47 | connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew())); |
48 | 48 | ||
49 | connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); | 49 | connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew())); |
50 | connect(view->score, SIGNAL(forcedHallOfFame(bool)), | 50 | connect(view->score, SIGNAL(forcedHallOfFame(bool)), |
51 | this, SLOT(forcedHallOfFame(bool))); | 51 | this, SLOT(forcedHallOfFame(bool))); |
52 | 52 | ||
53 | APP_CONFIG_BEGIN( cfg ); | 53 | APP_CONFIG_BEGIN( cfg ); |
54 | focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); | 54 | focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE); |
55 | focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); | 55 | focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); |
56 | hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); | 56 | hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); |
57 | APP_CONFIG_END( cfg ); | 57 | APP_CONFIG_END( cfg ); |
58 | 58 | ||
59 | toggleFocusOutPause(); | 59 | toggleFocusOutPause(); |
60 | toggleFocusInContinue(); | 60 | toggleFocusInContinue(); |
61 | toggleHideMouseCursor(); | 61 | toggleHideMouseCursor(); |
62 | 62 | ||
63 | setCentralWidget( m_view ); | 63 | setCentralWidget( m_view ); |
64 | } | 64 | } |
65 | 65 | ||
66 | Kpacman::~Kpacman() | 66 | Kpacman::~Kpacman() |
67 | { | 67 | { |
68 | /* APP_CONFIG_BEGIN( cfg ); | 68 | /* APP_CONFIG_BEGIN( cfg ); |
69 | cfg->writeEntry("FocusOutPause", focusOutPause); | 69 | cfg->writeEntry("FocusOutPause", focusOutPause); |
70 | cfg->writeEntry("FocusInContinue", focusInContinue); | 70 | cfg->writeEntry("FocusInContinue", focusInContinue); |
71 | cfg->writeEntry("HideMouseCursor", hideMouseCursor); | 71 | cfg->writeEntry("HideMouseCursor", hideMouseCursor); |
72 | APP_CONFIG_END( cfg ); | 72 | APP_CONFIG_END( cfg ); |
73 | */ | 73 | */ |
74 | delete _menuBar; | 74 | delete _menuBar; |
75 | } | 75 | } |
76 | 76 | ||
77 | void Kpacman::menu() | 77 | void Kpacman::menu() |
78 | { | 78 | { |
79 | gamePopup = new QPopupMenu(); | 79 | gamePopup = new QPopupMenu(); |
80 | CHECK_PTR( gamePopup ); | 80 | CHECK_PTR( gamePopup ); |
81 | newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); | 81 | newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2); |
82 | pauseID = gamePopup->insertItem(tr("&Pause"), | 82 | pauseID = gamePopup->insertItem(tr("&Pause"), |
83 | this, SLOT(pauseKpacman()), Key_F3); | 83 | this, SLOT(pauseKpacman()), Key_F3); |
84 | hofID = gamePopup->insertItem(tr("&Hall of fame"), | 84 | hofID = gamePopup->insertItem(tr("&Hall of fame"), |
85 | this, SLOT(toggleHallOfFame()), Key_F4); | 85 | this, SLOT(toggleHallOfFame()), Key_F4); |
86 | gamePopup->insertSeparator(); | 86 | gamePopup->insertSeparator(); |
87 | gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q); | 87 | gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q); |
88 | gamePopup->setCheckable(TRUE); | 88 | gamePopup->setCheckable(TRUE); |
89 | 89 | ||
90 | optionsPopup = new QPopupMenu(); | 90 | optionsPopup = new QPopupMenu(); |
91 | CHECK_PTR(optionsPopup); | 91 | CHECK_PTR(optionsPopup); |
92 | 92 | ||
93 | modesPopup = new QPopupMenu(); | 93 | modesPopup = new QPopupMenu(); |
94 | CHECK_PTR(modesPopup); | 94 | CHECK_PTR(modesPopup); |
95 | 95 | ||
96 | hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"), | 96 | hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"), |
97 | this, SLOT(toggleHideMouseCursor()), | 97 | this, SLOT(toggleHideMouseCursor()), |
98 | CTRL+Key_H); | 98 | CTRL+Key_H); |
99 | optionsPopup->insertSeparator(); | 99 | optionsPopup->insertSeparator(); |
100 | 100 | ||
101 | if (lookupSchemes() > 0) { | 101 | if (lookupSchemes() > 0) { |
102 | optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup); | 102 | optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup); |
103 | optionsPopup->insertSeparator(); | 103 | optionsPopup->insertSeparator(); |
104 | } | 104 | } |
105 | 105 | ||
106 | focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"), | 106 | focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"), |
107 | this, SLOT(toggleFocusOutPause())); | 107 | this, SLOT(toggleFocusOutPause())); |
108 | focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"), | 108 | focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"), |
109 | this, SLOT(toggleFocusInContinue())); | 109 | this, SLOT(toggleFocusInContinue())); |
110 | optionsPopup->insertSeparator(); | 110 | optionsPopup->insertSeparator(); |
111 | 111 | ||
112 | optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys())); | 112 | optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys())); |
113 | 113 | ||
114 | #ifndef QPE_PORT | 114 | #ifndef QPE_PORT |
115 | QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n" | 115 | QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n" |
116 | "Joerg Thoennissen (joe@dsite.de)\n\n" | 116 | "Joerg Thoennissen (joe@dsite.de)\n\n" |
117 | "A pacman game for the KDE Desktop\n\n" | 117 | "A pacman game for the KDE Desktop\n\n" |
118 | "The program based on the source of ksnake\n" | 118 | "The program based on the source of ksnake\n" |
119 | "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" | 119 | "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" |
120 | "The design was strongly influenced by the pacman\n" | 120 | "The design was strongly influenced by the pacman\n" |
121 | "(c) 1980 MIDWAY MFG.CO.\n\n" | 121 | "(c) 1980 MIDWAY MFG.CO.\n\n" |
122 | "I like to thank my girlfriend Elke Krueers for\n" | 122 | "I like to thank my girlfriend Elke Krueers for\n" |
123 | "the last 10 years of her friendship.\n"); | 123 | "the last 10 years of her friendship.\n"); |
124 | aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); | 124 | aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); |
125 | aboutText.replace(QRegExp("@VERSION@"), VERSION); | 125 | aboutText.replace(QRegExp("@VERSION@"), VERSION); |
126 | QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); | 126 | QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); |
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | //_menuBar = new KMenuBar(this); | 129 | //_menuBar = new KMenuBar(this); |
130 | //CHECK_PTR( _menuBar ); | 130 | //CHECK_PTR( _menuBar ); |
131 | //_menuBar->insertItem(tr("&Game"), gamePopup); | 131 | //_menuBar->insertItem(tr("&Game"), gamePopup); |
132 | //_menuBar->insertItem(tr("&Options"), optionsPopup); | 132 | //_menuBar->insertItem(tr("&Options"), optionsPopup); |
133 | //_menuBar->insertSeparator(); | 133 | //_menuBar->insertSeparator(); |