diff --git a/CMakeLists.txt b/CMakeLists.txt index 2df148a..885788f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/" # Version Information #======================================= set (WEBSITE "glabels.org") +set (BUG_WEBSITE "https://github.com/jimevins/glabels-qt/issues") execute_process( COMMAND git log -1 --format=%h diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index 9ca141c..6679ac9 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -31,6 +31,7 @@ set (glabels_sources PropertiesView.cpp Preview.cpp PreviewOverlayItem.cpp + ReportBugDialog.cpp RollTemplatePath.cpp SelectProductDialog.cpp SimplePreview.cpp @@ -61,6 +62,7 @@ set (glabels_qobject_headers PrintView.h PropertiesView.h Preview.h + ReportBugDialog.h SelectProductDialog.h SimplePreview.h StartupView.h @@ -76,6 +78,7 @@ set (glabels_forms ui/PreferencesDialog.ui ui/PrintView.ui ui/PropertiesView.ui + ui/ReportBugDialog.ui ui/SelectProductDialog.ui ui/StartupView.ui ui/TemplateDesignerIntroPage.ui diff --git a/glabels/Help.cpp b/glabels/Help.cpp index c41ee01..4859e25 100644 --- a/glabels/Help.cpp +++ b/glabels/Help.cpp @@ -21,6 +21,7 @@ #include "Help.h" #include "AboutDialog.h" +#include "ReportBugDialog.h" #include @@ -37,6 +38,16 @@ namespace glabels } + /// + /// Display Help->"Report Bug" Dialog + /// + void Help::displayReportBug( QWidget *parent ) + { + ReportBugDialog dialog( parent ); + dialog.exec(); + } + + /// /// Display Help->About Dialog /// diff --git a/glabels/Help.h b/glabels/Help.h index 21779ad..8a542d3 100644 --- a/glabels/Help.h +++ b/glabels/Help.h @@ -35,6 +35,7 @@ namespace glabels { void displayContents( QWidget *parent ); + void displayReportBug( QWidget *parent ); void displayAbout( QWidget *parent ); } diff --git a/glabels/MainWindow.cpp b/glabels/MainWindow.cpp index 2dcbdaf..0ad77b2 100644 --- a/glabels/MainWindow.cpp +++ b/glabels/MainWindow.cpp @@ -384,14 +384,14 @@ namespace glabels /* View actions */ - viewFileToolBarAction = new QAction( tr("File"), this ); + viewFileToolBarAction = new QAction( tr("Quick Access"), this ); viewFileToolBarAction->setCheckable( true ); - viewFileToolBarAction->setStatusTip( tr("Change visibility of file toolbar in current window") ); + viewFileToolBarAction->setStatusTip( tr("Change visibility of the \"Quick Access\" toolbar in current window") ); connect( viewFileToolBarAction, SIGNAL(toggled(bool)), this, SLOT(viewFileToolBar(bool)) ); viewEditorToolBarAction = new QAction( tr("Editor"), this ); viewEditorToolBarAction->setCheckable( true ); - viewEditorToolBarAction->setStatusTip( tr("Change visibility of editor toolbar in current window") ); + viewEditorToolBarAction->setStatusTip( tr("Change visibility of the \"Editor\" toolbar in current window") ); connect( viewEditorToolBarAction, SIGNAL(toggled(bool)), this, SLOT(viewEditorToolBar(bool)) ); @@ -536,12 +536,16 @@ namespace glabels /* Help actions */ - helpContentsAction = new QAction( tr("&Contents..."), this ); + helpContentsAction = new QAction( tr("&User Manual..."), this ); helpContentsAction->setIcon( QIcon::fromTheme( "help-contents" ) ); helpContentsAction->setShortcut( QKeySequence::HelpContents ); helpContentsAction->setStatusTip( tr("Open gLabels manual") ); connect( helpContentsAction, SIGNAL(triggered()), this, SLOT(helpContents()) ); + helpReportBugAction = new QAction( tr("&Report Bug..."), this ); + helpReportBugAction->setStatusTip( tr("Report a bug to the developers") ); + connect( helpReportBugAction, SIGNAL(triggered()), this, SLOT(helpReportBug()) ); + helpAboutAction = new QAction( tr("&About..."), this ); helpAboutAction->setIcon( QIcon::fromTheme( "help-about" ) ); helpAboutAction->setStatusTip( tr("About gLabels") ); @@ -651,6 +655,7 @@ namespace glabels helpMenu = menuBar()->addMenu( tr("&Help") ); helpMenu->addAction( helpContentsAction ); + helpMenu->addAction( helpReportBugAction ); helpMenu->addAction( helpAboutAction ); contextMenu = new QMenu(); @@ -897,6 +902,7 @@ namespace glabels // Help actions helpContentsAction->setEnabled( true ); + helpReportBugAction->setEnabled( true ); helpAboutAction->setEnabled( true ); // Special context actions @@ -1530,6 +1536,15 @@ namespace glabels } + /// + /// Help->Report Bug Action + /// + void MainWindow::helpReportBug() + { + Help::displayReportBug( this ); + } + + /// /// Help->About Action /// diff --git a/glabels/MainWindow.h b/glabels/MainWindow.h index 6166173..64abe5d 100644 --- a/glabels/MainWindow.h +++ b/glabels/MainWindow.h @@ -143,6 +143,7 @@ namespace glabels void objectsCenterVert(); void helpContents(); + void helpReportBug(); void helpAbout(); void onContextMenuActivate(); @@ -291,6 +292,7 @@ namespace glabels QAction* objectsCenterVertAction; QAction* helpContentsAction; + QAction* helpReportBugAction; QAction* helpAboutAction; QAction* contextCutAction; diff --git a/glabels/ReportBugDialog.cpp b/glabels/ReportBugDialog.cpp new file mode 100644 index 0000000..1c418c9 --- /dev/null +++ b/glabels/ReportBugDialog.cpp @@ -0,0 +1,103 @@ +/* ReportBugDialog.cpp + * + * Copyright (C) 2019 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#include "ReportBugDialog.h" + +#include "model/Version.h" + +#include +#include +#include +#include +#include +#include + + +namespace glabels +{ + + /// + /// Constructor + /// + ReportBugDialog::ReportBugDialog( QWidget *parent ) + : QDialog(parent) + { + setupUi( this ); + + QString title = tr("How to Report a Bug"); + titleLabel->setText( QString( "%1" ).arg( title ) ); + + QString directionsP1 = + tr( "To submit a bug report, click on the button below. This will open a " + "web browser to the gLabels github issue tracking page." ); + + p1Label->setText( QString( "

