From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksokoban/MainWindow.cpp | 116 ++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'ksokoban/MainWindow.cpp') diff --git a/ksokoban/MainWindow.cpp b/ksokoban/MainWindow.cpp index 63654f1c..1f9ba526 100644 --- a/ksokoban/MainWindow.cpp +++ b/ksokoban/MainWindow.cpp @@ -22,19 +22,19 @@ #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -47,10 +47,10 @@ void MainWindow::createCollectionMenu() { - collection_ = new QPopupMenu(0,"collection menu"); + collection_ = new TQPopupMenu(0,"collection menu"); collection_->setCheckable(true); - //connect(collection_, SIGNAL(activated(int)), playField_, SLOT(changeCollection(int))); - connect(collection_, SIGNAL(activated(int)), this, SLOT(changeCollection(int))); + //connect(collection_, TQT_SIGNAL(activated(int)), playField_, TQT_SLOT(changeCollection(int))); + connect(collection_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeCollection(int))); for (int i=0; iinsertItem(internalCollections_[i]->name(), i); @@ -72,9 +72,9 @@ MainWindow::createCollectionMenu() { MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { int i; - QPixmap pixmap; + TQPixmap pixmap; - setEraseColor(QColor(0,0,0)); + setEraseColor(TQColor(0,0,0)); KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup("Geometry"); @@ -88,32 +88,32 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { menu_ = new KMenuBar(this, "menubar" ); - game_ = new QPopupMenu(0,"game menu"); + game_ = new TQPopupMenu(0,"game menu"); pixmap = SmallIcon("fileopen"); - game_->insertItem(QIconSet(pixmap), i18n("&Load Levels..."), this, SLOT(loadLevels())); + game_->insertItem(TQIconSet(pixmap), i18n("&Load Levels..."), this, TQT_SLOT(loadLevels())); pixmap = SmallIcon("forward"); - game_->insertItem(QIconSet(pixmap), i18n("&Next Level"), playField_, SLOT(nextLevel()), Key_N); + game_->insertItem(TQIconSet(pixmap), i18n("&Next Level"), playField_, TQT_SLOT(nextLevel()), Key_N); pixmap = SmallIcon("back"); - game_->insertItem(QIconSet(pixmap), i18n("&Previous Level"), playField_, SLOT(previousLevel()), Key_P); + game_->insertItem(TQIconSet(pixmap), i18n("&Previous Level"), playField_, TQT_SLOT(previousLevel()), Key_P); pixmap = SmallIcon("reload"); - game_->insertItem(QIconSet(pixmap), i18n("Re&start Level"), playField_, SLOT(restartLevel()), Key_Escape); + game_->insertItem(TQIconSet(pixmap), i18n("Re&start Level"), playField_, TQT_SLOT(restartLevel()), Key_Escape); createCollectionMenu(); game_->insertItem(i18n("&Level Collection"), collection_); pixmap = SmallIcon("undo"); - game_->insertItem(QIconSet(pixmap), i18n("&Undo"), playField_, SLOT(undo()),QKeySequence( (KStdAccel::undo()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Undo"), playField_, TQT_SLOT(undo()),TQKeySequence( (KStdAccel::undo()).toString())); pixmap = SmallIcon("redo"); - game_->insertItem(QIconSet(pixmap), i18n("&Redo"), playField_, SLOT(redo()), QKeySequence( (KStdAccel::redo()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Redo"), playField_, TQT_SLOT(redo()), TQKeySequence( (KStdAccel::redo()).toString())); game_->insertSeparator(); pixmap = SmallIcon("exit"); - game_->insertItem(QIconSet(pixmap), i18n("&Quit"), KApplication::kApplication(), SLOT(closeAllWindows()), QKeySequence( (KStdAccel::quit()).toString())); + game_->insertItem(TQIconSet(pixmap), i18n("&Quit"), KApplication::kApplication(), TQT_SLOT(closeAllWindows()), TQKeySequence( (KStdAccel::quit()).toString())); menu_->insertItem(i18n("&Game"), game_); - animation_ = new QPopupMenu(0,"animation menu"); + animation_ = new TQPopupMenu(0,"animation menu"); animation_->setCheckable(true); - connect(animation_, SIGNAL(activated(int)), this, SLOT(updateAnimMenu(int))); - connect(animation_, SIGNAL(activated(int)), playField_, SLOT(changeAnim(int))); + connect(animation_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateAnimMenu(int))); + connect(animation_, TQT_SIGNAL(activated(int)), playField_, TQT_SLOT(changeAnim(int))); animation_->insertItem(i18n("&Slow"), 3); animation_->insertItem(i18n("&Medium"), 2); animation_->insertItem(i18n("&Fast"), 1); @@ -123,54 +123,54 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { menu_->insertItem(i18n("&Animation"), animation_); pixmap = SmallIcon("bookmark_add"); - bookmarkMenu_ = new QPopupMenu(0,"bookmarks menu"); - setBM_ = new QPopupMenu(0, "set bookmark menu"); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 1); + bookmarkMenu_ = new TQPopupMenu(0,"bookmarks menu"); + setBM_ = new TQPopupMenu(0, "set bookmark menu"); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 1); setBM_->setAccel(CTRL+Key_1, 1); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 2); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 2); setBM_->setAccel(CTRL+Key_2, 2); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 3); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 3); setBM_->setAccel(CTRL+Key_3, 3); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 4); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 4); setBM_->setAccel(CTRL+Key_4, 4); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 5); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 5); setBM_->setAccel(CTRL+Key_5, 5); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 6); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 6); setBM_->setAccel(CTRL+Key_6, 6); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 7); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 7); setBM_->setAccel(CTRL+Key_7, 7); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 8); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 8); setBM_->setAccel(CTRL+Key_8, 8); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 9); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 9); setBM_->setAccel(CTRL+Key_9, 9); - setBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 10); + setBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 10); setBM_->setAccel(CTRL+Key_0, 10); - connect(setBM_, SIGNAL(activated(int)), this, SLOT(setBookmark(int))); + connect(setBM_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setBookmark(int))); bookmarkMenu_->insertItem(i18n("&Set Bookmark"), setBM_); pixmap = SmallIcon("bookmark"); - goToBM_ = new QPopupMenu(0, "go to bookmark menu"); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 1); + goToBM_ = new TQPopupMenu(0, "go to bookmark menu"); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 1); goToBM_->setAccel(Key_1, 1); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 2); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 2); goToBM_->setAccel(Key_2, 2); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 3); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 3); goToBM_->setAccel(Key_3, 3); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 4); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 4); goToBM_->setAccel(Key_4, 4); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 5); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 5); goToBM_->setAccel(Key_5, 5); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 6); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 6); goToBM_->setAccel(Key_6, 6); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 7); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 7); goToBM_->setAccel(Key_7, 7); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 8); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 8); goToBM_->setAccel(Key_8, 8); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 9); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 9); goToBM_->setAccel(Key_9, 9); - goToBM_->insertItem(QIconSet(pixmap), i18n("(unused)"), 10); + goToBM_->insertItem(TQIconSet(pixmap), i18n("(unused)"), 10); goToBM_->setAccel(Key_0, 10); - connect(goToBM_, SIGNAL(activated(int)), this, SLOT(goToBookmark(int))); + connect(goToBM_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(goToBookmark(int))); bookmarkMenu_->insertItem(i18n("&Go to Bookmark"), goToBM_); menu_->insertItem(i18n("&Bookmarks"), bookmarkMenu_); @@ -179,7 +179,7 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { updateBookmark(i); } - help_ = helpMenu(QString::null, false); + help_ = helpMenu(TQString::null, false); menu_->insertSeparator(); menu_->insertItem(i18n("&Help"), help_); @@ -222,7 +222,7 @@ MainWindow::~MainWindow() void -MainWindow::focusInEvent(QFocusEvent *) { +MainWindow::focusInEvent(TQFocusEvent *) { playField_->setFocus(); } @@ -241,12 +241,12 @@ MainWindow::updateBookmark(int num) { if (col < 0 || lev < 0) return; - QString name; + TQString name; if (col >= 0 && col < internalCollections_.collections()) name = internalCollections_[col]->name(); else name = i18n("(invalid)"); - QString l; + TQString l; l.setNum(lev+1); name += " #" + l; l.setNum(mov); @@ -299,7 +299,7 @@ void MainWindow::loadLevels() { KConfig *cfg=(KApplication::kApplication())->config(); cfg->setGroup("settings"); - QString lastFile = cfg->readPathEntry("lastLevelFile"); + TQString lastFile = cfg->readPathEntry("lastLevelFile"); KURL result = KFileDialog::getOpenURL(lastFile, "*", this, i18n("Load Levels From File")); if (result.isEmpty()) return; @@ -312,10 +312,10 @@ MainWindow::openURL(KURL _url) { KConfig *cfg=(KApplication::kApplication())->config(); // int namepos = _url.path().findRev('/') + 1; // NOTE: findRev can return -1 -// QString levelName = _url.path().mid(namepos); - QString levelName = _url.fileName(); +// TQString levelName = _url.path().mid(namepos); + TQString levelName = _url.fileName(); - QString levelFile; + TQString levelFile; if (_url.isLocalFile()) { levelFile = _url.path(); } else { @@ -347,15 +347,15 @@ MainWindow::openURL(KURL _url) { } void -MainWindow::dragEnterEvent(QDragEnterEvent* event) { +MainWindow::dragEnterEvent(TQDragEnterEvent* event) { event->accept(KURLDrag::canDecode(event)); } void -MainWindow::dropEvent(QDropEvent* event) { +MainWindow::dropEvent(TQDropEvent* event) { KURL::List urls; if (KURLDrag::decode(event, urls)) { -// kdDebug() << "MainWindow:Handling QUriDrag..." << endl; +// kdDebug() << "MainWindow:Handling TQUriDrag..." << endl; if (urls.count() > 0) { const KURL &url = urls.first(); openURL(url); -- cgit v1.2.1