summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kbill/UI.cpp6
-rw-r--r--noncore/games/kbill/kbill.cpp30
2 files changed, 18 insertions, 18 deletions
diff --git a/noncore/games/kbill/UI.cpp b/noncore/games/kbill/UI.cpp
index fac731a..2afaf9b 100644
--- a/noncore/games/kbill/UI.cpp
+++ b/noncore/games/kbill/UI.cpp
@@ -50,55 +50,55 @@ void UI::kill_timer() {
50void UI::initialize(int *argc, char **argv) { 50void UI::initialize(int *argc, char **argv) {
51 #ifdef KDEVER 51 #ifdef KDEVER
52 app = new KApplication(*argc, argv, "kbill"); 52 app = new KApplication(*argc, argv, "kbill");
53 #endif 53 #endif
54 app = new QPEApplication(*argc, argv); 54 app = new QPEApplication(*argc, argv);
55} 55}
56 56
57void UI::graph_init() { 57void UI::graph_init() {
58 pix = new QPixmap(Game::scrwidth, Game::scrheight); 58 pix = new QPixmap(Game::scrwidth, Game::scrheight);
59 paint.begin(pix, field); 59 paint.begin(pix, field);
60 paint.setPen(QPen(Qt::black, 3)); 60 paint.setPen(QPen(Qt::black, 3));
61} 61}
62 62
63void UI::make_mainwin() { 63void UI::make_mainwin() {
64 main = new KBill(); 64 main = new KBill();
65 app->showMainWidget(main,true); 65 app->showMainWidget(main,true);
66 main->showMaximized(); 66 main->showMaximized();
67 field = main->getField(); 67 field = main->getField();
68} 68}
69 69
70void UI::popup_dialog (int dialog) { 70void UI::popup_dialog (int dialog) {
71 kill_timer(); 71 kill_timer();
72 switch (dialog) { 72 switch (dialog) {
73 case Game::ENDGAME: 73 case Game::ENDGAME:
74 QMessageBox::message(("Endgame"), (endgamestr)); 74 QMessageBox::message(("Endgame"), QT_TR_NOOP(endgamestr));
75 break; 75 break;
76 case Game::HIGHSCORE: 76 case Game::HIGHSCORE:
77 //QMessageBox::message(("HighScore"), highscorestr); 77 //QMessageBox::message(("HighScore"), highscorestr);
78 break; 78 break;
79 case Game::ENTERNAME: { 79 case Game::ENTERNAME: {
80 InputBox b(main, 0, ("Enter Name"), (enternamestr)); 80 InputBox b(main, 0, ("Enter Name"), QT_TR_NOOP(enternamestr));
81 bool state = b.exec() == 2; 81 bool state = b.exec() == 2;
82 char str[20], *nl; 82 char str[20], *nl;
83 strcpy(str, b.getText()); 83 strcpy(str, b.getText());
84 if (!str[0] || state) 84 if (!str[0] || state)
85 strcpy(str, "Anonymous"); 85 strcpy(str, "Anonymous");
86 else if ((nl = strchr(str, '\n'))) 86 else if ((nl = strchr(str, '\n')))
87 *nl = '\0'; 87 *nl = '\0';
88 if (strlen(str) > 20) 88 if (strlen(str) > 20)
89 str[20] = 0; /* truncate string if too long */ 89 str[20] = 0; /* truncate string if too long */
90 // scores.recalc(str); 90 // scores.recalc(str);
91 } 91 }
92 break; 92 break;
93 case Game::SCORE: 93 case Game::SCORE:
94 QMessageBox::message(("Score"), scorestr); 94 QMessageBox::message(("Score"), scorestr);
95 break; 95 break;
96 } 96 }
97 restart_timer(); 97 restart_timer();
98} 98}
99 99
100/*********************/ 100/*********************/
101/* Graphics routines */ 101/* Graphics routines */
102/*********************/ 102/*********************/
103 103
104void UI::set_cursor(int cursor) { 104void UI::set_cursor(int cursor) {
@@ -150,26 +150,26 @@ void UI::draw_line(int x1, int y1, int x2, int y2) {
150 150
151void UI::draw_str(char *str, int x, int y) { 151void UI::draw_str(char *str, int x, int y) {
152 paint.drawText(x, y, str); 152 paint.drawText(x, y, str);
153} 153}
154 154
155 155
156/******************/ 156/******************/
157/* Other routines */ 157/* Other routines */
158/******************/ 158/******************/
159 159
160void UI::set_pausebutton (int action) { 160void UI::set_pausebutton (int action) {
161 main->file->setItemEnabled(main->pauseid, action); 161 main->file->setItemEnabled(main->pauseid, action);
162} 162}
163 163
164 164
165int UI::MainLoop() { 165int UI::MainLoop() {
166 return app->exec(); 166 return app->exec();
167} 167}
168 168
169void UI::update_hsbox(char *str) { 169void UI::update_hsbox(char *str) {
170 highscorestr = str; 170 highscorestr = str;
171} 171}
172 172
173void UI::update_scorebox(int level, int score) { 173void UI::update_scorebox(int level, int score) {
174 scorestr.sprintf ("%s %d:\n%s: %d", ("After Level"), level, ("Your score"), score); 174 scorestr.sprintf ("%s %d:\n%s: %d", QT_TR_NOOP("After Level"), level, QT_TR_NOOP("Your score"), score);
175} 175}
diff --git a/noncore/games/kbill/kbill.cpp b/noncore/games/kbill/kbill.cpp
index 9fcfd5d..afeaeb5 100644
--- a/noncore/games/kbill/kbill.cpp
+++ b/noncore/games/kbill/kbill.cpp
@@ -7,126 +7,126 @@
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include <qmessagebox.h> 18#include <qmessagebox.h>
19#include <qmultilinedit.h> 19#include <qmultilinedit.h>
20#include <qmenubar.h> 20#include <qmenubar.h>
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22#include <qfont.h> 22#include <qfont.h>
23#include <qwidget.h> 23#include <qwidget.h>
24#include "kbill.h" 24#include "kbill.h"
25#include "inputbox.h" 25#include "inputbox.h"
26#include "helpdialog.h" 26#include "helpdialog.h"
27#include "objects.h" 27#include "objects.h"
28#include "Strings.h" 28#include "Strings.h"
29 29
30KBill::KBill() : QMainWindow() { 30KBill::KBill() : QMainWindow() {
31 setCaption("kBill"); 31 setCaption(tr("kBill"));
32 file = new QPopupMenu(); 32 file = new QPopupMenu();
33 file->insertItem(("New game"), this, SLOT(NewGame())); 33 file->insertItem(tr("New game"), this, SLOT(NewGame()));
34 pauseid = file->insertItem(("Pause game"), this, SLOT(Pause())); 34 pauseid = file->insertItem(tr("Pause game"), this, SLOT(Pause()));
35 //these are dissabled until I fix them 35 //these are dissabled until I fix them
36 //file->insertItem(("Warp to level..."), this, SLOT(WarpTo())); 36 //file->insertItem(tr("Warp to level..."), this, SLOT(WarpTo()));
37 //file->insertItem(("View high scores"), this, SLOT(ViewHighScores())); 37 //file->insertItem(tr("View high scores"), this, SLOT(ViewHighScores()));
38 38
39 39
40 help = new QPopupMenu(); 40 help = new QPopupMenu();
41 help->insertItem(("Story of kBill"), this, SLOT(Story())); 41 help->insertItem(tr("Story of kBill"), this, SLOT(Story()));
42 help->insertItem(("Rules"), this, SLOT(Rules())); 42 help->insertItem(tr("Rules"), this, SLOT(Rules()));
43 43
44 44
45 menu = new QMenuBar(this); 45 menu = new QMenuBar(this);
46 menu->insertItem(("&File"), file); 46 menu->insertItem(tr("&File"), file);
47 menu->insertSeparator(); 47 menu->insertSeparator();
48 menu->insertItem(("&Help"), help); 48 menu->insertItem(tr("&Help"), help);
49 49
50 field = new Field(this); 50 field = new Field(this);
51 //setView(field); 51 //setView(field);
52 //setMainWidget(field); 52 //setMainWidget(field);
53 //setMenu(menu); 53 //setMenu(menu);
54} 54}
55 55
56KBill::~KBill() { 56KBill::~KBill() {
57} 57}
58 58
59Field* KBill::getField() { 59Field* KBill::getField() {
60 return field; 60 return field;
61} 61}
62 62
63// ----------------------------------------------------------------------- 63// -----------------------------------------------------------------------
64 64
65void KBill::Quit() { 65void KBill::Quit() {
66 field->stopTimer(); 66 field->stopTimer();
67 qApp->quit(); 67 qApp->quit();
68 68
69} 69}
70 70
71void KBill::About(){ 71void KBill::About(){
72 // field->stopTimer(); 72 // field->stopTimer();
73 // AboutBox about(this); 73 // AboutBox about(this);
74 // about.exec(); 74 // about.exec();
75 // field->startTimer(); 75 // field->startTimer();
76} 76}
77 77
78void KBill::NewGame() { 78void KBill::NewGame() {
79 field->stopTimer(); 79 field->stopTimer();
80 // if (KMsgBox::yesNo(this, i18n("New Game"), i18n(newgamestr), KMsgBox::QUESTION) == 1) 80 // if (KMsgBox::yesNo(this, i18n("New Game"), i18n(newgamestr), KMsgBox::QUESTION) == 1)
81 game.start(1); 81 game.start(1);
82 // else 82 // else
83 field->startTimer(); 83 field->startTimer();
84} 84}
85 85
86void KBill::Pause() { 86void KBill::Pause() {
87 field->stopTimer(); 87 field->stopTimer();
88 QMessageBox::message(("Pause Game"), (pausestr), 0); 88 QMessageBox::message(tr("Pause Game"), tr(pausestr), 0);
89 field->startTimer(); 89 field->startTimer();
90} 90}
91 91
92void KBill::WarpTo() { 92void KBill::WarpTo() {
93 /* field->stopTimer(); 93 /* field->stopTimer();
94 InputBox b(this, 0, "Warp To Level", warpstr); 94 InputBox b(this, 0, "Warp To Level", tr(warpstr));
95 bool status = b.exec() == 1; 95 bool status = b.exec() == 1;
96 field->startTimer(); 96 field->startTimer();
97 if (status) { 97 if (status) {
98 bool ok; 98 bool ok;
99 int level = b.getText().toUInt(&ok); 99 int level = b.getText().toUInt(&ok);
100 if (ok) { 100 if (ok) {
101 field->startTimer(); 101 field->startTimer();
102 game.warp_to_level(level); 102 game.warp_to_level(level);
103 return; 103 return;
104 } 104 }
105 }*/ 105 }*/
106} 106}
107 107
108void KBill::ViewHighScores() { 108void KBill::ViewHighScores() {
109 //ui.popup_dialog(Game::HIGHSCORE); 109 //ui.popup_dialog(Game::HIGHSCORE);
110} 110}
111 111
112void KBill::Story() { 112void KBill::Story() {
113 field->stopTimer(); 113 field->stopTimer();
114 HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1); 114 HelpDialog *stryDialog = new HelpDialog(this,"helpdialog",1);
115 QString stryString = "<b>The Story</b><p>Yet again, the fate of the world rests in your hands! An evil computer hacker, known only by his handle 'Bill', has created the ultimate computer virus. A virus so powerful that it has the power to transmute an ordinary computer into a toaster oven. (oooh!) 'Bill' has cloned himself into a billion-jillion micro-Bills. Their sole purpose is to deliver the nefarious virus, which has been cleverly diguised as a popular operating system. As System Administrator and Exterminator, your job is to keep Bill from succeeding at his task."; 115 QString stryString = tr("<b>The Story</b><p>Yet again, the fate of the world rests in your hands! An evil computer hacker, known only by his handle 'Bill', has created the ultimate computer virus. A virus so powerful that it has the power to transmute an ordinary computer into a toaster oven. (oooh!) 'Bill' has cloned himself into a billion-jillion micro-Bills. Their sole purpose is to deliver the nefarious virus, which has been cleverly diguised as a popular operating system. As System Administrator and Exterminator, your job is to keep Bill from succeeding at his task.");
116 stryDialog->setCaption("The story of KBill"); 116 stryDialog->setCaption(tr("The story of KBill"));
117 stryDialog->TextBrowser1->setText(stryString); 117 stryDialog->TextBrowser1->setText(stryString);
118 stryDialog->resize(200,200); 118 stryDialog->resize(200,200);
119 stryDialog->show(); 119 stryDialog->show();
120 field->startTimer(); 120 field->startTimer();
121} 121}
122 122
123void KBill::Rules() { 123void KBill::Rules() {
124 field->stopTimer(); 124 field->stopTimer();
125 HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1); 125 HelpDialog *rulesDialog = new HelpDialog(this,"helpdialog",1);
126 rulesDialog->setCaption("The rules of KBill"); 126 rulesDialog->setCaption(tr("The rules of KBill"));
127 QString rulesStr = "<b>The Rules</b><p>kBill has been painstakingly designed and researched in order to make it as easy to use for the whole family as it is for little Sally. Years - nay - days of beta testing and consulting with the cheapest of human interface designers have resulted in a game that is easy to use, yet nothing at all like a Macintosh.<p><UL><LI>Whack the Bills (click)</LI><LI>Restart the computer (click)</LI><LI>Pick up stolen OSes & return (drag) them to their respective computers</LI><LI>Drag the bucket to extinguish sparks</LI><LI>Scoring is based on total uptime, with bonuses for killing Bills.</LI></UL><P>As for the rest, you can probably work it out for yourself. We did, so it can't be too hard"; 127 QString rulesStr = tr("<b>The Rules</b><p>kBill has been painstakingly designed and researched in order to make it as easy to use for the whole family as it is for little Sally. Years - nay - days of beta testing and consulting with the cheapest of human interface designers have resulted in a game that is easy to use, yet nothing at all like a Macintosh.<p><UL><LI>Whack the Bills (click)</LI><LI>Restart the computer (click)</LI><LI>Pick up stolen OSes & return (drag) them to their respective computers</LI><LI>Drag the bucket to extinguish sparks</LI><LI>Scoring is based on total uptime, with bonuses for killing Bills.</LI></UL><P>As for the rest, you can probably work it out for yourself. We did, so it can't be too hard");
128 rulesDialog->TextBrowser1->setText(rulesStr); 128 rulesDialog->TextBrowser1->setText(rulesStr);
129 rulesDialog->resize(200,200); 129 rulesDialog->resize(200,200);
130 rulesDialog->show(); 130 rulesDialog->show();
131 field->startTimer(); 131 field->startTimer();
132} 132}