From c9543dc4edd3ea586c04e8114e133296ad9529d9 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 15 Nov 2004 14:28:50 +0000 Subject: Make SFCave quick launchable --- (limited to 'noncore/games') diff --git a/noncore/games/sfcave/opie-sfcave.control b/noncore/games/sfcave/opie-sfcave.control index 0ff3e2c..1d98a19 100644 --- a/noncore/games/sfcave/opie-sfcave.control +++ b/noncore/games/sfcave/opie-sfcave.control @@ -1,5 +1,5 @@ Package: opie-sfcave -Files: bin/sfcave apps/Games/sfcave.desktop pics/sfcave +Files: plugins/applications/libsfcave.so* bin/sfcave apps/Games/sfcave.desktop pics/sfcave Priority: optional Section: opie/games Maintainer: Andy Qua diff --git a/noncore/games/sfcave/sfcave.cpp b/noncore/games/sfcave/sfcave.cpp index 9b30fe6..5dca427 100644 --- a/noncore/games/sfcave/sfcave.cpp +++ b/noncore/games/sfcave/sfcave.cpp @@ -3,12 +3,10 @@ #include #include -#ifdef QWS -#include +#include #include -#else + #include -#endif #include #include "helpwindow.h" @@ -132,42 +130,18 @@ int SFCave::initialGateGaps[] = { 75, 50, 25 }; bool movel; -int main( int argc, char *argv[] ) -{ - movel = true; -#ifdef QWS - QPEApplication a( argc, argv ); -#else - QApplication a( argc, argv ); -#endif +OPIE_EXPORT_APP( Opie::Core::OApplicationFactory ) - int speed = 3; - for ( int i = 0 ; i < argc ; ++i ) - { - if ( strcmp( argv[i], "-s" ) == 0 ) - { - if ( i+1 < argc ) - speed = atoi( argv[i+1] ); - } - } - - SFCave app( speed ); - a.setMainWidget( &app ); - app.show(); - app.start(); - a.exec(); -} - -SFCave :: SFCave( int spd, QWidget *w, char *name ) - : QMainWindow( w, name ) +SFCave :: SFCave( QWidget *w, const char *name, WFlags fl ) + : QMainWindow( w, name, fl ) { - replayIt = 0; -#ifdef QWS showMaximized(); -#else - resize( 240, 284 ); -#endif + movel = true; + int spd = 3; + + + replayIt = 0; replayFile = QDir::home().path(); replayFile += "/sfcave.replay"; @@ -213,6 +187,8 @@ SFCave :: SFCave( int spd, QWidget *w, char *name ) gameTimer = new QTimer( this, "game timer" ); connect( gameTimer, SIGNAL( timeout() ), this, SLOT( run() ) ); + + QTimer::singleShot(0, this, SLOT(start())); } SFCave :: ~SFCave() diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h index b1fe819..7bdf881 100644 --- a/noncore/games/sfcave/sfcave.h +++ b/noncore/games/sfcave/sfcave.h @@ -95,9 +95,15 @@ public: double thrust; bool running; - SFCave( int speed = 3, QWidget *p = 0, char *name = 0 ); + SFCave( QWidget *p = 0, const char *name = 0, WFlags fl = 0 ); ~SFCave(); + + static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); } + +public slots: void start(); +public: + void setSeed( int seed ); int nextInt( int range ); void setUp(); diff --git a/noncore/games/sfcave/sfcave.pro b/noncore/games/sfcave/sfcave.pro index a0df828..3a26a79 100644 --- a/noncore/games/sfcave/sfcave.pro +++ b/noncore/games/sfcave/sfcave.pro @@ -1,6 +1,4 @@ -TEMPLATE = app -CONFIG += qt warn_on -DESTDIR = $(OPIEDIR)/bin +CONFIG += qt quick-app SOURCES = sfcave.cpp helpwindow.cpp random.cpp HEADERS = sfcave.h helpwindow.h random.h TARGET = sfcave @@ -9,5 +7,4 @@ DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe - include ( $(OPIEDIR)/include.pro ) -- cgit v0.9.0.2