summaryrefslogtreecommitdiff
path: root/noncore/games/qasteroids/toplevel.cpp
Unidiff
Diffstat (limited to 'noncore/games/qasteroids/toplevel.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/qasteroids/toplevel.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/noncore/games/qasteroids/toplevel.cpp b/noncore/games/qasteroids/toplevel.cpp
index 71daf60..c4fea89 100644
--- a/noncore/games/qasteroids/toplevel.cpp
+++ b/noncore/games/qasteroids/toplevel.cpp
@@ -66,37 +66,40 @@ SLevel levels[MAX_LEVELS] =
66 { 5, 0.7 }, 66 { 5, 0.7 },
67 { 5, 0.8 }, 67 { 5, 0.8 },
68 { 5, 0.9 }, 68 { 5, 0.9 },
69 { 5, 1.0 } 69 { 5, 1.0 }
70}; 70};
71 71
72const char *soundEvents[] = 72const char *soundEvents[] =
73{ 73{
74 "ShipDestroyed", 74 "ShipDestroyed",
75 "RockDestroyed", 75 "RockDestroyed",
76 0 76 0
77}; 77};
78 78
79const char *soundDefaults[] = 79const char *soundDefaults[] =
80{ 80{
81 "Explosion.wav", 81 "Explosion.wav",
82 "ploop.wav", 82 "ploop.wav",
83 0 83 0
84}; 84};
85 85
86 86
87KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name ) 87KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
88 : QMainWindow( parent, _name ) 88 : QMainWindow( parent, _name, fl )
89{ 89{
90 setCaption( tr("Asteroids") ); 90 setCaption( tr("Asteroids") );
91
92 QPEApplication::grabKeyboard();
93
91 QWidget *border = new QWidget( this ); 94 QWidget *border = new QWidget( this );
92 border->setBackgroundColor( black ); 95 border->setBackgroundColor( black );
93 setCentralWidget( border ); 96 setCentralWidget( border );
94 97
95 QVBoxLayout *borderLayout = new QVBoxLayout( border ); 98 QVBoxLayout *borderLayout = new QVBoxLayout( border );
96 99
97 QWidget *mainWin = new QWidget( border ); 100 QWidget *mainWin = new QWidget( border );
98 borderLayout->addWidget( mainWin, 2, AlignHCenter ); 101 borderLayout->addWidget( mainWin, 2, AlignHCenter );
99 102
100 view = new KAsteroidsView( mainWin ); 103 view = new KAsteroidsView( mainWin );
101 connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) ); 104 connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) );
102 connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) ); 105 connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) );
@@ -254,13 +257,13 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
254 actions.insert( Qt::Key_Enter, Shoot ); 257 actions.insert( Qt::Key_Enter, Shoot );
255 actions.insert( Qt::Key_Z, Teleport ); 258 actions.insert( Qt::Key_Z, Teleport );
256 actions.insert( Qt::Key_Down, Brake ); 259 actions.insert( Qt::Key_Down, Brake );
257 actions.insert( Qt::Key_P, Pause ); 260 actions.insert( Qt::Key_P, Pause );
258 261
259 262
260 struct utsname name; /* check for embedix kernel running on the zaurus, if 263 struct utsname name; /* check for embedix kernel running on the zaurus, if
261 lineo change string, this break 264 lineo change string, this break
262 */ 265 */
263 if (uname(&name) != -1) { 266 if (uname(&name) != -1) {
264 QString release=name.release; 267 QString release=name.release;
265 if(release.find("embedix",0,TRUE) !=-1) { 268 if(release.find("embedix",0,TRUE) !=-1) {
266 actions.insert( Key_F12, Launch ); 269 actions.insert( Key_F12, Launch );
@@ -392,13 +395,13 @@ void KAstTopLevel::keyReleaseEvent( QKeyEvent *event )
392 else 395 else
393 { 396 {
394 event->ignore(); 397 event->ignore();
395 return; 398 return;
396 } 399 }
397 break; 400 break;
398 401
399 case NewGame: 402 case NewGame:
400 slotNewGame(); 403 slotNewGame();
401 break; 404 break;
402/* 405/*
403 case Pause: 406 case Pause:
404 { 407 {