%1

" ).arg( directionsP1 ) ); + + QString directionsP2 = + tr( "Before submitting a report, look through the existing issues for similar " + "or related bugs. If the issue has already been reported, please consider " + "contributing to its report instead. Otherwise, create a new issue report. " + "Please paste the following information into the issue description." ); + + p2Label->setText( QString( "

%1

" ).arg( directionsP2 ) ); + + infoText->append( "> GLABELS" ); + infoText->append( "> Version: " + model::Version::STRING ); + infoText->append( "> " ); + + infoText->append( "> SYSTEM INFO" ); + infoText->append( "> OS: " + QSysInfo::prettyProductName() ); + infoText->append( "> Kernel: " + QSysInfo::kernelType() + " " + QSysInfo::kernelVersion() ); + infoText->append( "> Build CPU Architecture: " + QSysInfo::buildCpuArchitecture() ); + infoText->append( "> Current CPU Architecture: " + QSysInfo::currentCpuArchitecture() ); + infoText->append( "> " ); + + infoText->append( "> LOCALE" ); + infoText->append( "> Name: " + QLocale::system().name() ); + + QString directionsP3 = + tr( "Be sure to include a detailed description of the problem and how to " + "recreate it. Attach any screenshots and/or example glabels project " + "files that may illustrate the problem." ); + + p3Label->setText( QString( "

%1

