From 58a97ed3af5e4df6c4a58d043b0c267bd97056a9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 15:12:46 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- ksmiletris/gamewindow.cpp | 34 +++++++++++++++++----------------- ksmiletris/gamewindow.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'ksmiletris') diff --git a/ksmiletris/gamewindow.cpp b/ksmiletris/gamewindow.cpp index d3bef18d..1937e996 100644 --- a/ksmiletris/gamewindow.cpp +++ b/ksmiletris/gamewindow.cpp @@ -43,7 +43,7 @@ const int default_width = 362; const int default_height = 460; GameWindow::GameWindow(TQWidget *, const char *name) - : KMainWindow(0, name) + : TDEMainWindow(0, name) { //New Games (void)KStdGameAction::gameNew(TQT_TQOBJECT(this), @@ -71,15 +71,15 @@ GameWindow::GameWindow(TQWidget *, const char *name) actionCollection()); TQStringList list; - KSelectAction* piecesAct = - new KSelectAction(i18n("&Pieces"), 0, TQT_TQOBJECT(this), TQT_SLOT(menu_pieces()), + TDESelectAction* piecesAct = + new TDESelectAction(i18n("&Pieces"), 0, TQT_TQOBJECT(this), TQT_SLOT(menu_pieces()), actionCollection(), "settings_pieces"); list.append(i18n("&Smiles")); list.append(i18n("S&ymbols")); list.append(i18n("&Icons")); piecesAct->setItems(list); - (void)new KToggleAction(i18n("&Sounds"), 0, TQT_TQOBJECT(this), + (void)new TDEToggleAction(i18n("&Sounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(menu_sounds()), actionCollection(), "settings_sounds"); @@ -102,11 +102,11 @@ GameWindow::GameWindow(TQWidget *, const char *name) connect(game, TQT_SIGNAL(gameOver()), TQT_TQOBJECT(this), TQT_SLOT(gameOver())); //keys - (void)new KAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(game), TQT_SLOT(keyLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(game), TQT_SLOT(keyRight()), actionCollection(), "right"); - (void)new KAction(i18n("Rotate Left"), Key_Up, TQT_TQOBJECT(game), TQT_SLOT(keyUp()), actionCollection(), "up"); - (void)new KAction(i18n("Rotate Right"), Key_Down, TQT_TQOBJECT(game), TQT_SLOT(keyDown()), actionCollection(), "down"); - (void)new KAction(i18n("Drop Down"), Key_Space, TQT_TQOBJECT(game), TQT_SLOT(keySpace()), actionCollection(), "space"); + (void)new TDEAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(game), TQT_SLOT(keyLeft()), actionCollection(), "left"); + (void)new TDEAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(game), TQT_SLOT(keyRight()), actionCollection(), "right"); + (void)new TDEAction(i18n("Rotate Left"), Key_Up, TQT_TQOBJECT(game), TQT_SLOT(keyUp()), actionCollection(), "up"); + (void)new TDEAction(i18n("Rotate Right"), Key_Down, TQT_TQOBJECT(game), TQT_SLOT(keyDown()), actionCollection(), "down"); + (void)new TDEAction(i18n("Drop Down"), Key_Space, TQT_TQOBJECT(game), TQT_SLOT(keySpace()), actionCollection(), "space"); game->setFixedSize(default_width, default_height); adjustSize(); @@ -117,18 +117,18 @@ GameWindow::GameWindow(TQWidget *, const char *name) config->setGroup("Options"); PiecesType pieces_type = (PiecesType)config->readNumEntry("Pieces", static_cast(Pieces_Smiles)); game->setPieces(pieces_type); - ((KSelectAction*)actionCollection()->action("settings_pieces"))->setCurrentItem((int)pieces_type); + ((TDESelectAction*)actionCollection()->action("settings_pieces"))->setCurrentItem((int)pieces_type); game->do_sounds = config->readBoolEntry("Sounds", true); - ((KToggleAction*)actionCollection()->action("settings_sounds"))->setChecked(game->do_sounds); + ((TDEToggleAction*)actionCollection()->action("settings_sounds"))->setChecked(game->do_sounds); - setupGUI(KMainWindow::Save | Keys | StatusBar | Create); + setupGUI(TDEMainWindow::Save | Keys | StatusBar | Create); } void GameWindow::menu_newGame() { - ((KToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(false); + ((TDEToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(false); game->newGame(); } @@ -136,7 +136,7 @@ void GameWindow::menu_pause() { if (game->in_game) { game->in_pause = !game->in_pause; - ((KToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(game->in_pause); + ((TDEToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(game->in_pause); game->repaintChilds(); } } @@ -146,7 +146,7 @@ void GameWindow::menu_endGame() if (game->in_game) { game->in_game = false; game->repaintChilds(); - ((KToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(false); + ((TDEToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(false); gameOver(); } } @@ -159,7 +159,7 @@ void GameWindow::menu_highScores() void GameWindow::menu_pieces() { - int index = ((KSelectAction*)actionCollection()->action("settings_pieces"))->currentItem(); + int index = ((TDESelectAction*)actionCollection()->action("settings_pieces"))->currentItem(); game->setPieces((PiecesType)index); TDEConfig *config = kapp->config(); @@ -170,7 +170,7 @@ void GameWindow::menu_pieces() void GameWindow::menu_sounds() { game->do_sounds = !game->do_sounds; - ((KToggleAction*)actionCollection()->action("settings_sounds"))->setChecked(game->do_sounds); + ((TDEToggleAction*)actionCollection()->action("settings_sounds"))->setChecked(game->do_sounds); TDEConfig *config = kapp->config(); config->setGroup("Options"); diff --git a/ksmiletris/gamewindow.h b/ksmiletris/gamewindow.h index 55d6434b..565192a3 100644 --- a/ksmiletris/gamewindow.h +++ b/ksmiletris/gamewindow.h @@ -33,7 +33,7 @@ class TQPopupMenu; class GameWidget; class KStatusBar; -class GameWindow : public KMainWindow { +class GameWindow : public TDEMainWindow { Q_OBJECT -- cgit v1.2.1