mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-10 06:11:54 +10:00
crash: allow overriding crash reporter url
This commit is contained in:
parent
e32b909354
commit
4b77936c80
5 changed files with 22 additions and 16 deletions
|
|
@ -13,4 +13,5 @@
|
|||
#define COMPILER "@CMAKE_CXX_COMPILER_ID@ (@CMAKE_CXX_COMPILER_VERSION@)"
|
||||
#define COMPILE_FLAGS "@CMAKE_CXX_FLAGS@"
|
||||
#define BUILD_CONFIGURATION "@QS_BUILD_OPTIONS@"
|
||||
#define CRASHREPORT_URL "@CRASHREPORT_URL@"
|
||||
// NOLINTEND
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <qapplication.h>
|
||||
#include <qboxlayout.h>
|
||||
#include <qconfig.h>
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qdesktopservices.h>
|
||||
#include <qfont.h>
|
||||
#include <qfontinfo.h>
|
||||
|
|
@ -12,11 +13,22 @@
|
|||
#include <qnamespace.h>
|
||||
#include <qobject.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qtenvironmentvariables.h>
|
||||
#include <qtversion.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
#include "build.hpp"
|
||||
|
||||
namespace {
|
||||
QString crashreportUrl() {
|
||||
if (auto url = qEnvironmentVariable("QS_CRASHREPORT_URL"); !url.isEmpty()) {
|
||||
return url;
|
||||
}
|
||||
|
||||
return CRASHREPORT_URL;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
class ReportLabel: public QWidget {
|
||||
public:
|
||||
ReportLabel(const QString& label, const QString& content, QWidget* parent): QWidget(parent) {
|
||||
|
|
@ -67,22 +79,16 @@ CrashReporterGui::CrashReporterGui(QString reportFolder, int pid)
|
|||
|
||||
if (qtVersionMatches) {
|
||||
mainLayout->addWidget(
|
||||
new QLabel("Please open a bug report for this issue via github or email.")
|
||||
new QLabel("Please open a bug report for this issue on the issue tracker.")
|
||||
);
|
||||
} else {
|
||||
mainLayout->addWidget(new QLabel(
|
||||
"Please rebuild Quickshell against the current Qt version.\n"
|
||||
"If this does not solve the problem, please open a bug report via github or email."
|
||||
"If this does not solve the problem, please open a bug report on the issue tracker."
|
||||
));
|
||||
}
|
||||
|
||||
mainLayout->addWidget(new ReportLabel(
|
||||
"Github:",
|
||||
"https://github.com/quickshell-mirror/quickshell/issues/new?template=crash2.yml",
|
||||
this
|
||||
));
|
||||
|
||||
mainLayout->addWidget(new ReportLabel("Email:", "quickshell-bugs@outfoxxed.me", this));
|
||||
mainLayout->addWidget(new ReportLabel("Tracker:", crashreportUrl(), this));
|
||||
|
||||
auto* buttons = new QWidget(this);
|
||||
buttons->setMinimumWidth(900);
|
||||
|
|
@ -112,10 +118,5 @@ void CrashReporterGui::openFolder() {
|
|||
QDesktopServices::openUrl(QUrl::fromLocalFile(this->reportFolder));
|
||||
}
|
||||
|
||||
void CrashReporterGui::openReportUrl() {
|
||||
QDesktopServices::openUrl(
|
||||
QUrl("https://github.com/outfoxxed/quickshell/issues/new?template=crash2.yml")
|
||||
);
|
||||
}
|
||||
|
||||
void CrashReporterGui::openReportUrl() { QDesktopServices::openUrl(QUrl(crashreportUrl())); }
|
||||
void CrashReporterGui::cancel() { QApplication::quit(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue