diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /ktuberling/toplevel.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktuberling/toplevel.cpp')
-rw-r--r-- | ktuberling/toplevel.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/ktuberling/toplevel.cpp b/ktuberling/toplevel.cpp index 53566f17..c0822446 100644 --- a/ktuberling/toplevel.cpp +++ b/ktuberling/toplevel.cpp @@ -61,21 +61,21 @@ void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId) switch (gameboards) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard7()), actionCollection(), actionId); break; } @@ -93,37 +93,37 @@ void TopLevel::registerLanguage(const TQString &menuItem, const char *actionId, switch (languages) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language7()), actionCollection(), actionId); break; - case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language8()), actionCollection(), actionId); + case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language8()), actionCollection(), actionId); break; - case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language9()), actionCollection(), actionId); + case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language9()), actionCollection(), actionId); break; - case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language10()), actionCollection(), actionId); + case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language10()), actionCollection(), actionId); break; - case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language11()), actionCollection(), actionId); + case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language11()), actionCollection(), actionId); break; - case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language12()), actionCollection(), actionId); + case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language12()), actionCollection(), actionId); break; - case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language13()), actionCollection(), actionId); + case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language13()), actionCollection(), actionId); break; - case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language14()), actionCollection(), actionId); + case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language14()), actionCollection(), actionId); break; - case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language15()), actionCollection(), actionId); + case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language15()), actionCollection(), actionId); break; } @@ -186,19 +186,19 @@ void TopLevel::changeLanguage(uint newLanguage) soundFactory->change(newLanguage); } -// Load the layouts file -bool TopLevel::loadLayout(TQDomDocument &layoutDocument) +// Load the tqlayouts file +bool TopLevel::loadLayout(TQDomDocument &tqlayoutDocument) { - TQFile layoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/layout.xml"))); - if (!layoutFile.open(IO_ReadOnly)) + TQFile tqlayoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/tqlayout.xml"))); + if (!tqlayoutFile.open(IO_ReadOnly)) return false; - if (!layoutDocument.setContent(&layoutFile)) + if (!tqlayoutDocument.setContent(&tqlayoutFile)) { - layoutFile.close(); + tqlayoutFile.close(); return false; } - layoutFile.close(); + tqlayoutFile.close(); return true; } @@ -219,7 +219,7 @@ void TopLevel::readOptions() config->setGroup("General"); option = config->readEntry("Sound", "on"); - soundEnabled = option.find("on") == 0; + soundEnabled = option.tqfind("on") == 0; option = config->readEntry("GameboardNumber", "0"); selectedGameboard = option.toInt(); @@ -254,22 +254,22 @@ void TopLevel::writeOptions() void TopLevel::setupKAction() { //Game - KStdGameAction::gameNew(this, TQT_SLOT(fileNew()), actionCollection()); - KStdGameAction::load(this, TQT_SLOT(fileOpen()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(fileSave()), actionCollection()); - KStdGameAction::print(this, TQT_SLOT(filePrint()), actionCollection()); - KStdGameAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); - (void) new KAction(i18n("Save &as Picture..."), 0, this, TQT_SLOT(filePicture()), actionCollection(), "game_save_picture"); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection()); + 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"); //Edit - KStdAction::copy(this, TQT_SLOT(editCopy()), actionCollection()); - KStdAction::undo(this, TQT_SLOT(editUndo()), actionCollection()); - KStdAction::redo(this, TQT_SLOT(editRedo()), actionCollection()); + KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(editCopy()), actionCollection()); + KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(editUndo()), actionCollection()); + KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(editRedo()), actionCollection()); enableUndo(false); enableRedo(false); //Speech - KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, this, TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound"); + KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, TQT_TQOBJECT(this), TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound"); if (!soundEnabled) t->setChecked(true); setupGUI(); @@ -283,14 +283,14 @@ void TopLevel::fileNew() enableUndo(false); enableRedo(false); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Load gameboard void TopLevel::fileOpen() { TQString dir = locate("data", "ktuberling/museum/miss.tuberling"); - dir.truncate(dir.findRev('/') + 1); + dir.truncate(dir.tqfindRev('/') + 1); KURL url = KFileDialog::getOpenURL(dir, "*.tuberling"); @@ -314,7 +314,7 @@ void TopLevel::open(const KURL &url) enableUndo(!playGround->isFirstAction()); enableRedo(false); - playGround->repaintAll(); + playGround->tqrepaintAll(); KIO::NetAccess::removeTempFile( name ); } @@ -323,7 +323,7 @@ void TopLevel::open(const KURL &url) void TopLevel::fileSave() { KURL url = KFileDialog::getSaveURL - ( TQString::null, + ( TQString(), "*.tuberling"); if (url.isEmpty()) @@ -340,7 +340,7 @@ void TopLevel::fileSave() TQString name = url.path(); int suffix; - suffix = name.findRev('.'); + suffix = name.tqfindRev('.'); if (suffix == -1) { name += ".tuberling"; @@ -356,7 +356,7 @@ void TopLevel::filePicture() TQPixmap picture(playGround->getPicture()); KURL url = KFileDialog::getSaveURL - ( TQString::null, + ( TQString(), i18n( "*.xpm|UNIX Pixmaps (*.xpm)\n" "*.jpg|JPEG Compressed Files (*.jpg)\n" "*.png|Next Generation Pictures (*.png)\n" @@ -379,7 +379,7 @@ void TopLevel::filePicture() int suffix; TQString end; - suffix = name.findRev('.'); + suffix = name.tqfindRev('.'); if (suffix == -1) { name += ".xpm"; @@ -408,9 +408,9 @@ void TopLevel::filePrint() KPrinter printer; bool ok; - ok = printer.setup(this, i18n("Print %1").arg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText())); + ok = printer.setup(this, i18n("Print %1").tqarg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText())); if (!ok) return; - playGround->repaint(true); + playGround->tqrepaint(true); if (!playGround->printPicture(printer)) KMessageBox::error(this, i18n("Could not print picture.")); @@ -422,7 +422,7 @@ void TopLevel::filePrint() // Copy modified area to clipboard void TopLevel::editCopy() { - QClipboard *clipboard = TQApplication::clipboard(); + TQClipboard *clipboard = TQApplication::tqclipboard(); TQPixmap picture(playGround->getPicture()); clipboard->setPixmap(picture); @@ -438,7 +438,7 @@ void TopLevel::editUndo() if (playGround->isFirstAction()) enableUndo(false); enableRedo(true); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Redo last action @@ -451,7 +451,7 @@ void TopLevel::editRedo() if (playGround->isLastAction()) enableRedo(false); enableUndo(true); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Switch to gameboard #0 |