From 10be547ec088f044f5a10dec4aacc39e242ca4fd Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 10 Jul 2014 22:41:26 +1000 Subject: [PATCH] Qt: Update desktop menus --- Qt/mainwindow.cpp | 32 +++++++++++++++++++++++++------- Qt/mainwindow.h | 3 ++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index f9ef5a3ed7..8f6e144ec7 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -25,6 +25,7 @@ MainWindow::MainWindow(QWidget *parent) : memoryTexWindow(0), displaylistWindow(0) { + SetGameTitle(""); emugl = new MainUI(this); setCentralWidget(emugl); @@ -362,9 +363,24 @@ void MainWindow::websiteAct() QDesktopServices::openUrl(QUrl("http://www.ppsspp.org/")); } +void MainWindow::forumAct() +{ + QDesktopServices::openUrl(QUrl("http://forums.ppsspp.org/")); +} + void MainWindow::aboutAct() { - QMessageBox::about(this, "PPSSPP Qt", QString::fromUtf8("Created by Henrik Rydg\xc3\xa5rd")); + QMessageBox::about(this, "About", QString::fromUtf8("PPSSPP Qt " PPSSPP_GIT_VERSION "\n\n" + "PSP emulator and debugger\n\n" + "Copyright (c) by Henrik Rydg\xc3\xa5rd and the PPSSPP Project 2012-\n" + "Qt port maintained by xSacha\n\n" + "Additional credits:\n" + " PSPSDK by #pspdev (freenode)\n" + " CISO decompression code by BOOSTER\n" + " zlib by Jean-loup Gailly (compression) and Mark Adler (decompression)\n" + " Qt project by Digia\n\n" + "All trademarks are property of their respective owners.\n" + "The emulator is for educational and development purposes only and it may not be used to play games you do not legally own.")); } /* Private functions */ @@ -384,7 +400,7 @@ void MainWindow::SetZoom(int zoom) { void MainWindow::SetGameTitle(QString text) { - QString title = "PPSSPP " + QString(PPSSPP_GIT_VERSION); + QString title = "PPSSPP " PPSSPP_GIT_VERSION; if (text != "") title += QString(" - %1").arg(text); @@ -395,14 +411,15 @@ void MainWindow::loadLanguage(const QString& language, bool translate) { if (currentLanguage != language) { - currentLanguage = language; - QLocale::setDefault(QLocale(currentLanguage)); + QLocale::setDefault(QLocale(language)); QApplication::removeTranslator(&translator); + + currentLanguage = language; if (translator.load(QString(":/languages/ppsspp_%1.qm").arg(language))) { QApplication::installTranslator(&translator); - if (translate) - emit retranslate(); } + if (translate) + emit retranslate(); } } @@ -576,7 +593,8 @@ void MainWindow::createMenus() // Help MenuTree* helpMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&Help")); - helpMenu->add(new MenuAction(this, SLOT(websiteAct()), QT_TR_NOOP("&Go to official website"), QKeySequence::HelpContents)); + helpMenu->add(new MenuAction(this, SLOT(websiteAct()), QT_TR_NOOP("Official &website"), QKeySequence::HelpContents)); + helpMenu->add(new MenuAction(this, SLOT(forumAct()), QT_TR_NOOP("Official &forum"))); helpMenu->add(new MenuAction(this, SLOT(aboutAct()), QT_TR_NOOP("&About PPSSPP..."), QKeySequence::WhatsThis)); retranslate(); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 0bcd62e34b..397f6eac1c 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -128,6 +128,7 @@ private slots: // Help void websiteAct(); + void forumAct(); void aboutAct(); // Others @@ -239,7 +240,7 @@ public: QListIterator i(valueList); QListIterator k(keyList); foreach(QString name, nameList) { - new MenuAction(parent, this, i.next(), name, k.next()); + new MenuAction(parent, this, i.next(), name, keyList.size() ? k.next() : 0); } connect(this, SIGNAL(triggered(QAction *)), parent, callback); menu->addActions(this->actions());