summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-14 13:09:32 (UTC)
committer llornkcor <llornkcor>2002-04-14 13:09:32 (UTC)
commitac6b7c674438e06fd1c7648aae50539f14a62789 (patch) (side-by-side diff)
tree268edab34cd30dc1bbb6b23bdbd875870abfb1d4
parentac3b5af140135bca092bd442a43b110ed8366e67 (diff)
downloadopie-ac6b7c674438e06fd1c7648aae50539f14a62789.zip
opie-ac6b7c674438e06fd1c7648aae50539f14a62789.tar.gz
opie-ac6b7c674438e06fd1c7648aae50539f14a62789.tar.bz2
changed char *'s to QStringList for better internationalization
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/tictac/tictac.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/noncore/games/tictac/tictac.cpp b/noncore/games/tictac/tictac.cpp
index 20cc942..3d727ac 100644
--- a/noncore/games/tictac/tictac.cpp
+++ b/noncore/games/tictac/tictac.cpp
@@ -1,44 +1,45 @@
/****************************************************************************
** $Id$
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include "tictac.h"
#include <qpe/qpeapplication.h>
#include <qpainter.h>
#include <qdrawutil.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <stdlib.h> // rand() function
#include <qdatetime.h> // seed for rand()
+#include <qstringlist.h> //needed for proper internationalization
//***************************************************************************
//* TicTacButton member functions
//***************************************************************************
// --------------------------------------------------------------------------
// Creates a TicTacButton
//
TicTacButton::TicTacButton( QWidget *parent ) : QPushButton( parent )
{
t = Blank; // initial type
}
// --------------------------------------------------------------------------
// Paints TicTacButton
//
void TicTacButton::drawButtonLabel( QPainter *p )
{
QRect r = rect();
p->setPen( QPen( white,2 ) ); // set fat pen
if ( t == Circle ) {
@@ -348,30 +349,33 @@ void TicTacToe::newGameClicked()
board->newGame();
newState();
}
// --------------------------------------------------------------------------
// TicTacToe::gameOver() - SLOT
//
// This slot is activated when the TicTacGameBoard emits the signal
// "finished()", i.e. when a player has won or when it is a draw.
//
void TicTacToe::gameOver()
{
newState(); // update text box
}
// --------------------------------------------------------------------------
// Updates the message to reflect a new state.
//
void TicTacToe::newState()
{
- static const char *msg[] = { // TicTacGameBoard::State texts
- "Click Play to start", "Make your move",
- "You won!", "Computer won!", "It's a draw" };
+ QStringList msg;
+ msg << tr( "Click Play to start")
+ << tr("Make your move")
+ << tr("You won!")
+ << tr("Computer won!")
+ << tr("It's a draw");
message->setText( msg[board->state()] );
return;
}