From b8819c2d284d57c1be761f59a56819d8348d962b Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 11 Sep 2014 08:19:01 +0200 Subject: [PATCH] Added option to report bug on GH. --- CMakeLists.txt | 3 ++- src/definitions/definitions.h.in | 3 ++- src/gui/formmain.cpp | 26 ++++++++++++++++++++++---- src/gui/formmain.h | 3 ++- src/gui/formmain.ui | 31 ++++++++++++++++++++++++++----- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba30d50de..aad1d82bf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,8 @@ set(FILE_VERSION "2,0,0,1") set(APP_AUTHOR "Martin Rotter") set(APP_URL "http://bitbucket.org/skunkos/rssguard") set(APP_URL_ISSUES "http://bitbucket.org/skunkos/rssguard/issues") -set(APP_URL_ISSUES_NEW "http://bitbucket.org/skunkos/rssguard/issues/new") +set(APP_URL_ISSUES_NEW_GITHUB "https://github.com/martinrotter/rssguard/issues/new") +set(APP_URL_ISSUES_NEW_BITBUCKET "http://bitbucket.org/skunkos/rssguard/issues/new") set(APP_EMAIL "rotter.martinos@gmail.com") set(MINIMUM_QT_VERSION 4.7.3) set(EXE_NAME ${APP_LOW_NAME}) diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index f9e056b23..c572cacad 100755 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -31,7 +31,8 @@ #define APP_EMAIL "@APP_EMAIL@" #define APP_URL "@APP_URL@" #define APP_URL_ISSUES "@APP_URL_ISSUES@" -#define APP_URL_ISSUES_NEW "@APP_URL_ISSUES_NEW@" +#define APP_URL_ISSUES_NEW_GITHUB "@APP_URL_ISSUES_NEW_GITHUB@" +#define APP_URL_ISSUES_NEW_BITBUCKET "@APP_URL_ISSUES_NEW_BITBUCKET@" #define APP_VERSION "@APP_VERSION@" #define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@") diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp index ad33c4e5d..72fdcc556 100755 --- a/src/gui/formmain.cpp +++ b/src/gui/formmain.cpp @@ -270,7 +270,8 @@ void FormMain::setupIcons() { m_ui->m_actionAboutGuard->setIcon(icon_theme_factory->fromTheme("application-about")); m_ui->m_actionCheckForUpdates->setIcon(icon_theme_factory->fromTheme("check-for-updates")); m_ui->m_actionDefragmentDatabase->setIcon(icon_theme_factory->fromTheme("defragment-database")); - m_ui->m_actionReportBug->setIcon(icon_theme_factory->fromTheme("application-report-bug")); + m_ui->m_actionReportBugGitHub->setIcon(icon_theme_factory->fromTheme("application-report-bug")); + m_ui->m_actionReportBugBitBucket->setIcon(icon_theme_factory->fromTheme("application-report-bug")); m_ui->m_actionExportFeeds->setIcon(icon_theme_factory->fromTheme("document-export")); m_ui->m_actionImportFeeds->setIcon(icon_theme_factory->fromTheme("document-import")); @@ -394,7 +395,8 @@ void FormMain::createConnections() { // Menu "Help" connections. connect(m_ui->m_actionAboutGuard, SIGNAL(triggered()), this, SLOT(showAbout())); connect(m_ui->m_actionCheckForUpdates, SIGNAL(triggered()), this, SLOT(showUpdates())); - connect(m_ui->m_actionReportBug, SIGNAL(triggered()), this, SLOT(reportABug())); + connect(m_ui->m_actionReportBugGitHub, SIGNAL(triggered()), this, SLOT(reportABugOnGitHub())); + connect(m_ui->m_actionReportBugBitBucket, SIGNAL(triggered()), this, SLOT(reportABugOnBitBucket())); // General connections. connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit())); @@ -501,8 +503,24 @@ void FormMain::showUpdates() { qApp->closeLock()->unlock(); } -void FormMain::reportABug() { - if (!WebFactory::instance()->openUrlInExternalBrowser(APP_URL_ISSUES_NEW)) { +void FormMain::reportABugOnGitHub() { + if (!WebFactory::instance()->openUrlInExternalBrowser(APP_URL_ISSUES_NEW_GITHUB)) { + if (SystemTrayIcon::isSystemTrayActivated()) { + qApp->trayIcon()->showMessage(tr("Cannot open external browser"), + tr("Cannot open external browser. Navigate to application website manually."), + QSystemTrayIcon::Warning); + } + else { + MessageBox::show(this, + QMessageBox::Warning, + tr("Cannot open external browser"), + tr("Cannot open external browser. Navigate to application website manually.")); + } + } +} + +void FormMain::reportABugOnBitBucket() { + if (!WebFactory::instance()->openUrlInExternalBrowser(APP_URL_ISSUES_NEW_BITBUCKET)) { if (SystemTrayIcon::isSystemTrayActivated()) { qApp->trayIcon()->showMessage(tr("Cannot open external browser"), tr("Cannot open external browser. Navigate to application website manually."), diff --git a/src/gui/formmain.h b/src/gui/formmain.h index 956c0a6ce..b4ee7f9a1 100755 --- a/src/gui/formmain.h +++ b/src/gui/formmain.h @@ -113,7 +113,8 @@ class FormMain : public QMainWindow { void showSettings(); void showAbout(); void showUpdates(); - void reportABug(); + void reportABugOnGitHub(); + void reportABugOnBitBucket(); private: Ui::FormMain *m_ui; diff --git a/src/gui/formmain.ui b/src/gui/formmain.ui index f51ef7e3e..ea69d0823 100755 --- a/src/gui/formmain.ui +++ b/src/gui/formmain.ui @@ -15,7 +15,16 @@ - + + 0 + + + 0 + + + 0 + + 0 @@ -39,7 +48,7 @@ 0 0 979 - 20 + 21 @@ -56,7 +65,8 @@ &Help - + + @@ -500,9 +510,12 @@ I - + - Report a &bug... + Report a &bug (GitHub)... + + + @@ -552,6 +565,14 @@ Exports feeds you want to selected file. + + + Report a bug (BitBucket)... + + + + +