summaryrefslogtreecommitdiff
path: root/noncore/games
authorzecke <zecke>2004-11-15 14:45:23 (UTC)
committer zecke <zecke>2004-11-15 14:45:23 (UTC)
commit74febba2749d3a8eefc13c1f46a0f7f5fc095d5a (patch) (side-by-side diff)
tree421efd9b22184e94bf4dfdcd02e83fd567cece8f /noncore/games
parent2423fe1ba41caf6977afaf7df3156522b54db819 (diff)
downloadopie-74febba2749d3a8eefc13c1f46a0f7f5fc095d5a.zip
opie-74febba2749d3a8eefc13c1f46a0f7f5fc095d5a.tar.gz
opie-74febba2749d3a8eefc13c1f46a0f7f5fc095d5a.tar.bz2
-Make HELP_TEXT translatable
-Make HelpWindow a QWidget
Diffstat (limited to 'noncore/games') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave/helpwindow.cpp77
-rw-r--r--noncore/games/sfcave/helpwindow.h4
-rw-r--r--noncore/games/sfcave/sfcave.cpp7
3 files changed, 42 insertions, 46 deletions
diff --git a/noncore/games/sfcave/helpwindow.cpp b/noncore/games/sfcave/helpwindow.cpp
index 8a5d034..bd6035a 100644
--- a/noncore/games/sfcave/helpwindow.cpp
+++ b/noncore/games/sfcave/helpwindow.cpp
@@ -23,55 +23,52 @@
#include "helpwindow.h"
-#define HELP_TEXT \
-"<qt><h1>SFCave Help</h1><p> " \
-"SFCave is a flying game for the Zaurus.<br><br> " \
-"The aim is to stay alive for as long as possible and get the highest score " \
-"you can.<br><br>" \
-"There are three game types currently - SFCave, Gates, and Fly.<br>" \
-"<b>SFCave</b> is a remake of the classic SFCave game - fly through the " \
-"cavern avoiding all the blocks that just happen to be hanging in " \
-"midair<br><br>" \
-"<b>Gates</b> is similar to SFCave but instead you must fly through the " \
-"without crashing.<br><br>" \
-"<b>Fly</b> is somewhat different to SFCave and above. Instead, you have " \
-"are flying in the open air above a scrolling landscape, and the aim is to " \
-"hug the ground - the closer to the land you fly the more points " \
-"scored.<br><br><br>" \
-"Basic instruction - Press <b>Up</B> or <b>Down</b> on the circle pad to " \
-"start a new game, press the middle of the pad to apply thrust (makes you " \
-"go up), and release the pad to remove thrust and drop down.<br><br>" \
-"Also, if playing the Fly game, you can press z to toggle the display " \
-"of the scoring zones. This will display 4 red lines at varying heights " \
-"above the landscape - if your ship falls into this zone, point are scored. " \
-"The closer to the landscape you get the more points you get.<br><br>" \
-"In addition, SFCave has replays - save and load too so you can show off to all " \
-"your friends (or vice versa). Currently, this is in its infancy but will improve.<br>" \
-"To use, once you have crashed, press 'r' to replay the last game.<br>" \
-"To save the replay press 's'.<br>" \
-"To load a saved replay press 'l' (after you've crashed at least once).<br><br>" \
-"Replays are currently saved to your home directory in a file called sfcave.replay." \
-"This file can be copied and given to others as long as it it put in their home directory.<br><br>" \
-"Have lots of fun.<br>" \
-"Andy" \
-"</p></qt>"
+static QString HELP_TEXT() {
+return QObject::tr("<qt><h1>SFCave Help</h1><p> "
+ "SFCave is a flying game for the Zaurus.<br><br> "
+ "The aim is to stay alive for as long as possible and get the highest score "
+ "you can.<br><br>"
+ "There are three game types currently - SFCave, Gates, and Fly.<br>"
+ "<b>SFCave</b> is a remake of the classic SFCave game - fly through the "
+ "cavern avoiding all the blocks that just happen to be hanging in "
+ "midair<br><br>"
+ "<b>Gates</b> is similar to SFCave but instead you must fly through the "
+ "without crashing.<br><br>"
+ "<b>Fly</b> is somewhat different to SFCave and above. Instead, you have "
+ "are flying in the open air above a scrolling landscape, and the aim is to "
+ "hug the ground - the closer to the land you fly the more points "
+ "scored.<br><br><br>"
+ "Basic instruction - Press <b>Up</B> or <b>Down</b> on the circle pad to "
+ "start a new game, press the middle of the pad to apply thrust (makes you "
+ "go up), and release the pad to remove thrust and drop down.<br><br>"
+ "Also, if playing the Fly game, you can press z to toggle the display "
+ "of the scoring zones. This will display 4 red lines at varying heights "
+ "above the landscape - if your ship falls into this zone, point are scored. "
+ "The closer to the landscape you get the more points you get.<br><br>"
+ "In addition, SFCave has replays - save and load too so you can show off to all "
+ "your friends (or vice versa). Currently, this is in its infancy but will improve.<br>"
+ "To use, once you have crashed, press 'r' to replay the last game.<br>"
+ "To save the replay press 's'.<br>"
+ "To load a saved replay press 'l' (after you've crashed at least once).<br><br>"
+ "Replays are currently saved to your home directory in a file called sfcave.replay."
+ "This file can be copied and given to others as long as it it put in their home directory.<br><br>"
+ "Have lots of fun.<br>"
+ "Andy"
+ "</p></qt>");
+}
-HelpWindow::HelpWindow( QWidget *parent, const char *name, bool modal, WFlags flags )
- : QDialog( parent, name, modal, flags )
+HelpWindow::HelpWindow( QWidget *parent, const char *name)
+ : QWidget( parent, name, WDestructiveClose )
{
-// resize( 230, 280 );
-
- setCaption( "Help for SFCave" );
+ setCaption( tr("Help for SFCave") );
QVBoxLayout *layout = new QVBoxLayout( this );
- QString text = HELP_TEXT;;
+ QString text = HELP_TEXT();;
QTextView *view = new QTextView( text, 0, this, "view" );
layout->insertSpacing( -1, 5 );
layout->insertWidget( -1, view );
layout->insertSpacing( -1, 5 );
-
- QPEApplication::showDialog( this );
}
HelpWindow::~HelpWindow()
diff --git a/noncore/games/sfcave/helpwindow.h b/noncore/games/sfcave/helpwindow.h
index edc1b6e..0aaba7e 100644
--- a/noncore/games/sfcave/helpwindow.h
+++ b/noncore/games/sfcave/helpwindow.h
@@ -24,10 +24,10 @@
*@author Andy Qua
*/
-class HelpWindow : public QDialog
+class HelpWindow : public QWidget
{
public:
- HelpWindow( QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags flags = 0 );
+ HelpWindow( QWidget *parent = 0, const char *name = 0);
~HelpWindow();
};
diff --git a/noncore/games/sfcave/sfcave.cpp b/noncore/games/sfcave/sfcave.cpp
index d5aa38a..a6c92a0 100644
--- a/noncore/games/sfcave/sfcave.cpp
+++ b/noncore/games/sfcave/sfcave.cpp
@@ -4,10 +4,10 @@
#include <time.h>
#include <opie2/oapplicationfactory.h>
+#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/global.h>
-#include <qapplication.h>
#include <qdir.h>
#include "helpwindow.h"
@@ -1139,9 +1139,8 @@ void SFCave :: dealWithMenuSelection()
case MENU_HELP:
{
// Display Help Menu
- HelpWindow *dlg = new HelpWindow( this );
- dlg->exec();
- delete dlg;
+ HelpWindow *win = new HelpWindow( );
+ QPEApplication::showWidget( win );
break;
}