summaryrefslogtreecommitdiff
path: root/noncore/games/qasteroids/toplevel.cpp
Side-by-side diff
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] =
{ 5, 0.7 },
{ 5, 0.8 },
{ 5, 0.9 },
{ 5, 1.0 }
};
-const char *soundEvents[] =
+const char *soundEvents[] =
{
"ShipDestroyed",
"RockDestroyed",
0
};
-const char *soundDefaults[] =
+const char *soundDefaults[] =
{
"Explosion.wav",
"ploop.wav",
0
};
-
-KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
- : QMainWindow( parent, _name )
+
+KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
+ : QMainWindow( parent, _name, fl )
{
setCaption( tr("Asteroids") );
+
+ QPEApplication::grabKeyboard();
+
QWidget *border = new QWidget( this );
border->setBackgroundColor( black );
setCentralWidget( border );
QVBoxLayout *borderLayout = new QVBoxLayout( border );
-
+
QWidget *mainWin = new QWidget( border );
borderLayout->addWidget( mainWin, 2, AlignHCenter );
view = new KAsteroidsView( mainWin );
connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) );
connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) );
@@ -254,13 +257,13 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name )
actions.insert( Qt::Key_Enter, Shoot );
actions.insert( Qt::Key_Z, Teleport );
actions.insert( Qt::Key_Down, Brake );
actions.insert( Qt::Key_P, Pause );
- struct utsname name; /* check for embedix kernel running on the zaurus, if
+ struct utsname name; /* check for embedix kernel running on the zaurus, if
lineo change string, this break
*/
if (uname(&name) != -1) {
QString release=name.release;
if(release.find("embedix",0,TRUE) !=-1) {
actions.insert( Key_F12, Launch );
@@ -392,13 +395,13 @@ void KAstTopLevel::keyReleaseEvent( QKeyEvent *event )
else
{
event->ignore();
return;
}
break;
-
+
case NewGame:
slotNewGame();
break;
/*
case Pause:
{