summaryrefslogtreecommitdiffstats
path: root/ktuberling/toplevel.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 15:12:46 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 15:12:46 -0600
commit58a97ed3af5e4df6c4a58d043b0c267bd97056a9 (patch)
tree5a2fde6842fd422cae2d8670d382be965098cc32 /ktuberling/toplevel.cpp
parent2ce15ee76fd2d9d18a63c035a0f5b00b94c60cdc (diff)
downloadtdegames-58a97ed3af5e4df6c4a58d043b0c267bd97056a9.tar.gz
tdegames-58a97ed3af5e4df6c4a58d043b0c267bd97056a9.zip
Rename a number of classes to enhance compatibility with KDE4
Diffstat (limited to 'ktuberling/toplevel.cpp')
-rw-r--r--ktuberling/toplevel.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/ktuberling/toplevel.cpp b/ktuberling/toplevel.cpp
index 9593ef73..16869adb 100644
--- a/ktuberling/toplevel.cpp
+++ b/ktuberling/toplevel.cpp
@@ -23,7 +23,7 @@
// Constructor
TopLevel::TopLevel()
- : KMainWindow(0)
+ : TDEMainWindow(0)
{
readOptions();
@@ -34,7 +34,7 @@ TopLevel::TopLevel()
setCentralWidget(playGround);
- setupKAction();
+ setupTDEAction();
}
// Destructor
@@ -57,25 +57,25 @@ void TopLevel::enableRedo(bool enable) const
// Register an available gameboard
void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId)
{
- KToggleAction *t = 0;
+ TDEToggleAction *t = 0;
switch (gameboards)
{
- case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard0()), actionCollection(), actionId);
+ case 0: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard0()), actionCollection(), actionId);
break;
- case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard1()), actionCollection(), actionId);
+ case 1: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard1()), actionCollection(), actionId);
break;
- case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard2()), actionCollection(), actionId);
+ case 2: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard2()), actionCollection(), actionId);
break;
- case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard3()), actionCollection(), actionId);
+ case 3: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard3()), actionCollection(), actionId);
break;
- case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard4()), actionCollection(), actionId);
+ case 4: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard4()), actionCollection(), actionId);
break;
- case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard5()), actionCollection(), actionId);
+ case 5: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard5()), actionCollection(), actionId);
break;
- case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard6()), actionCollection(), actionId);
+ case 6: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard6()), actionCollection(), actionId);
break;
- case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard7()), actionCollection(), actionId);
+ case 7: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard7()), actionCollection(), actionId);
break;
}
@@ -89,41 +89,41 @@ void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId)
// Register an available language
void TopLevel::registerLanguage(const TQString &menuItem, const char *actionId, bool enabled)
{
- KToggleAction *t = 0;
+ TDEToggleAction *t = 0;
switch (languages)
{
- case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language0()), actionCollection(), actionId);
+ case 0: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language0()), actionCollection(), actionId);
break;
- case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language1()), actionCollection(), actionId);
+ case 1: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language1()), actionCollection(), actionId);
break;
- case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language2()), actionCollection(), actionId);
+ case 2: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language2()), actionCollection(), actionId);
break;
- case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language3()), actionCollection(), actionId);
+ case 3: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language3()), actionCollection(), actionId);
break;
- case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language4()), actionCollection(), actionId);
+ case 4: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language4()), actionCollection(), actionId);
break;
- case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language5()), actionCollection(), actionId);
+ case 5: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language5()), actionCollection(), actionId);
break;
- case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language6()), actionCollection(), actionId);
+ case 6: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language6()), actionCollection(), actionId);
break;
- case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language7()), actionCollection(), actionId);
+ case 7: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language7()), actionCollection(), actionId);
break;
- case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language8()), actionCollection(), actionId);
+ case 8: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language8()), actionCollection(), actionId);
break;
- case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language9()), actionCollection(), actionId);
+ case 9: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language9()), actionCollection(), actionId);
break;
- case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language10()), actionCollection(), actionId);
+ case 10: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language10()), actionCollection(), actionId);
break;
- case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language11()), actionCollection(), actionId);
+ case 11: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language11()), actionCollection(), actionId);
break;
- case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language12()), actionCollection(), actionId);
+ case 12: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language12()), actionCollection(), actionId);
break;
- case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language13()), actionCollection(), actionId);
+ case 13: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language13()), actionCollection(), actionId);
break;
- case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language14()), actionCollection(), actionId);
+ case 14: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language14()), actionCollection(), actionId);
break;
- case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language15()), actionCollection(), actionId);
+ case 15: t = new TDEToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language15()), actionCollection(), actionId);
break;
}
@@ -141,19 +141,19 @@ void TopLevel::changeGameboard(uint newGameboard)
// Do not accept to switch to same gameboard
if (newGameboard == selectedGameboard) {
// select this gameboard again
- ((KToggleAction*) actionCollection()->action(gameboardActions[newGameboard].latin1()))->setChecked(true);
+ ((TDEToggleAction*) actionCollection()->action(gameboardActions[newGameboard].latin1()))->setChecked(true);
return;
}
// Unselect preceding gameboard
- ((KToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->setChecked(false);
+ ((TDEToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->setChecked(false);
// Change gameboard in the remembered options
selectedGameboard = newGameboard;
writeOptions();
- if( !((KToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->isChecked() )
- ((KToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->setChecked(true);
+ if( !((TDEToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->isChecked() )
+ ((TDEToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->setChecked(true);
// Change gameboard effectively
playGround->change(newGameboard);
@@ -169,13 +169,13 @@ void TopLevel::changeLanguage(uint newLanguage)
// Do not accept to switch to same language
if (newLanguage == selectedLanguage && soundEnabled) {
// newLanguage should stay checked
- ((KToggleAction*) actionCollection()->action(languageActions[newLanguage].latin1()))->setChecked(true);
+ ((TDEToggleAction*) actionCollection()->action(languageActions[newLanguage].latin1()))->setChecked(true);
return;
}
// Unselect preceding language
- if (!soundEnabled) ((KToggleAction*) actionCollection()->action("speech_no_sound"))->setChecked(false);
- ((KToggleAction*) actionCollection()->action(languageActions[selectedLanguage].latin1()))->setChecked(false);
+ if (!soundEnabled) ((TDEToggleAction*) actionCollection()->action("speech_no_sound"))->setChecked(false);
+ ((TDEToggleAction*) actionCollection()->action(languageActions[selectedLanguage].latin1()))->setChecked(false);
// Change language in the remembered options
soundEnabled = true;
@@ -250,8 +250,8 @@ void TopLevel::writeOptions()
config->sync();
}
-// KAction initialization (aka menubar + toolbar init)
-void TopLevel::setupKAction()
+// TDEAction initialization (aka menubar + toolbar init)
+void TopLevel::setupTDEAction()
{
//Game
KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()), actionCollection());
@@ -259,7 +259,7 @@ void TopLevel::setupKAction()
KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(fileSave()), actionCollection());
KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(filePrint()), actionCollection());
KStdGameAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
- (void) new KAction(i18n("Save &as Picture..."), 0, TQT_TQOBJECT(this), TQT_SLOT(filePicture()), actionCollection(), "game_save_picture");
+ (void) new TDEAction(i18n("Save &as Picture..."), 0, TQT_TQOBJECT(this), TQT_SLOT(filePicture()), actionCollection(), "game_save_picture");
//Edit
KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(editCopy()), actionCollection());
@@ -269,7 +269,7 @@ void TopLevel::setupKAction()
enableRedo(false);
//Speech
- KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, TQT_TQOBJECT(this), TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound");
+ TDEToggleAction* t = new TDEToggleAction(i18n("&No Sound"), 0, TQT_TQOBJECT(this), TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound");
if (!soundEnabled) t->setChecked(true);
setupGUI();
@@ -508,8 +508,8 @@ void TopLevel::soundOff()
if (!soundEnabled) return;
soundEnabled = false;
- ((KToggleAction*) actionCollection()->action(languageActions[selectedLanguage].latin1()))->setChecked(false);
- ((KToggleAction*) actionCollection()->action("speech_no_sound"))->setChecked(true);
+ ((TDEToggleAction*) actionCollection()->action(languageActions[selectedLanguage].latin1()))->setChecked(false);
+ ((TDEToggleAction*) actionCollection()->action("speech_no_sound"))->setChecked(true);
writeOptions();
}