From beaa03c0ad49f3027ebe6444a07fc22e4521bb88 Mon Sep 17 00:00:00 2001 From: zminhquanz Date: Sun, 5 Feb 2017 20:16:22 +0700 Subject: [PATCH] Add Github choose in help Make more convenient if you contact github quickly --- Qt/mainwindow.cpp | 6 ++++++ Qt/mainwindow.h | 1 + Windows/MainWindowMenu.cpp | 6 ++++++ Windows/resource.h | 1 + 4 files changed, 14 insertions(+) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 85a92ee4c5..5058852281 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -400,6 +400,11 @@ void MainWindow::forumAct() QDesktopServices::openUrl(QUrl("http://forums.ppsspp.org/")); } +void MainWindow::gitAct() +{ + QDesktopServices::openUrl(QUrl("https://github.com/hrydgard/ppsspp/")); +} + void MainWindow::aboutAct() { QMessageBox::about(this, "About", QString("PPSSPP Qt %1\n\n" @@ -645,6 +650,7 @@ void MainWindow::createMenus() MenuTree* helpMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&Help")); 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(gitAct()), QT_TR_NOOP("&GitHub"))); 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 b20279fd47..2a7245bce2 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -129,6 +129,7 @@ private slots: // Help void websiteAct(); void forumAct(); + void gitAct(); void aboutAct(); // Others diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index da870a8d1a..c91430461b 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -137,6 +137,7 @@ namespace MainWindow { const std::wstring visitMainWebsite = ConvertUTF8ToWString(des->T("www.ppsspp.org")); const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums")); const std::wstring buyGold = ConvertUTF8ToWString(des->T("Buy Gold")); + const std::wstring gitHub = ConvertUTF8ToWString(des->T("GitHub")); const std::wstring aboutPPSSPP = ConvertUTF8ToWString(des->T("About PPSSPP...")); // Simply remove the old help menu and create a new one. @@ -149,6 +150,7 @@ namespace MainWindow { AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_OPENFORUM, visitForum.c_str()); // Repeat the process for other languages, if necessary. AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_BUYGOLD, buyGold.c_str()); + AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_GITHUB, gitHub.c_str()); AppendMenu(helpMenu, MF_SEPARATOR, 0, 0); AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_ABOUT, aboutPPSSPP.c_str()); } @@ -932,6 +934,10 @@ namespace MainWindow { ShellExecute(NULL, L"open", L"http://forums.ppsspp.org/", NULL, NULL, SW_SHOWNORMAL); break; + case ID_HELP_GITHUB: + ShellExecute(NULL, L"open", L"https://github.com/hrydgard/ppsspp/", NULL, NULL, SW_SHOWNORMAL); + break; + case ID_HELP_ABOUT: DialogManager::EnableAll(FALSE); DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); diff --git a/Windows/resource.h b/Windows/resource.h index 37e054bcaa..afada24a22 100644 --- a/Windows/resource.h +++ b/Windows/resource.h @@ -331,6 +331,7 @@ #define ID_FILE_DUMPFRAMES 40165 #define ID_FILE_USEFFV1 40166 #define ID_FILE_DUMPAUDIO 40167 +#define ID_HELP_GITHUB 40168 // Dummy option to let the buffered rendering hotkey cycle through all the options. #define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500