summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/board.cpp6
-rw-r--r--noncore/games/kpacman/keys.cpp10
-rw-r--r--noncore/games/kpacman/kpacman.cpp30
-rw-r--r--noncore/games/kpacman/kpacmanwidget.cpp4
-rw-r--r--noncore/games/kpacman/painter.cpp6
-rw-r--r--noncore/games/kpacman/referee.cpp54
-rw-r--r--noncore/games/kpacman/score.cpp48
-rw-r--r--noncore/games/kpacman/status.cpp4
8 files changed, 81 insertions, 81 deletions
diff --git a/noncore/games/kpacman/board.cpp b/noncore/games/kpacman/board.cpp
index 849e75b..f95f699 100644
--- a/noncore/games/kpacman/board.cpp
+++ b/noncore/games/kpacman/board.cpp
@@ -48,29 +48,29 @@ void Board::init(Image image, QString levelName)
48 numPoints = 0; 48 numPoints = 0;
49 numEnergizers = 0; 49 numEnergizers = 0;
50 numMonsters = 0; 50 numMonsters = 0;
51 numTunnels = 0; 51 numTunnels = 0;
52 52
53 if (!levelName.isNull() && !levelName.isEmpty()) 53 if (!levelName.isNull() && !levelName.isEmpty())
54 if (mapName == levelName) 54 if (mapName == levelName)
55 image = File; 55 image = File;
56 else { 56 else {
57 QFile levelFile(levelName); 57 QFile levelFile(levelName);
58 if (!levelFile.open(IO_ReadOnly)) { 58 if (!levelFile.open(IO_ReadOnly)) {
59 59
60 QString msg = i18n("The levelmap could not be constructed.\n\n" 60 QString msg = "The levelmap could not be constructed.\n\n"
61 "The file '@LEVELNAME@' does not exist,\n" 61 "The file '@LEVELNAME@' does not exist,\n"
62 "or could not be opened for reading."); 62 "or could not be opened for reading.";
63 msg.replace(QRegExp("@LEVELNAME@"), levelName); 63 msg.replace(QRegExp("@LEVELNAME@"), levelName);
64 // QMessageBox::information(0, i18n("Initialization Error"), msg); 64 // QMessageBox::information(0, tr("Initialization Error"), msg);
65 printf("%s\n", msg.data()); 65 printf("%s\n", msg.data());
66 } else { 66 } else {
67 map.fill(' ', BoardHeight*BoardWidth); 67 map.fill(' ', BoardHeight*BoardWidth);
68 int height = 0; 68 int height = 0;
69 69
70 QTextStream levelStream(&levelFile); 70 QTextStream levelStream(&levelFile);
71 while (!levelStream.eof() && height < BoardHeight) { 71 while (!levelStream.eof() && height < BoardHeight) {
72 QString line = levelStream.readLine(); 72 QString line = levelStream.readLine();
73 73
74 if (line.find(QRegExp("^ *;")) == -1) { 74 if (line.find(QRegExp("^ *;")) == -1) {
75 75
76 line.replace(QRegExp(";.*"), ""); // strip off comments 76 line.replace(QRegExp(";.*"), ""); // strip off comments
diff --git a/noncore/games/kpacman/keys.cpp b/noncore/games/kpacman/keys.cpp
index c609373..8b17785 100644
--- a/noncore/games/kpacman/keys.cpp
+++ b/noncore/games/kpacman/keys.cpp
@@ -21,37 +21,37 @@
21#include <qlabel.h> 21#include <qlabel.h>
22#include <qframe.h> 22#include <qframe.h>
23#include <qkeycode.h> 23#include <qkeycode.h>
24#include <qpixmap.h> 24#include <qpixmap.h>
25#include <qstring.h> 25#include <qstring.h>
26 26
27Keys::Keys( QWidget *parent, const char *name) 27Keys::Keys( QWidget *parent, const char *name)
28 : QDialog( parent, name, TRUE ) 28 : QDialog( parent, name, TRUE )
29{ 29{
30 //KStandardDirs *dirs = KGlobal::dirs(); 30 //KStandardDirs *dirs = KGlobal::dirs();
31 31
32 QPushButton *okButton = new QPushButton(this); 32 QPushButton *okButton = new QPushButton(this);
33 okButton->setText(i18n("Ok")); 33 okButton->setText(tr("Ok"));
34 okButton->setFixedSize(okButton->size()); 34 okButton->setFixedSize(okButton->size());
35 connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) ); 35 connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) );
36 okButton->move(20,210); 36 okButton->move(20,210);
37 37
38 QPushButton *defaultButton = new QPushButton(this); 38 QPushButton *defaultButton = new QPushButton(this);
39 defaultButton->setText(i18n("Defaults")); 39 defaultButton->setText(tr("Defaults"));
40 defaultButton->setFixedSize(defaultButton->size()); 40 defaultButton->setFixedSize(defaultButton->size());
41 connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) ); 41 connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) );
42 defaultButton->move(140,210); 42 defaultButton->move(140,210);
43 43
44 QPushButton *cancelButton = new QPushButton(this); 44 QPushButton *cancelButton = new QPushButton(this);
45 cancelButton->setText(i18n("Cancel")); 45 cancelButton->setText(tr("Cancel"));
46 cancelButton->setFixedSize(cancelButton->size()); 46 cancelButton->setFixedSize(cancelButton->size());
47 connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) ); 47 connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) );
48 cancelButton->move(260,210); 48 cancelButton->move(260,210);
49 49
50 QFrame *separator = new QFrame(this); 50 QFrame *separator = new QFrame(this);
51 separator->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 51 separator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
52 separator->setGeometry( 20, 190, 340, 4 ); 52 separator->setGeometry( 20, 190, 340, 4 );
53 53
54 for ( int x = 0; x < 4; x++) { 54 for ( int x = 0; x < 4; x++) {
55 QLabel *l = new QLabel(this); 55 QLabel *l = new QLabel(this);
56 l->setAlignment(AlignCenter); 56 l->setAlignment(AlignCenter);
57 labels[x] = l; 57 labels[x] = l;
@@ -84,38 +84,38 @@ Keys::Keys( QWidget *parent, const char *name)
84 left->setFixedSize(left->pixmap()->size()); 84 left->setFixedSize(left->pixmap()->size());
85 connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) ); 85 connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) );
86 left->move(140, 90); 86 left->move(140, 90);
87 87
88 QPushButton *right = new QPushButton(this); 88 QPushButton *right = new QPushButton(this);
89 pixPath = FIND_APP_DATA( "pics/right.xpm"); 89 pixPath = FIND_APP_DATA( "pics/right.xpm");
90 right->setPixmap( QPixmap(pixPath)); 90 right->setPixmap( QPixmap(pixPath));
91 right->setFixedSize(right->pixmap()->size()); 91 right->setFixedSize(right->pixmap()->size());
92 connect( right, SIGNAL(clicked()),this, SLOT(butRight()) ); 92 connect( right, SIGNAL(clicked()),this, SLOT(butRight()) );
93 right->move(220, 90); 93 right->move(220, 90);
94 94
95 95
96 setCaption(i18n("Change Direction Keys")); 96 setCaption(tr("Change Direction Keys"));
97 setFixedSize(380, 260); 97 setFixedSize(380, 260);
98 lab = 0; 98 lab = 0;
99 init(); 99 init();
100} 100}
101 101
102void Keys::keyPressEvent( QKeyEvent *e ) 102void Keys::keyPressEvent( QKeyEvent *e )
103{ 103{
104 uint kCode = e->key() & ~(SHIFT | CTRL | ALT); 104 uint kCode = e->key() & ~(SHIFT | CTRL | ALT);
105 QString string = KAccel::keyToString(kCode); 105 QString string = KAccel::keyToString(kCode);
106 106
107 if (lab != 0) { 107 if (lab != 0) {
108 if ( string.isNull() ) 108 if ( string.isNull() )
109 lab->setText(i18n("Undefined key")); 109 lab->setText(tr("Undefined key"));
110 else 110 else
111 lab->setText(string); 111 lab->setText(string);
112 } 112 }
113 else if ( lab == 0 && e->key() == Key_Escape) 113 else if ( lab == 0 && e->key() == Key_Escape)
114 reject(); 114 reject();
115} 115}
116 116
117void Keys::butUp() 117void Keys::butUp()
118{ 118{
119 getKey(0); 119 getKey(0);
120} 120}
121 121
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index 4077085..7df6ef0 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -78,93 +78,93 @@ Kpacman::~Kpacman()
78 APP_CONFIG_BEGIN( cfg ); 78 APP_CONFIG_BEGIN( cfg );
79 cfg->writeEntry("FocusOutPause", focusOutPause); 79 cfg->writeEntry("FocusOutPause", focusOutPause);
80 cfg->writeEntry("FocusInContinue", focusInContinue); 80 cfg->writeEntry("FocusInContinue", focusInContinue);
81 cfg->writeEntry("HideMouseCursor", hideMouseCursor); 81 cfg->writeEntry("HideMouseCursor", hideMouseCursor);
82 APP_CONFIG_END( cfg ); 82 APP_CONFIG_END( cfg );
83 delete _menuBar; 83 delete _menuBar;
84} 84}
85 85
86void Kpacman::menu() 86void Kpacman::menu()
87{ 87{
88 gamePopup = new QPopupMenu(); 88 gamePopup = new QPopupMenu();
89 CHECK_PTR( gamePopup ); 89 CHECK_PTR( gamePopup );
90 newID = gamePopup->insertItem(i18n("&New"), this, SLOT(newKpacman()),Key_F2); 90 newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2);
91 pauseID = gamePopup->insertItem(i18n("&Pause"), 91 pauseID = gamePopup->insertItem(tr("&Pause"),
92 this, SLOT(pauseKpacman()), Key_F3); 92 this, SLOT(pauseKpacman()), Key_F3);
93 hofID = gamePopup->insertItem(i18n("&Hall of fame"), 93 hofID = gamePopup->insertItem(tr("&Hall of fame"),
94 this, SLOT(toggleHallOfFame()), Key_F4); 94 this, SLOT(toggleHallOfFame()), Key_F4);
95 gamePopup->insertSeparator(); 95 gamePopup->insertSeparator();
96 gamePopup->insertItem(i18n("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q); 96 gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q);
97 gamePopup->setCheckable(TRUE); 97 gamePopup->setCheckable(TRUE);
98 98
99 optionsPopup = new QPopupMenu(); 99 optionsPopup = new QPopupMenu();
100 CHECK_PTR(optionsPopup); 100 CHECK_PTR(optionsPopup);
101 101
102 modesPopup = new QPopupMenu(); 102 modesPopup = new QPopupMenu();
103 CHECK_PTR(modesPopup); 103 CHECK_PTR(modesPopup);
104 104
105 hideMouseCursorID = optionsPopup->insertItem(i18n("&Hide Mousecursor"), 105 hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"),
106 this, SLOT(toggleHideMouseCursor()), 106 this, SLOT(toggleHideMouseCursor()),
107 CTRL+Key_H); 107 CTRL+Key_H);
108 optionsPopup->insertSeparator(); 108 optionsPopup->insertSeparator();
109 109
110 if (lookupSchemes() > 0) { 110 if (lookupSchemes() > 0) {
111 optionsPopup->insertItem(i18n("&Select graphic scheme"), modesPopup); 111 optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup);
112 optionsPopup->insertSeparator(); 112 optionsPopup->insertSeparator();
113 } 113 }
114 114
115 focusOutPauseID = optionsPopup->insertItem(i18n("&Pause in Background"), 115 focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"),
116 this, SLOT(toggleFocusOutPause())); 116 this, SLOT(toggleFocusOutPause()));
117 focusInContinueID = optionsPopup->insertItem(i18n("&Continue in Foreground"), 117 focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"),
118 this, SLOT(toggleFocusInContinue())); 118 this, SLOT(toggleFocusInContinue()));
119 optionsPopup->insertSeparator(); 119 optionsPopup->insertSeparator();
120 120
121 optionsPopup->insertItem(i18n("Change &keys..."), this, SLOT(confKeys())); 121 optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys()));
122 122
123#ifndef QWS 123#ifndef QWS
124 QString aboutText = i18n("@PACKAGE@ - @VERSION@\n\n" 124 QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n"
125 "Joerg Thoennissen (joe@dsite.de)\n\n" 125 "Joerg Thoennissen (joe@dsite.de)\n\n"
126 "A pacman game for the KDE Desktop\n\n" 126 "A pacman game for the KDE Desktop\n\n"
127 "The program based on the source of ksnake\n" 127 "The program based on the source of ksnake\n"
128 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" 128 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n"
129 "The design was strongly influenced by the pacman\n" 129 "The design was strongly influenced by the pacman\n"
130 "(c) 1980 MIDWAY MFG.CO.\n\n" 130 "(c) 1980 MIDWAY MFG.CO.\n\n"
131 "I like to thank my girlfriend Elke Krueers for\n" 131 "I like to thank my girlfriend Elke Krueers for\n"
132 "the last 10 years of her friendship.\n"); 132 "the last 10 years of her friendship.\n");
133 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); 133 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE);
134 aboutText.replace(QRegExp("@VERSION@"), VERSION); 134 aboutText.replace(QRegExp("@VERSION@"), VERSION);
135 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); 135 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE);
136#endif 136#endif
137 137
138 //_menuBar = new KMenuBar(this); 138 //_menuBar = new KMenuBar(this);
139 //CHECK_PTR( _menuBar ); 139 //CHECK_PTR( _menuBar );
140 //_menuBar->insertItem(i18n("&Game"), gamePopup); 140 //_menuBar->insertItem(tr("&Game"), gamePopup);
141 //_menuBar->insertItem(i18n("&Options"), optionsPopup); 141 //_menuBar->insertItem(tr("&Options"), optionsPopup);
142 //_menuBar->insertSeparator(); 142 //_menuBar->insertSeparator();
143#ifndef QWS 143#ifndef QWS
144 _menuBar->insertItem(i18n("&Help"), helpPopup); 144 _menuBar->insertItem(tr("&Help"), helpPopup);
145#endif 145#endif
146} 146}
147 147
148int Kpacman::lookupSchemes() 148int Kpacman::lookupSchemes()
149{ 149{
150 APP_CONFIG_BEGIN( cfg ); 150 APP_CONFIG_BEGIN( cfg );
151 int ModeCount = cfg->readNumEntry("ModeCount", -1); 151 int ModeCount = cfg->readNumEntry("ModeCount", -1);
152 int Mode = cfg->readNumEntry("Mode", -1); 152 int Mode = cfg->readNumEntry("Mode", -1);
153 int SchemeCount = cfg->readNumEntry("SchemeCount"); 153 int SchemeCount = cfg->readNumEntry("SchemeCount");
154 int Scheme = cfg->readNumEntry("Scheme", -1); 154 int Scheme = cfg->readNumEntry("Scheme", -1);
155 155
156 if (SchemeCount == 0 || Scheme == -1) { 156 if (SchemeCount == 0 || Scheme == -1) {
157 QMessageBox::warning(this, i18n("Configuration Error"), 157 QMessageBox::warning(this, tr("Configuration Error"),
158 i18n("There are no schemes defined,\n" 158 tr("There are no schemes defined,\n"
159 "or no scheme is selected.")); 159 "or no scheme is selected."));
160 APP_CONFIG_END( cfg ); 160 APP_CONFIG_END( cfg );
161 return 0; 161 return 0;
162 } 162 }
163 163
164 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); 164 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int)));
165 modeID.resize(ModeCount > 0 ? ModeCount : 0); 165 modeID.resize(ModeCount > 0 ? ModeCount : 0);
166 166
167 if (!schemesPopup->isEmpty()) 167 if (!schemesPopup->isEmpty())
168 schemesPopup->clear(); 168 schemesPopup->clear();
169 169
170 SAVE_CONFIG_GROUP( cfg, oldgroup ); 170 SAVE_CONFIG_GROUP( cfg, oldgroup );
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp
index 330c88e..215dcda 100644
--- a/noncore/games/kpacman/kpacmanwidget.cpp
+++ b/noncore/games/kpacman/kpacmanwidget.cpp
@@ -105,29 +105,29 @@ void KpacmanWidget::confScheme()
105 cfg->setGroup(newgroup); 105 cfg->setGroup(newgroup);
106 106
107 confMisc(FALSE); 107 confMisc(FALSE);
108 } 108 }
109 109
110 if (lastFontName != fontName) { 110 if (lastFontName != fontName) {
111 111
112 if (bitfont != 0) 112 if (bitfont != 0)
113 delete bitfont; 113 delete bitfont;
114 114
115 bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar); 115 bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar);
116 if (bitfont->width() == 0 || bitfont->height() == 0) { 116 if (bitfont->width() == 0 || bitfont->height() == 0) {
117 QString msg = i18n("The bitfont could not be contructed.\n\n" 117 QString msg = tr("The bitfont could not be contructed.\n\n"
118 "The file '@FONTNAME@' does not exist,\n" 118 "The file '@FONTNAME@' does not exist,\n"
119 "or is of an unknown format."); 119 "or is of an unknown format.");
120 msg.replace(QRegExp("@FONTNAME@"), fontName); 120 msg.replace(QRegExp("@FONTNAME@"), fontName);
121 // QMessageBox::critical(this, i18n("Initialization Error"), msg); 121 // QMessageBox::critical(this, tr("Initialization Error"), msg);
122 printf("%s\n", msg.data()); 122 printf("%s\n", msg.data());
123 } 123 }
124 } 124 }
125 125
126 RESTORE_CONFIG_GROUP( cfg, oldgroup ); 126 RESTORE_CONFIG_GROUP( cfg, oldgroup );
127 APP_CONFIG_END( cfg ); 127 APP_CONFIG_END( cfg );
128} 128}
129 129
130void KpacmanWidget::setScheme(int Scheme, int Mode) 130void KpacmanWidget::setScheme(int Scheme, int Mode)
131{ 131{
132 mode = Mode; 132 mode = Mode;
133 scheme = Scheme; 133 scheme = Scheme;
diff --git a/noncore/games/kpacman/painter.cpp b/noncore/games/kpacman/painter.cpp
index 16fed55..80aeab0 100644
--- a/noncore/games/kpacman/painter.cpp
+++ b/noncore/games/kpacman/painter.cpp
@@ -65,29 +65,29 @@ QList<QPixmap> *Painter::loadPixmap(QWidget*, QString pixmapName,
65 QList<QPixmap> *pixmaps) 65 QList<QPixmap> *pixmaps)
66{ 66{
67 if (pixmaps == NULL) { 67 if (pixmaps == NULL) {
68 pixmaps = new QList<QPixmap>; 68 pixmaps = new QList<QPixmap>;
69 pixmaps->setAutoDelete(TRUE); 69 pixmaps->setAutoDelete(TRUE);
70 } 70 }
71 71
72 if (!pixmaps->isEmpty()) 72 if (!pixmaps->isEmpty())
73 pixmaps->clear(); 73 pixmaps->clear();
74 74
75 QPixmap PIXMAP(pixmapName); 75 QPixmap PIXMAP(pixmapName);
76 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { 76 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
77 QString msg = i18n("The pixmap could not be contructed.\n\n" 77 QString msg = "The pixmap could not be contructed.\n\n"
78 "The file '@PIXMAPNAME@' does not exist,\n" 78 "The file '@PIXMAPNAME@' does not exist,\n"
79 "or is of an unknown format."); 79 "or is of an unknown format.";
80 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName); 80 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
81 // QMessageBox::critical(parent, i18n("Initialization Error"), msg); 81 // QMessageBox::critical(parent, tr("Initialization Error"), msg);
82 printf("%s\n", msg.data()); 82 printf("%s\n", msg.data());
83 return 0; 83 return 0;
84 } 84 }
85 85
86 int height = PIXMAP.height(); 86 int height = PIXMAP.height();
87 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); 87 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
88 88
89 QBitmap BITMAP; 89 QBitmap BITMAP;
90 QBitmap MASK; 90 QBitmap MASK;
91 91
92 BITMAP = *PIXMAP.mask(); 92 BITMAP = *PIXMAP.mask();
93 MASK.resize(width, height); 93 MASK.resize(width, height);
diff --git a/noncore/games/kpacman/referee.cpp b/noncore/games/kpacman/referee.cpp
index 567a8ed..9edaabd 100644
--- a/noncore/games/kpacman/referee.cpp
+++ b/noncore/games/kpacman/referee.cpp
@@ -86,26 +86,26 @@ void Referee::paintEvent( QPaintEvent *e)
86 if (gameState.testBit(HallOfFame)) 86 if (gameState.testBit(HallOfFame))
87 return; 87 return;
88 88
89 QRect rect = e->rect(); 89 QRect rect = e->rect();
90 90
91 if (!rect.isEmpty()) { 91 if (!rect.isEmpty()) {
92 QPixmap p = pix->levelPix(); 92 QPixmap p = pix->levelPix();
93 bitBlt(this, rect.x(), rect.y(), 93 bitBlt(this, rect.x(), rect.y(),
94 &p, rect.x(), rect.y(), rect.width(), rect.height()); 94 &p, rect.x(), rect.y(), rect.width(), rect.height());
95 } 95 }
96 96
97 if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) && 97 if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) &&
98 rect.intersects(pix->rect(board->position(fruithome), i18n("GAME OVER")))) 98 rect.intersects(pix->rect(board->position(fruithome), tr("GAME OVER"))))
99 pix->draw(board->position(fruithome), Widget, i18n("GAME OVER"), RED); 99 pix->draw(board->position(fruithome), Widget, tr("GAME OVER"), RED);
100 100
101 for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) { 101 for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) {
102 if (e && e->state() == on && 102 if (e && e->state() == on &&
103 rect.intersects(pix->rect(e->position(), EnergizerPix)) && 103 rect.intersects(pix->rect(e->position(), EnergizerPix)) &&
104 !(e->position() == pacman->position() && gameState.testBit(Scoring))) { 104 !(e->position() == pacman->position() && gameState.testBit(Scoring))) {
105 if (e->pix() != -1) 105 if (e->pix() != -1)
106 pix->draw(e->position(), Widget, EnergizerPix, e->pix()); 106 pix->draw(e->position(), Widget, EnergizerPix, e->pix());
107 } 107 }
108 } 108 }
109 109
110 if (!gameState.testBit(Init)) { 110 if (!gameState.testBit(Init)) {
111 111
@@ -148,34 +148,34 @@ void Referee::paintEvent( QPaintEvent *e)
148 pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1); 148 pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1);
149 149
150 if (gameState.testBit(Init) && gameState.testBit(Dying) && 150 if (gameState.testBit(Init) && gameState.testBit(Dying) &&
151 timerCount < pix->maxPixmaps(DyingPix) && 151 timerCount < pix->maxPixmaps(DyingPix) &&
152 rect.intersects(pix->rect(pacman->position(), PacmanPix))) 152 rect.intersects(pix->rect(pacman->position(), PacmanPix)))
153 pix->draw(pacman->position(), Widget, DyingPix, timerCount); 153 pix->draw(pacman->position(), Widget, DyingPix, timerCount);
154 154
155 if (gameState.testBit(LevelDone) && 155 if (gameState.testBit(LevelDone) &&
156 rect.intersects(pix->rect(pacman->position(), PacmanPix))) 156 rect.intersects(pix->rect(pacman->position(), PacmanPix)))
157 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); 157 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix());
158 158
159 if (gameState.testBit(Player) && 159 if (gameState.testBit(Player) &&
160 rect.intersects(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")))) 160 rect.intersects(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE"))))
161 pix->draw(board->position(monsterhome, 0), Widget, i18n("PLAYER ONE"), CYAN); 161 pix->draw(board->position(monsterhome, 0), Widget, tr("PLAYER ONE"), CYAN);
162 162
163 if (gameState.testBit(Ready) && 163 if (gameState.testBit(Ready) &&
164 rect.intersects(pix->rect(board->position(fruithome), i18n("READY!")))) 164 rect.intersects(pix->rect(board->position(fruithome), tr("READY!"))))
165 pix->draw(board->position(fruithome), Widget, i18n("READY!"), YELLOW); 165 pix->draw(board->position(fruithome), Widget, tr("READY!"), YELLOW);
166 166
167 if (gameState.testBit(Paused) && 167 if (gameState.testBit(Paused) &&
168 rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")))) 168 rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED"))))
169 pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, i18n("PAUSED"), RED, BLACK); 169 pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, tr("PAUSED"), RED, BLACK);
170} 170}
171 171
172void Referee::timerEvent( QTimerEvent *e ) 172void Referee::timerEvent( QTimerEvent *e )
173{ 173{
174 if (gameState.testBit(HallOfFame)) 174 if (gameState.testBit(HallOfFame))
175 return; 175 return;
176 176
177 QRect lastRect; 177 QRect lastRect;
178 int lastPix; 178 int lastPix;
179 bool moved = FALSE; 179 bool moved = FALSE;
180 int eated = 0; 180 int eated = 0;
181 181
@@ -831,28 +831,28 @@ void Referee::hallOfFame()
831 emit forcedHallOfFame(TRUE); 831 emit forcedHallOfFame(TRUE);
832} 832}
833 833
834void Referee::pause() 834void Referee::pause()
835{ 835{
836 static int pausedTimer = 0; 836 static int pausedTimer = 0;
837 837
838 if (!gameState.testBit(Paused)) { 838 if (!gameState.testBit(Paused)) {
839 pausedTimer = gameTimer; 839 pausedTimer = gameTimer;
840 stop(); 840 stop();
841 stopEnergizer(); 841 stopEnergizer();
842 gameState.setBit(Paused); 842 gameState.setBit(Paused);
843 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); 843 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED")), FALSE);
844 } else { 844 } else {
845 gameState.clearBit(Paused); 845 gameState.clearBit(Paused);
846 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); 846 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED")), FALSE);
847 if (pausedTimer) { 847 if (pausedTimer) {
848 pausedTimer = 0; 848 pausedTimer = 0;
849 start(); 849 start();
850 } 850 }
851 } 851 }
852 emit togglePaused(); 852 emit togglePaused();
853} 853}
854 854
855void Referee::intro() 855void Referee::intro()
856{ 856{
857 stop(); 857 stop();
858 stopEnergizer(); 858 stopEnergizer();
@@ -897,51 +897,51 @@ void Referee::introMonster(int id)
897 if (m->eyes() != -1) 897 if (m->eyes() != -1)
898 pix->draw(m->position(), RoomPix, EyesPix, m->eyes()); 898 pix->draw(m->position(), RoomPix, EyesPix, m->eyes());
899 899
900 repaint(pix->rect(m->position(), MonsterPix), FALSE); 900 repaint(pix->rect(m->position(), MonsterPix), FALSE);
901 m->setPosition(OUT); 901 m->setPosition(OUT);
902} 902}
903 903
904void Referee::introPaint(int t) 904void Referee::introPaint(int t)
905{ 905{
906 QString pts; 906 QString pts;
907 907
908 switch (t) { 908 switch (t) {
909 case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, QColor(), AlignLeft), FALSE); 909 case 0 : repaint(pix->draw(16, 6, RoomPix, tr("CHARACTER"), WHITE, QColor(), AlignLeft), FALSE);
910 repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, QColor(), AlignLeft), FALSE); 910 repaint(pix->draw(36, 6, RoomPix, tr("/"), WHITE, QColor(), AlignLeft), FALSE);
911 repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, QColor(), AlignLeft), FALSE); 911 repaint(pix->draw(40, 6, RoomPix, tr("NICKNAME"), WHITE, QColor(), AlignLeft), FALSE);
912 break; 912 break;
913 case 1 : introMonster(0); 913 case 1 : introMonster(0);
914 break; 914 break;
915 case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, QColor(), AlignLeft), FALSE); 915 case 2 : repaint(pix->draw(16, 10, RoomPix, tr("-SHADOW"), RED, QColor(), AlignLeft), FALSE);
916 break; 916 break;
917 case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, QColor(), AlignLeft), FALSE); 917 case 3 : repaint(pix->draw(38, 10, RoomPix, tr("\"BLINKY\""), RED, QColor(), AlignLeft), FALSE);
918 break; 918 break;
919 case 4 : introMonster(1); 919 case 4 : introMonster(1);
920 break; 920 break;
921 case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, QColor(), AlignLeft), FALSE); 921 case 5 : repaint(pix->draw(16, 16, RoomPix, tr("-SPEEDY"), PINK, QColor(), AlignLeft), FALSE);
922 break; 922 break;
923 case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, QColor(), AlignLeft), FALSE); 923 case 6 : repaint(pix->draw(38, 16, RoomPix, tr("\"PINKY\""), PINK, QColor(), AlignLeft), FALSE);
924 break; 924 break;
925 case 7 : introMonster(2); 925 case 7 : introMonster(2);
926 break; 926 break;
927 case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE); 927 case 8 : repaint(pix->draw(16, 22, RoomPix, tr("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE);
928 break; 928 break;
929 case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE); 929 case 9 : repaint(pix->draw(38, 22, RoomPix, tr("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE);
930 break; 930 break;
931 case 10 : introMonster(3); 931 case 10 : introMonster(3);
932 break; 932 break;
933 case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE); 933 case 11 : repaint(pix->draw(16, 28, RoomPix, tr("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE);
934 break; 934 break;
935 case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE); 935 case 12 : repaint(pix->draw(38, 28, RoomPix, tr("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE);
936 break; 936 break;
937 case 13 : pts.sprintf("%d", pointScore); 937 case 13 : pts.sprintf("%d", pointScore);
938 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 938 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
939 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 939 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
940 pts.sprintf("%d", energizerScore); 940 pts.sprintf("%d", energizerScore);
941 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 941 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
942 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 942 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
943 break; 943 break;
944 case 14 : // "@ 1980 MIDWAY MFG.CO." 944 case 14 : // "@ 1980 MIDWAY MFG.CO."
945#if defined( KDE2_PORT ) 945#if defined( KDE2_PORT )
946 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE); 946 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE);
947#elif defined( QPE_PORT ) 947#elif defined( QPE_PORT )
@@ -1087,56 +1087,56 @@ void Referee::play()
1087 1087
1088 initPacman(); 1088 initPacman();
1089 initFruit(); 1089 initFruit();
1090 initMonsters(); 1090 initMonsters();
1091 initEnergizers(); 1091 initEnergizers();
1092 1092
1093 repaint(); 1093 repaint();
1094 emit toggleNew(); 1094 emit toggleNew();
1095 emit setLifes(lifes); 1095 emit setLifes(lifes);
1096 emit setLevel(level); 1096 emit setLevel(level);
1097 emit setPoints(points); 1097 emit setPoints(points);
1098 1098
1099 repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); 1099 repaint(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE")), FALSE);
1100 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1100 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1101 1101
1102 timerCount = 0; 1102 timerCount = 0;
1103 QTimer::singleShot(playerDurMS, this, SLOT(ready())); 1103 QTimer::singleShot(playerDurMS, this, SLOT(ready()));
1104} 1104}
1105 1105
1106void Referee::ready() 1106void Referee::ready()
1107{ 1107{
1108 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 1108 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
1109 QTimer::singleShot(afterPauseMS, this, SLOT(ready())); 1109 QTimer::singleShot(afterPauseMS, this, SLOT(ready()));
1110 return; 1110 return;
1111 } 1111 }
1112 1112
1113 if (gameState.testBit(Player)) { 1113 if (gameState.testBit(Player)) {
1114 emit setLifes(--lifes); 1114 emit setLifes(--lifes);
1115 gameState.clearBit(Player); 1115 gameState.clearBit(Player);
1116 gameState.clearBit(Init); 1116 gameState.clearBit(Init);
1117 repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); 1117 repaint(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE")), FALSE);
1118 repaintFigures(); 1118 repaintFigures();
1119 QTimer::singleShot(playerDurMS, this, SLOT(ready())); 1119 QTimer::singleShot(playerDurMS, this, SLOT(ready()));
1120 return; 1120 return;
1121 } 1121 }
1122 1122
1123 if (gameState.testBit(Ready)) { 1123 if (gameState.testBit(Ready)) {
1124 gameState.clearBit(Ready); 1124 gameState.clearBit(Ready);
1125 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1125 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1126 start(); 1126 start();
1127 } else { 1127 } else {
1128 gameState.setBit(Ready); 1128 gameState.setBit(Ready);
1129 gameState.clearBit(Init); 1129 gameState.clearBit(Init);
1130 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1130 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1131 QTimer::singleShot(readyDurMS, this, SLOT(ready())); 1131 QTimer::singleShot(readyDurMS, this, SLOT(ready()));
1132 } 1132 }
1133} 1133}
1134 1134
1135 1135
1136void Referee::levelUp() 1136void Referee::levelUp()
1137{ 1137{
1138 stop(); 1138 stop();
1139 stopEnergizer(); 1139 stopEnergizer();
1140 1140
1141 gameState.setBit(LevelDone); 1141 gameState.setBit(LevelDone);
1142 pacman->setPosition(pacman->position()); // set mouthPosition to "0" 1142 pacman->setPosition(pacman->position()); // set mouthPosition to "0"
@@ -1285,25 +1285,25 @@ void Referee::killedPlay()
1285 QTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay())); 1285 QTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay()));
1286 timerCount++; 1286 timerCount++;
1287 } else { 1287 } else {
1288 gameState.clearBit(Dying); 1288 gameState.clearBit(Dying);
1289 stopEnergizer(); 1289 stopEnergizer();
1290 if (lifes == 0) { 1290 if (lifes == 0) {
1291 gameState.setBit(GameOver); 1291 gameState.setBit(GameOver);
1292 gameState.clearBit(Playing); 1292 gameState.clearBit(Playing);
1293 for (int e = 0; e < board->energizers(); e++) { 1293 for (int e = 0; e < board->energizers(); e++) {
1294 energizers->at(e)->setOff(); 1294 energizers->at(e)->setOff();
1295 repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE); 1295 repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE);
1296 } 1296 }
1297 repaint(pix->rect(board->position(fruithome), i18n("GAME OVER")), FALSE); 1297 repaint(pix->rect(board->position(fruithome), tr("GAME OVER")), FALSE);
1298 QTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame())); 1298 QTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame()));
1299 } else { 1299 } else {
1300 gameState.clearBit(Init); 1300 gameState.clearBit(Init);
1301 initPacman(); 1301 initPacman();
1302 initFruit(); 1302 initFruit();
1303 initMonsters(); 1303 initMonsters();
1304 initEnergizers(); 1304 initEnergizers();
1305 emit setLifes(--lifes); 1305 emit setLifes(--lifes);
1306 repaintFigures(); 1306 repaintFigures();
1307 ready(); 1307 ready();
1308 } 1308 }
1309 } 1309 }
diff --git a/noncore/games/kpacman/score.cpp b/noncore/games/kpacman/score.cpp
index 6e660e8..17dbf0a 100644
--- a/noncore/games/kpacman/score.cpp
+++ b/noncore/games/kpacman/score.cpp
@@ -66,128 +66,128 @@ Score::Score(QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *f
66 playerName[p].at(i) > bitfont->lastChar()) 66 playerName[p].at(i) > bitfont->lastChar())
67 playerName[p].at(i) = playerName[p].at(i).upper(); 67 playerName[p].at(i) = playerName[p].at(i).upper();
68 } 68 }
69} 69}
70 70
71Score::~Score() 71Score::~Score()
72{ 72{
73 // write(); 73 // write();
74} 74}
75 75
76void Score::paintEvent( QPaintEvent *e) 76void Score::paintEvent( QPaintEvent *e)
77{ 77{
78 if (rect(1, 0, i18n(" 1UP ")).intersects(e->rect())) { 78 if (rect(1, 0, tr(" 1UP ")).intersects(e->rect())) {
79 QPixmap pix; 79 QPixmap pix;
80 QColor fg = BLACK; 80 QColor fg = BLACK;
81 if (cursor.on || paused || lastPlayer != 0) 81 if (cursor.on || paused || lastPlayer != 0)
82 fg = WHITE; 82 fg = WHITE;
83 pix = bitfont->text(i18n(" 1UP "), fg, BLACK); 83 pix = bitfont->text(tr(" 1UP "), fg, BLACK);
84 bitBlt(this, x(1), y(0), &pix); 84 bitBlt(this, x(1), y(0), &pix);
85 } 85 }
86 86
87 if (rect(8, 0, i18n(" HIGH SCORE ")).intersects(e->rect())) { 87 if (rect(8, 0, tr(" HIGH SCORE ")).intersects(e->rect())) {
88 QPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK); 88 QPixmap pix = bitfont->text(tr(" HIGH SCORE "), WHITE, BLACK);
89 bitBlt(this, x(8), y(0), &pix); 89 bitBlt(this, x(8), y(0), &pix);
90 } 90 }
91 91
92 if (maxPlayer > 1 && rect(21, 0, i18n(" 2UP ")).intersects(e->rect())) { 92 if (maxPlayer > 1 && rect(21, 0, tr(" 2UP ")).intersects(e->rect())) {
93 QPixmap pix; 93 QPixmap pix;
94 QColor fg = BLACK; 94 QColor fg = BLACK;
95 if (cursor.on || paused || lastPlayer != 1) 95 if (cursor.on || paused || lastPlayer != 1)
96 fg = WHITE; 96 fg = WHITE;
97 pix = bitfont->text(i18n(" 2UP "), fg, BLACK); 97 pix = bitfont->text(tr(" 2UP "), fg, BLACK);
98 bitBlt(this, x(21), y(0), &pix); 98 bitBlt(this, x(21), y(0), &pix);
99 } 99 }
100 100
101 QString s; 101 QString s;
102 102
103 s.sprintf("%6d0", playerScore[0]/10); 103 s.sprintf("%6d0", playerScore[0]/10);
104 if (rect(0, 1, s).intersects(e->rect())) { 104 if (rect(0, 1, s).intersects(e->rect())) {
105 QPixmap pix = bitfont->text(s, WHITE, BLACK); 105 QPixmap pix = bitfont->text(s, WHITE, BLACK);
106 bitBlt(this, x(0), y(1), &pix); 106 bitBlt(this, x(0), y(1), &pix);
107 } 107 }
108 108
109 s.sprintf("%8d0", HighScore/10); 109 s.sprintf("%8d0", HighScore/10);
110 if (rect(8, 1, s).intersects(e->rect())) { 110 if (rect(8, 1, s).intersects(e->rect())) {
111 QPixmap pix = bitfont->text(s, WHITE, BLACK); 111 QPixmap pix = bitfont->text(s, WHITE, BLACK);
112 bitBlt(this, x(8), y(1), &pix); 112 bitBlt(this, x(8), y(1), &pix);
113 } 113 }
114 114
115 if (lastScore >= 0) { 115 if (lastScore >= 0) {
116 if (rect(1, 4*1.25, i18n(" CONGRATULATIONS ")).intersects(e->rect())) { 116 if (rect(1, 4*1.25, tr(" CONGRATULATIONS ")).intersects(e->rect())) {
117 QPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK); 117 QPixmap pix = bitfont->text(tr(" CONGRATULATIONS "), YELLOW, BLACK);
118 bitBlt(this, x(1), y(4*1.25), &pix); 118 bitBlt(this, x(1), y(4*1.25), &pix);
119 } 119 }
120 if (rect(1, 6*1.25, i18n(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) { 120 if (rect(1, 6*1.25, tr(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) {
121 QPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK); 121 QPixmap pix = bitfont->text(tr(" YOU HAVE ARCHIEVED "), CYAN, BLACK);
122 bitBlt(this, x(1), y(6*1.25), &pix); 122 bitBlt(this, x(1), y(6*1.25), &pix);
123 } 123 }
124 if (rect(1, 7*1.25, i18n(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) { 124 if (rect(1, 7*1.25, tr(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) {
125 QPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK); 125 QPixmap pix = bitfont->text(tr(" A SCORE IN THE TOP 10. "), CYAN, BLACK);
126 bitBlt(this, x(1), y(7*1.25), &pix); 126 bitBlt(this, x(1), y(7*1.25), &pix);
127 } 127 }
128 if (rect(1, 8*1.25, i18n(" ")).intersects(e->rect())) { 128 if (rect(1, 8*1.25, tr(" ")).intersects(e->rect())) {
129 QPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK); 129 QPixmap pix = bitfont->text(tr(" "), CYAN, BLACK);
130 bitBlt(this, x(1), y(8*1.25), &pix); 130 bitBlt(this, x(1), y(8*1.25), &pix);
131 } 131 }
132 } 132 }
133 133
134 if (rect(1, 9.5*1.25, i18n("RNK SCORE NAME DATE")).intersects(e->rect())) { 134 if (rect(1, 9.5*1.25, tr("RNK SCORE NAME DATE")).intersects(e->rect())) {
135 QPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK); 135 QPixmap pix = bitfont->text(tr("RNK SCORE NAME DATE"), WHITE, BLACK);
136 bitBlt(this, x(1), y(9.5*1.25), &pix); 136 bitBlt(this, x(1), y(9.5*1.25), &pix);
137 } 137 }
138 138
139 for (int i = 0; i < 10; i++) { 139 for (int i = 0; i < 10; i++) {
140 s.sprintf("%2d%9d %-3.3s %-8.8s", 140 s.sprintf("%2d%9d %-3.3s %-8.8s",
141 i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(), 141 i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(),
142 formatDate(hallOfFame[i].moment.date()).data()); 142 formatDate(hallOfFame[i].moment.date()).data());
143 if (rect(1, (11+i)*1.25, s).intersects(e->rect())) { 143 if (rect(1, (11+i)*1.25, s).intersects(e->rect())) {
144 QPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK); 144 QPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK);
145 bitBlt(this, x(1), y((11+i)*1.25), &pix); 145 bitBlt(this, x(1), y((11+i)*1.25), &pix);
146 } 146 }
147 } 147 }
148 148
149 if (cursor.x != -1 && cursor.y != -1 && cursor.on) { 149 if (cursor.x != -1 && cursor.y != -1 && cursor.on) {
150 if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) { 150 if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) {
151 QPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW); 151 QPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW);
152 bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix); 152 bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix);
153 } 153 }
154 } 154 }
155 155
156 if (paused) { 156 if (paused) {
157 157
158 QPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK); 158 QPixmap pix = bitfont->text(tr("PAUSED"), RED, BLACK);
159 QRect r = bitfont->rect(i18n("PAUSED")); 159 QRect r = bitfont->rect(tr("PAUSED"));
160 r.moveCenter(QPoint(this->width()/2, this->height()/2)); 160 r.moveCenter(QPoint(this->width()/2, this->height()/2));
161 161
162 bitBlt(this, r.x(), r.y(), &pix); 162 bitBlt(this, r.x(), r.y(), &pix);
163 } 163 }
164} 164}
165 165
166void Score::timerEvent(QTimerEvent*) 166void Score::timerEvent(QTimerEvent*)
167{ 167{
168 cursor.on = !cursor.on; 168 cursor.on = !cursor.on;
169 169
170 if (paused) 170 if (paused)
171 return; 171 return;
172 172
173 if (cursor.x != -1 && cursor.y != -1) 173 if (cursor.x != -1 && cursor.y != -1)
174 repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); 174 repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE);
175 scrollRepeat = FALSE; 175 scrollRepeat = FALSE;
176 176
177 if (lastPlayer == 0) 177 if (lastPlayer == 0)
178 repaint(rect(1, 0, i18n(" 1UP ")), FALSE); 178 repaint(rect(1, 0, tr(" 1UP ")), FALSE);
179 179
180 if (lastPlayer == 1) 180 if (lastPlayer == 1)
181 repaint(rect(21, 0, i18n(" 2UP ")), FALSE); 181 repaint(rect(21, 0, tr(" 2UP ")), FALSE);
182} 182}
183 183
184void Score::keyPressEvent(QKeyEvent *k) 184void Score::keyPressEvent(QKeyEvent *k)
185{ 185{
186 if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) { 186 if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) {
187 k->ignore(); 187 k->ignore();
188 return; 188 return;
189 } 189 }
190 190
191 int x = cursor.x; 191 int x = cursor.x;
192 int y = cursor.y; 192 int y = cursor.y;
193 193
@@ -472,63 +472,63 @@ void Score::read()
472 if (hallOfFame[i].name.at(j) < bitfont->firstChar() || 472 if (hallOfFame[i].name.at(j) < bitfont->firstChar() ||
473 hallOfFame[i].name.at(j) > bitfont->lastChar()) 473 hallOfFame[i].name.at(j) > bitfont->lastChar())
474 hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); 474 hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper();
475 475
476 HighScore = hallOfFame[0].points; 476 HighScore = hallOfFame[0].points;
477} 477}
478 478
479void Score::write() 479void Score::write()
480{ 480{
481#ifndef QWS 481#ifndef QWS
482 if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath()) 482 if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath())
483 KMessageBox::information(0, 483 KMessageBox::information(0,
484 i18n("You're going to create the highscore-file\n" 484 tr("You're going to create the highscore-file\n"
485 "'%1'\n" 485 "'%1'\n"
486 "for your maschine, that should be used systemwide.\n" 486 "for your maschine, that should be used systemwide.\n"
487 "\n" 487 "\n"
488 "To grant access to the other users, set the appropriate rights (a+w)\n" 488 "To grant access to the other users, set the appropriate rights (a+w)\n"
489 "on that file or ask your systemadministator for that favor.\n" 489 "on that file or ask your systemadministator for that favor.\n"
490 "\n" 490 "\n"
491 "To use a different directory or filename for the highscores," 491 "To use a different directory or filename for the highscores,"
492 "specify them in the configfile (kpacmanrc:highscoreFilePath)." 492 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
493 ).arg(systemHighscoreFileInfo.filePath())); 493 ).arg(systemHighscoreFileInfo.filePath()));
494 494
495 if (highscoreFile.name() == privateHighscoreFileInfo.filePath()) 495 if (highscoreFile.name() == privateHighscoreFileInfo.filePath())
496 KMessageBox::information(0, 496 KMessageBox::information(0,
497 i18n("You're using a private highscore-file, that's mostly because of\n" 497 tr("You're using a private highscore-file, that's mostly because of\n"
498 "missing write-access to the systemwide file\n" 498 "missing write-access to the systemwide file\n"
499 "'%1' .\n" 499 "'%1' .\n"
500 "\n" 500 "\n"
501 "Ask your systemadministrator for granting you access to that file,\n" 501 "Ask your systemadministrator for granting you access to that file,\n"
502 "by setting the appropriate rights (a+w) on it.\n" 502 "by setting the appropriate rights (a+w) on it.\n"
503 "\n" 503 "\n"
504 "To use a different directory or filename for the highscores," 504 "To use a different directory or filename for the highscores,"
505 "specify them in the configfile (kpacmanrc:highscoreFilePath)." 505 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
506 ).arg(systemHighscoreFileInfo.filePath()), 506 ).arg(systemHighscoreFileInfo.filePath()),
507 QString::null, "PrivateHighscore"); 507 QString::null, "PrivateHighscore");
508#endif 508#endif
509 if (highscoreFile.open(IO_WriteOnly)) { 509 if (highscoreFile.open(IO_WriteOnly)) {
510 QDataStream s(&highscoreFile); 510 QDataStream s(&highscoreFile);
511 for (int i = 0; i < 10; i++) 511 for (int i = 0; i < 10; i++)
512 s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration << 512 s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration <<
513 hallOfFame[i].moment << hallOfFame[i].name.latin1(); 513 hallOfFame[i].moment << hallOfFame[i].name.latin1();
514 highscoreFile.close(); 514 highscoreFile.close();
515 } 515 }
516} 516}
517 517
518void Score::setPause(bool Paused) 518void Score::setPause(bool Paused)
519{ 519{
520 paused = Paused; 520 paused = Paused;
521 521
522 QRect r = bitfont->rect(i18n("PAUSED")); 522 QRect r = bitfont->rect(tr("PAUSED"));
523 r.moveCenter(QPoint(this->width()/2, this->height()/2)); 523 r.moveCenter(QPoint(this->width()/2, this->height()/2));
524 repaint(r, TRUE); 524 repaint(r, TRUE);
525 525
526 // repaint 1UP or 2UP 526 // repaint 1UP or 2UP
527 repaint(FALSE); 527 repaint(FALSE);
528} 528}
529 529
530void Score::end() 530void Score::end()
531{ 531{
532 if (paused) { 532 if (paused) {
533 QTimer::singleShot(afterPauseMS, this, SLOT(end())); 533 QTimer::singleShot(afterPauseMS, this, SLOT(end()));
534 return; 534 return;
@@ -538,25 +538,25 @@ void Score::end()
538 lastPlayer = -1; 538 lastPlayer = -1;
539 repaint(FALSE); 539 repaint(FALSE);
540 540
541 emit forcedHallOfFame(FALSE); 541 emit forcedHallOfFame(FALSE);
542} 542}
543 543
544/* 544/*
545 * Return the date in a formatted QString. The format can be changed using internationalization 545 * Return the date in a formatted QString. The format can be changed using internationalization
546 * of the string "YY/MM/DD". Invalid QDate's where returned as "00/00/00". 546 * of the string "YY/MM/DD". Invalid QDate's where returned as "00/00/00".
547 */ 547 */
548QString Score::formatDate(QDate date) 548QString Score::formatDate(QDate date)
549{ 549{
550 QString s = i18n("@YY@/@MM@/@DD@"); 550 QString s = tr("@YY@/@MM@/@DD@");
551 551
552 QString dd; 552 QString dd;
553 dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0); 553 dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0);
554 s.replace(QRegExp("@YY@"), dd); 554 s.replace(QRegExp("@YY@"), dd);
555 dd.sprintf("%02d", date.isValid() ? date.month() : 0); 555 dd.sprintf("%02d", date.isValid() ? date.month() : 0);
556 s.replace(QRegExp("@MM@"), dd); 556 s.replace(QRegExp("@MM@"), dd);
557 dd.sprintf("%02d", date.isValid() ? date.day() : 0); 557 dd.sprintf("%02d", date.isValid() ? date.day() : 0);
558 s.replace(QRegExp("@DD@"), dd); 558 s.replace(QRegExp("@DD@"), dd);
559 559
560 return s; 560 return s;
561} 561}
562 562
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp
index 00d1f22..3453d37 100644
--- a/noncore/games/kpacman/status.cpp
+++ b/noncore/games/kpacman/status.cpp
@@ -39,29 +39,29 @@ QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
39 QList<QPixmap> *pixmaps) 39 QList<QPixmap> *pixmaps)
40{ 40{
41 if (pixmaps == NULL) { 41 if (pixmaps == NULL) {
42 pixmaps = new QList<QPixmap>; 42 pixmaps = new QList<QPixmap>;
43 pixmaps->setAutoDelete(TRUE); 43 pixmaps->setAutoDelete(TRUE);
44 } 44 }
45 45
46 if (!pixmaps->isEmpty()) 46 if (!pixmaps->isEmpty())
47 pixmaps->clear(); 47 pixmaps->clear();
48 48
49 QPixmap PIXMAP(pixmapName); 49 QPixmap PIXMAP(pixmapName);
50 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { 50 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
51 QString msg = i18n("The pixmap could not be contructed.\n\n" 51 QString msg = tr("The pixmap could not be contructed.\n\n"
52 "The file '@PIXMAPNAME@' does not exist,\n" 52 "The file '@PIXMAPNAME@' does not exist,\n"
53 "or is of an unknown format."); 53 "or is of an unknown format.");
54 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName); 54 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
55 QMessageBox::information(parent, i18n("Initialization Error"), 55 QMessageBox::information(parent, tr("Initialization Error"),
56 (const char *) msg); 56 (const char *) msg);
57 return 0; 57 return 0;
58 } 58 }
59 59
60 int height = PIXMAP.height(); 60 int height = PIXMAP.height();
61 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); 61 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
62 62
63 QBitmap BITMAP; 63 QBitmap BITMAP;
64 QBitmap MASK; 64 QBitmap MASK;
65 65
66 BITMAP = *PIXMAP.mask(); 66 BITMAP = *PIXMAP.mask();
67 MASK.resize(width, height); 67 MASK.resize(width, height);