|
12 | 12 | #include "windows/editor/editordock.h" |
13 | 13 | #include "windows/editor/editortab.h" |
14 | 14 |
|
| 15 | +#include <QDesktopServices> |
15 | 16 | #include <QFileInfo> |
16 | 17 | #include <QMessageBox> |
17 | 18 | #include <QMetaObject> |
18 | 19 | #include <QProcessEnvironment> |
| 20 | +#include <QSysInfo> |
19 | 21 | #include <QTextDocument> |
| 22 | +#include <QUrl> |
| 23 | +#include <QUrlQuery> |
20 | 24 | #include <QtWidgets> |
21 | 25 | #include <qactiongroup.h> |
22 | 26 | #include <qwidget.h> |
23 | 27 |
|
| 28 | + |
| 29 | + |
24 | 30 | LOG_CATEGORY("gui.mainwindow"); |
25 | 31 |
|
26 | 32 | #ifdef __EMSCRIPTEN__ |
@@ -183,6 +189,39 @@ MainWindow::MainWindow(QSettings *settings, QWidget *parent) |
183 | 189 | connect(ui->actionCore_View_show, &QAction::triggered, this, &MainWindow::show_hide_coreview); |
184 | 190 | connect(ui->actionMessages, &QAction::triggered, this, &MainWindow::show_messages); |
185 | 191 | connect(ui->actionResetWindows, &QAction::triggered, this, &MainWindow::reset_windows); |
| 192 | + connect(ui->actionUserManual, &QAction::triggered, this, [] { |
| 193 | + QDesktopServices::openUrl(QUrl(APP_USER_MANUAL_URL)); |
| 194 | + }); |
| 195 | + connect(ui->actionReportProblem, &QAction::triggered, this, [] { |
| 196 | + const QString version = QString::fromUtf8(APP_VERSION); |
| 197 | + const QString qtVersion = QString::fromUtf8(qVersion()); |
| 198 | + const QString os = QSysInfo::prettyProductName(); |
| 199 | + const QString arch = QSysInfo::currentCpuArchitecture(); |
| 200 | + |
| 201 | + QString body; |
| 202 | + body += "## Describe the problem\n"; |
| 203 | + body += "\n"; |
| 204 | + body += "## Steps to reproduce\n"; |
| 205 | + body += "1.\n"; |
| 206 | + body += "\n"; |
| 207 | + body += "## Expected behavior\n"; |
| 208 | + body += "\n"; |
| 209 | + body += "## Actual behavior\n"; |
| 210 | + body += "\n"; |
| 211 | + body += "## Environment\n"; |
| 212 | + body += "- QtRVSim version: " + version + "\n"; |
| 213 | + body += "- OS: " + os + "\n"; |
| 214 | + body += "- Arch: " + arch + "\n"; |
| 215 | + body += "- Qt: " + qtVersion + "\n"; |
| 216 | + |
| 217 | + QUrl url(QString::fromUtf8(APP_REPORT_PROBLEM_URL)); |
| 218 | + QUrlQuery query; |
| 219 | + query.addQueryItem("title", "Bug report"); |
| 220 | + query.addQueryItem("body", body); |
| 221 | + url.setQuery(query); |
| 222 | + |
| 223 | + QDesktopServices::openUrl(url); |
| 224 | + }); |
186 | 225 | connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::about_program); |
187 | 226 | connect(ui->actionAboutQt, &QAction::triggered, this, &MainWindow::about_qt); |
188 | 227 | connect(ui->ips1, &QAction::toggled, this, &MainWindow::set_speed); |
|
0 commit comments