Added option to report bug on GH.

This commit is contained in:
Martin Rotter 2014-09-11 08:19:01 +02:00
parent b264e95db4
commit b8819c2d28
5 changed files with 54 additions and 12 deletions

View file

@ -76,7 +76,8 @@ set(FILE_VERSION "2,0,0,1")
set(APP_AUTHOR "Martin Rotter") set(APP_AUTHOR "Martin Rotter")
set(APP_URL "http://bitbucket.org/skunkos/rssguard") set(APP_URL "http://bitbucket.org/skunkos/rssguard")
set(APP_URL_ISSUES "http://bitbucket.org/skunkos/rssguard/issues") 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(APP_EMAIL "rotter.martinos@gmail.com")
set(MINIMUM_QT_VERSION 4.7.3) set(MINIMUM_QT_VERSION 4.7.3)
set(EXE_NAME ${APP_LOW_NAME}) set(EXE_NAME ${APP_LOW_NAME})

View file

@ -31,7 +31,8 @@
#define APP_EMAIL "@APP_EMAIL@" #define APP_EMAIL "@APP_EMAIL@"
#define APP_URL "@APP_URL@" #define APP_URL "@APP_URL@"
#define APP_URL_ISSUES "@APP_URL_ISSUES@" #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_VERSION "@APP_VERSION@"
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@") #define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@")

View file

@ -270,7 +270,8 @@ void FormMain::setupIcons() {
m_ui->m_actionAboutGuard->setIcon(icon_theme_factory->fromTheme("application-about")); 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_actionCheckForUpdates->setIcon(icon_theme_factory->fromTheme("check-for-updates"));
m_ui->m_actionDefragmentDatabase->setIcon(icon_theme_factory->fromTheme("defragment-database")); 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_actionExportFeeds->setIcon(icon_theme_factory->fromTheme("document-export"));
m_ui->m_actionImportFeeds->setIcon(icon_theme_factory->fromTheme("document-import")); m_ui->m_actionImportFeeds->setIcon(icon_theme_factory->fromTheme("document-import"));
@ -394,7 +395,8 @@ void FormMain::createConnections() {
// Menu "Help" connections. // Menu "Help" connections.
connect(m_ui->m_actionAboutGuard, SIGNAL(triggered()), this, SLOT(showAbout())); connect(m_ui->m_actionAboutGuard, SIGNAL(triggered()), this, SLOT(showAbout()));
connect(m_ui->m_actionCheckForUpdates, SIGNAL(triggered()), this, SLOT(showUpdates())); 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. // General connections.
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit())); connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit()));
@ -501,8 +503,24 @@ void FormMain::showUpdates() {
qApp->closeLock()->unlock(); qApp->closeLock()->unlock();
} }
void FormMain::reportABug() { void FormMain::reportABugOnGitHub() {
if (!WebFactory::instance()->openUrlInExternalBrowser(APP_URL_ISSUES_NEW)) { 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()) { if (SystemTrayIcon::isSystemTrayActivated()) {
qApp->trayIcon()->showMessage(tr("Cannot open external browser"), qApp->trayIcon()->showMessage(tr("Cannot open external browser"),
tr("Cannot open external browser. Navigate to application website manually."), tr("Cannot open external browser. Navigate to application website manually."),

View file

@ -113,7 +113,8 @@ class FormMain : public QMainWindow {
void showSettings(); void showSettings();
void showAbout(); void showAbout();
void showUpdates(); void showUpdates();
void reportABug(); void reportABugOnGitHub();
void reportABugOnBitBucket();
private: private:
Ui::FormMain *m_ui; Ui::FormMain *m_ui;

View file

@ -15,7 +15,16 @@
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -39,7 +48,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>979</width> <width>979</width>
<height>20</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="m_menuFile"> <widget class="QMenu" name="m_menuFile">
@ -56,7 +65,8 @@
<string>&amp;Help</string> <string>&amp;Help</string>
</property> </property>
<addaction name="m_actionCheckForUpdates"/> <addaction name="m_actionCheckForUpdates"/>
<addaction name="m_actionReportBug"/> <addaction name="m_actionReportBugGitHub"/>
<addaction name="m_actionReportBugBitBucket"/>
<addaction name="m_actionAboutGuard"/> <addaction name="m_actionAboutGuard"/>
</widget> </widget>
<widget class="QMenu" name="m_menuView"> <widget class="QMenu" name="m_menuView">
@ -500,9 +510,12 @@
<string notr="true">I</string> <string notr="true">I</string>
</property> </property>
</action> </action>
<action name="m_actionReportBug"> <action name="m_actionReportBugGitHub">
<property name="text"> <property name="text">
<string>Report a &amp;bug...</string> <string>Report a &amp;bug (GitHub)...</string>
</property>
<property name="shortcut">
<string notr="true"/>
</property> </property>
</action> </action>
<action name="m_actionSwitchToolBars"> <action name="m_actionSwitchToolBars">
@ -552,6 +565,14 @@
<string>Exports feeds you want to selected file.</string> <string>Exports feeds you want to selected file.</string>
</property> </property>
</action> </action>
<action name="m_actionReportBugBitBucket">
<property name="text">
<string>Report a bug (BitBucket)...</string>
</property>
<property name="shortcut">
<string notr="true"/>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>