" ).arg( directionsP3 ) ); + + } + + + /// + /// "Copy" Button Clicked Slot + /// + void ReportBugDialog::onCopyButtonClicked() + { + infoText->selectAll(); + infoText->copy(); + } + + + /// + /// "Website" Button Clicked Slot + /// + void ReportBugDialog::onWebsiteButtonClicked() + { + QDesktopServices::openUrl( QUrl(model::Version::BUG_WEBSITE) ); + } + +} // namespace glabels diff --git a/glabels/ReportBugDialog.h b/glabels/ReportBugDialog.h new file mode 100644 index 0000000..b0c51ef --- /dev/null +++ b/glabels/ReportBugDialog.h @@ -0,0 +1,58 @@ +/* ReportBugDialog.h + * + * Copyright (C) 2019 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#ifndef ReportBugDialog_h +#define ReportBugDialog_h + + +#include "ui_ReportBugDialog.h" + + +namespace glabels +{ + + /// + /// "Report Bug" Dialog Widget + /// + class ReportBugDialog : public QDialog, public Ui_ReportBugDialog + { + Q_OBJECT + + + ///////////////////////////////// + // Life Cycle + ///////////////////////////////// + public: + ReportBugDialog( QWidget *parent = nullptr ); + + + ///////////////////////////////// + // Slots + ///////////////////////////////// + private slots: + void onCopyButtonClicked(); + void onWebsiteButtonClicked(); + + }; + +} + + +#endif // ReportBugDialog_h diff --git a/glabels/ui/ReportBugDialog.ui b/glabels/ui/ReportBugDialog.ui new file mode 100644 index 0000000..e06816d --- /dev/null +++ b/glabels/ui/ReportBugDialog.ui @@ -0,0 +1,294 @@ + + + ReportBugDialog + + + + 0 + 0 + 586 + 675 + + + + + 0 + 0 + + + + + 575 + 675 + + + + gLabels - Report a Bug + + + + 12 + + + 12 + + + 12 + + + 12 + + + 12 + + + + + Title + + + + + + + pp1 + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Launch Issue Tracker + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + pp2 + + + true + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 400 + 250 + + + + false + + + Qt::NoTextInteraction + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Copy + + + + :/icons/flat/24x24/glabels-edit-copy.svg:/icons/flat/24x24/glabels-edit-copy.svg + + + + 24 + 24 + + + + Ctrl+C + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + pp3 + + + true + + + + + + + Qt::Vertical + + + + 20 + 118 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + accepted() + ReportBugDialog + accept() + + + 230 + 649 + + + 157 + 274 + + + + + buttonBox + rejected() + ReportBugDialog + reject() + + + 298 + 655 + + + 286 + 274 + + + + + websiteButton + clicked() + ReportBugDialog + onWebsiteButtonClicked() + + + 351 + 94 + + + 566 + 103 + + + + + copyButton + clicked() + ReportBugDialog + onCopyButtonClicked() + + + 330 + 437 + + + 514 + 500 + + + + + + onWebsiteButtonClicked() + onCopyButtonClicked() + + diff --git a/model/Version.h.in b/model/Version.h.in index b7edc86..b9cf033 100644 --- a/model/Version.h.in +++ b/model/Version.h.in @@ -30,6 +30,7 @@ namespace glabels namespace Version { const QString WEBSITE = "http://@WEBSITE@"; + const QString BUG_WEBSITE = "@BUG_WEBSITE@"; const int MAJOR = @glabels-qt_VERSION_MAJOR@; const int MINOR = @glabels-qt_VERSION_MINOR@; diff --git a/translations/glabels_C.ts b/translations/glabels_C.ts index c3f29d2..a850f82 100644 --- a/translations/glabels_C.ts +++ b/translations/glabels_C.ts @@ -644,6 +644,25 @@ + + ReportBugDialog + + gLabels - Report a Bug + + + + Copy + + + + &Launch Bug Report Webpage + + + + Ctrl+C + + + SelectProductDialog @@ -1365,22 +1384,10 @@ Configure the application - - File - - - - Change visibility of file toolbar in current window - - Editor - - Change visibility of editor toolbar in current window - - Grid @@ -1597,10 +1604,6 @@ Vertically center objects in label - - &Contents... - - Open gLabels manual @@ -1705,6 +1708,30 @@ Create Barcode + + Quick Access + + + + &Report Bug... + + + + Report a bug to the developers + + + + Change visibility of the "Quick Access" toolbar in current window + + + + Change visibility of the "Editor" toolbar in current window + + + + &User Manual... + + glabels::MergeView @@ -1906,6 +1933,25 @@ + + glabels::ReportBugDialog + + How to Report a Bug + + + + To submit a bug report, click on the button below. This will open a web browser to the gLabels github issue tracking page. + + + + Be sure to include a detailed description of the problem and how to recreate it. Attach any screenshots and/or example glabels project files that may illustrate the problem. + + + + Before submitting a report, look through the existing issues for similar or related bugs. If the issue has already been reported, please consider contributing to its report instead. Otherwise, create a new issue report. Please paste the following information into the issue description. + + + glabels::SimplePreview