summaryrefslogtreecommitdiffstats
path: root/kmahjongg/kmahjongg.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kmahjongg/kmahjongg.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmahjongg/kmahjongg.cpp')
-rw-r--r--kmahjongg/kmahjongg.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp
index 7c18ed50..dd49fedd 100644
--- a/kmahjongg/kmahjongg.cpp
+++ b/kmahjongg/kmahjongg.cpp
@@ -57,7 +57,7 @@ int is_paused = 0;
/**
Constructor.
*/
-KMahjongg::KMahjongg( QWidget* parent, const char *name)
+KMahjongg::KMahjongg( TQWidget* parent, const char *name)
: KMainWindow(parent, name)
{
boardEditor = 0;
@@ -80,37 +80,37 @@ KMahjongg::KMahjongg( QWidget* parent, const char *name)
bDemoModeActive = false;
- connect( bw, SIGNAL( statusTextChanged(const QString&, long) ),
- SLOT( showStatusText(const QString&, long) ) );
+ connect( bw, TQT_SIGNAL( statusTextChanged(const TQString&, long) ),
+ TQT_SLOT( showStatusText(const TQString&, long) ) );
- connect( bw, SIGNAL( tileNumberChanged(int,int,int) ),
- SLOT( showTileNumber(int,int,int) ) );
+ connect( bw, TQT_SIGNAL( tileNumberChanged(int,int,int) ),
+ TQT_SLOT( showTileNumber(int,int,int) ) );
- connect( bw, SIGNAL( demoModeChanged(bool) ),
- SLOT( demoModeChanged(bool) ) );
+ connect( bw, TQT_SIGNAL( demoModeChanged(bool) ),
+ TQT_SLOT( demoModeChanged(bool) ) );
- connect( bw, SIGNAL( gameOver(unsigned short , unsigned short)), this,
- SLOT( gameOver(unsigned short , unsigned short)));
+ connect( bw, TQT_SIGNAL( gameOver(unsigned short , unsigned short)), this,
+ TQT_SLOT( gameOver(unsigned short , unsigned short)));
- connect(bw, SIGNAL(gameCalculated()),
- this, SLOT(timerReset()));
+ connect(bw, TQT_SIGNAL(gameCalculated()),
+ this, TQT_SLOT(timerReset()));
// Make connections for the preview load dialog
- connect( previewLoad, SIGNAL( boardRedraw(bool) ),
- bw, SLOT( drawBoard(bool) ) );
+ connect( previewLoad, TQT_SIGNAL( boardRedraw(bool) ),
+ bw, TQT_SLOT( drawBoard(bool) ) );
- connect( previewLoad, SIGNAL( layoutChange() ),
- this, SLOT( newGame() ) );
+ connect( previewLoad, TQT_SIGNAL( layoutChange() ),
+ this, TQT_SLOT( newGame() ) );
- connect( previewLoad, SIGNAL( loadBackground(const QString&, bool) ),
- bw, SLOT(loadBackground(const QString&, bool) ) );
+ connect( previewLoad, TQT_SIGNAL( loadBackground(const TQString&, bool) ),
+ bw, TQT_SLOT(loadBackground(const TQString&, bool) ) );
- connect( previewLoad, SIGNAL( loadTileset(const QString &) ),
- bw, SLOT(loadTileset(const QString&) ) );
- connect( previewLoad, SIGNAL( loadBoard(const QString&) ),
- SLOT(loadBoardLayout(const QString&) ) );
+ connect( previewLoad, TQT_SIGNAL( loadTileset(const TQString &) ),
+ bw, TQT_SLOT(loadTileset(const TQString&) ) );
+ connect( previewLoad, TQT_SIGNAL( loadBoard(const TQString&) ),
+ TQT_SLOT(loadBoardLayout(const TQString&) ) );
startNewGame( );
@@ -128,41 +128,41 @@ KMahjongg::~KMahjongg()
void KMahjongg::setupKAction()
{
// game
- KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection());
- KStdGameAction::load(this, SLOT(loadGame()), actionCollection());
- KStdGameAction::save(this, SLOT(saveGame()), actionCollection());
- KStdGameAction::quit(this, SLOT(close()), actionCollection());
- KStdGameAction::restart(this, SLOT(restartGame()), actionCollection());
- new KAction(i18n("New Numbered Game..."), "newnum", 0, this, SLOT(startNewNumeric()), actionCollection(), "game_new_numeric");
- new KAction(i18n("Open Th&eme..."), 0, this, SLOT(openTheme()), actionCollection(), "game_open_theme");
- new KAction(i18n("Open &Tileset..."), 0, this, SLOT(openTileset()), actionCollection(), "game_open_tileset");
- new KAction(i18n("Open &Background..."), 0, this, SLOT(openBackground()), actionCollection(), "game_open_background");
- new KAction(i18n("Open La&yout..."), 0, this, SLOT(openLayout()), actionCollection(), "game_open_layout");
- new KAction(i18n("Sa&ve Theme..."), 0, this, SLOT(saveTheme()), actionCollection(), "game_save_theme");
+ KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection());
+ KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection());
+ KStdGameAction::save(this, TQT_SLOT(saveGame()), actionCollection());
+ KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
+ KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection());
+ new KAction(i18n("New Numbered Game..."), "newnum", 0, this, TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric");
+ new KAction(i18n("Open Th&eme..."), 0, this, TQT_SLOT(openTheme()), actionCollection(), "game_open_theme");
+ new KAction(i18n("Open &Tileset..."), 0, this, TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset");
+ new KAction(i18n("Open &Background..."), 0, this, TQT_SLOT(openBackground()), actionCollection(), "game_open_background");
+ new KAction(i18n("Open La&yout..."), 0, this, TQT_SLOT(openLayout()), actionCollection(), "game_open_layout");
+ new KAction(i18n("Sa&ve Theme..."), 0, this, TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme");
// originally "file" ends here
- KStdGameAction::hint(bw, SLOT(helpMove()), actionCollection());
- new KAction(i18n("Shu&ffle"), "reload", 0, bw, SLOT(shuffle()), actionCollection(), "move_shuffle");
- demoAction = KStdGameAction::demo(this, SLOT(demoMode()), actionCollection());
- showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles");
+ KStdGameAction::hint(bw, TQT_SLOT(helpMove()), actionCollection());
+ new KAction(i18n("Shu&ffle"), "reload", 0, bw, TQT_SLOT(shuffle()), actionCollection(), "move_shuffle");
+ demoAction = KStdGameAction::demo(this, TQT_SLOT(demoMode()), actionCollection());
+ showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles");
showMatchingTilesAction->setCheckedState(i18n("Hide &Matching Tiles"));
showMatchingTilesAction->setChecked(Prefs::showMatchingTiles());
bw->setShowMatch( Prefs::showMatchingTiles() );
- KStdGameAction::highscores(this, SLOT(showHighscores()), actionCollection());
- pauseAction = KStdGameAction::pause(this, SLOT(pause()), actionCollection());
+ KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection());
+ pauseAction = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection());
// TODO: store the background ; open on startup
// TODO: same about layout
// TODO: same about theme
// move
- undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection());
- redoAction = KStdGameAction::redo(this, SLOT(redo()), actionCollection());
+ undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection());
+ redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection());
// edit
- new KAction(i18n("&Board Editor"), 0, this, SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor");
+ new KAction(i18n("&Board Editor"), 0, this, TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor");
// settings
- KStdAction::preferences(this, SLOT(showSettings()), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
setupGUI();
}
@@ -177,18 +177,18 @@ void KMahjongg::setupStatusBar()
// as compilation), in case someone comes up with a better fix.
// pStatusBar->setInsertOrder( KStatusBar::RightToLeft );
- tilesLeftLabel= new QLabel("Removed: 0000/0000", statusBar());
- tilesLeftLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ tilesLeftLabel= new TQLabel("Removed: 0000/0000", statusBar());
+ tilesLeftLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->sizeHint().width(), ID_STATUS_GAME);
- gameNumLabel = new QLabel("Game: 000000000000000000000", statusBar());
- gameNumLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ gameNumLabel = new TQLabel("Game: 000000000000000000000", statusBar());
+ gameNumLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
statusBar()->addWidget(gameNumLabel, gameNumLabel->sizeHint().width(), ID_STATUS_TILENUMBER);
- statusLabel= new QLabel("Kmahjongg", statusBar());
- statusLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ statusLabel= new TQLabel("Kmahjongg", statusBar());
+ statusLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
statusBar()->addWidget(statusLabel, statusLabel->sizeHint().width(), ID_STATUS_MESSAGE);
// pStatusBar->setAlignment( ID_STATUS_TILENUMBER, AlignCenter );
@@ -198,7 +198,7 @@ void KMahjongg::setDisplayedWidth()
{
bw->setDisplayedWidth();
/* setFixedSize( bw->size() +
- QSize( 2, (!statusBar()->isHidden() ? statusBar()->height() : 0)
+ TQSize( 2, (!statusBar()->isHidden() ? statusBar()->height() : 0)
+ 2 + menuBar()->height() ) );
toolBar()->setFixedWidth(bw->width());*/
toolBar()->alignItemRight( ID_GAME_TIMER, true );
@@ -238,8 +238,8 @@ void KMahjongg::showSettings(){
KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow);
dialog->addPage(new Settings(0, "General"), i18n("General"), "package_settings");
- connect(dialog, SIGNAL(settingsChanged()), bw, SLOT(loadSettings()));
- connect(dialog, SIGNAL(settingsChanged()), this, SLOT(setDisplayedWidth()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), bw, TQT_SLOT(loadSettings()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(setDisplayedWidth()));
dialog->show();
}
@@ -394,10 +394,10 @@ void KMahjongg::gameOver(
}
// ---------------------------------------------------------
-void KMahjongg::showStatusText( const QString &msg, long board )
+void KMahjongg::showStatusText( const TQString &msg, long board )
{
statusLabel->setText(msg);
- QString str = i18n("Game number: %1").arg(board);
+ TQString str = i18n("Game number: %1").arg(board);
gameNumLabel->setText(str);
}
@@ -406,8 +406,8 @@ void KMahjongg::showStatusText( const QString &msg, long board )
void KMahjongg::showTileNumber( int iMaximum, int iCurrent, int iLeft )
{
// Hmm... seems iCurrent is the number of remaining tiles, not removed ...
- //QString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum);
- QString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft);
+ //TQString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum);
+ TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft);
tilesLeftLabel->setText(szBuffer);
// Update here since undo allow is effected by demo mode
@@ -445,7 +445,7 @@ void KMahjongg::demoModeChanged( bool bActive)
}
}
-void KMahjongg::loadBoardLayout(const QString &file) {
+void KMahjongg::loadBoardLayout(const TQString &file) {
bw->loadBoardLayout(file);
}
@@ -458,7 +458,7 @@ void KMahjongg::tileSizeChanged() {
void KMahjongg::loadGame() {
GAMEDATA in;
char buffer[1024];
- QString fname;
+ TQString fname;
// Get the name of the file to load
KURL url = KFileDialog::getOpenURL( NULL, "*.kmgame", this, i18n("Load Game" ) );
@@ -469,7 +469,7 @@ void KMahjongg::loadGame() {
KIO::NetAccess::download( url, fname, this );
// open the file for reading
- FILE *outFile = fopen( QFile::encodeName(fname), "r");
+ FILE *outFile = fopen( TQFile::encodeName(fname), "r");
if (outFile == NULL) {
KMessageBox::sorry(this,
i18n("Could not read from file. Aborting."));
@@ -537,7 +537,7 @@ void KMahjongg::saveGame() {
return;
}
- FILE *outFile = fopen( QFile::encodeName(url.path()), "w");
+ FILE *outFile = fopen( TQFile::encodeName(url.path()), "w");
if (outFile == NULL) {
KMessageBox::sorry(this,
i18n("Could not write to file. Aborting."));