Changeset View
Changeset View
Standalone View
Standalone View
src/drkonqidialog.cpp
Show All 33 Lines | |||||
34 | #include "drkonqi.h" | 34 | #include "drkonqi.h" | ||
35 | #include "backtracewidget.h" | 35 | #include "backtracewidget.h" | ||
36 | #include "aboutbugreportingdialog.h" | 36 | #include "aboutbugreportingdialog.h" | ||
37 | #include "crashedapplication.h" | 37 | #include "crashedapplication.h" | ||
38 | #include "debuggermanager.h" | 38 | #include "debuggermanager.h" | ||
39 | #include "debuggerlaunchers.h" | 39 | #include "debuggerlaunchers.h" | ||
40 | #include "drkonqi_globals.h" | 40 | #include "drkonqi_globals.h" | ||
41 | #include "config-drkonqi.h" | 41 | #include "config-drkonqi.h" | ||
42 | #if HAVE_XMLRPCCLIENT | | |||
43 | #include "bugzillaintegration/reportassistantdialog.h" | 42 | #include "bugzillaintegration/reportassistantdialog.h" | ||
44 | #endif | | |||
45 | 43 | | |||
46 | static const char ABOUT_BUG_REPORTING_URL[] = "#aboutbugreporting"; | 44 | static const char ABOUT_BUG_REPORTING_URL[] = "#aboutbugreporting"; | ||
47 | static QString DRKONQI_REPORT_BUG_URL = KDE_BUGZILLA_URL + QStringLiteral("enter_bug.cgi?product=drkonqi&format=guided"); | 45 | static QString DRKONQI_REPORT_BUG_URL = KDE_BUGZILLA_URL + QStringLiteral("enter_bug.cgi?product=drkonqi&format=guided"); | ||
48 | 46 | | |||
49 | DrKonqiDialog::DrKonqiDialog(QWidget * parent) : | 47 | DrKonqiDialog::DrKonqiDialog(QWidget * parent) : | ||
50 | QDialog(parent), | 48 | QDialog(parent), | ||
51 | m_aboutBugReportingDialog(nullptr), | 49 | m_aboutBugReportingDialog(nullptr), | ||
52 | m_backtraceWidget(nullptr) | 50 | m_backtraceWidget(nullptr) | ||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Line(s) | 170 | { | |||
180 | KGuiItem2 reportItem(i18nc("@action:button", "Report &Bug"), | 178 | KGuiItem2 reportItem(i18nc("@action:button", "Report &Bug"), | ||
181 | QIcon::fromTheme(QStringLiteral("tools-report-bug")), | 179 | QIcon::fromTheme(QStringLiteral("tools-report-bug")), | ||
182 | i18nc("@info:tooltip", "Starts the bug report assistant.")); | 180 | i18nc("@info:tooltip", "Starts the bug report assistant.")); | ||
183 | KGuiItem::assign(reportButton, reportItem); | 181 | KGuiItem::assign(reportButton, reportItem); | ||
184 | m_buttonBox->addButton(reportButton, QDialogButtonBox::ActionRole); | 182 | m_buttonBox->addButton(reportButton, QDialogButtonBox::ActionRole); | ||
185 | 183 | | |||
186 | bool enableReportAssistant = !crashedApp->bugReportAddress().isEmpty() && | 184 | bool enableReportAssistant = !crashedApp->bugReportAddress().isEmpty() && | ||
187 | crashedApp->fakeExecutableBaseName() != QLatin1String("drkonqi") && | 185 | crashedApp->fakeExecutableBaseName() != QLatin1String("drkonqi") && | ||
188 | !DrKonqi::isSafer() && | 186 | !DrKonqi::isSafer(); | ||
189 | HAVE_XMLRPCCLIENT; | | |||
190 | reportButton->setEnabled(enableReportAssistant); | 187 | reportButton->setEnabled(enableReportAssistant); | ||
191 | connect(reportButton, &QPushButton::clicked, this, &DrKonqiDialog::startBugReportAssistant); | 188 | connect(reportButton, &QPushButton::clicked, this, &DrKonqiDialog::startBugReportAssistant); | ||
192 | 189 | | |||
193 | //Default debugger button and menu (only for developer mode): User2 | 190 | //Default debugger button and menu (only for developer mode): User2 | ||
194 | DebuggerManager *debuggerManager = DrKonqi::debuggerManager(); | 191 | DebuggerManager *debuggerManager = DrKonqi::debuggerManager(); | ||
195 | m_debugButton = new QPushButton(m_buttonBox); | 192 | m_debugButton = new QPushButton(m_buttonBox); | ||
196 | KGuiItem2 debugItem(i18nc("@action:button this is the debug menu button label which contains the debugging applications", | 193 | KGuiItem2 debugItem(i18nc("@action:button this is the debug menu button label which contains the debugging applications", | ||
197 | "&Debug"), QIcon::fromTheme(QStringLiteral("applications-development")), | 194 | "&Debug"), QIcon::fromTheme(QStringLiteral("applications-development")), | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | |||||
262 | 259 | | |||
263 | void DrKonqiDialog::enableDebugMenu(bool debuggerRunning) | 260 | void DrKonqiDialog::enableDebugMenu(bool debuggerRunning) | ||
264 | { | 261 | { | ||
265 | m_debugButton->setEnabled(!debuggerRunning); | 262 | m_debugButton->setEnabled(!debuggerRunning); | ||
266 | } | 263 | } | ||
267 | 264 | | |||
268 | void DrKonqiDialog::startBugReportAssistant() | 265 | void DrKonqiDialog::startBugReportAssistant() | ||
269 | { | 266 | { | ||
270 | #if HAVE_XMLRPCCLIENT | | |||
271 | ReportAssistantDialog * bugReportAssistant = new ReportAssistantDialog(); | 267 | ReportAssistantDialog * bugReportAssistant = new ReportAssistantDialog(); | ||
272 | bugReportAssistant->show(); | 268 | bugReportAssistant->show(); | ||
273 | connect(bugReportAssistant, &QObject::destroyed, this, &DrKonqiDialog::reject); | 269 | connect(bugReportAssistant, &QObject::destroyed, this, &DrKonqiDialog::reject); | ||
274 | 270 | | |||
275 | hide(); | 271 | hide(); | ||
276 | #endif | | |||
277 | } | 272 | } | ||
278 | 273 | | |||
279 | void DrKonqiDialog::linkActivated(const QString& link) | 274 | void DrKonqiDialog::linkActivated(const QString& link) | ||
280 | { | 275 | { | ||
281 | if (link == QLatin1String(ABOUT_BUG_REPORTING_URL)) { | 276 | if (link == QLatin1String(ABOUT_BUG_REPORTING_URL)) { | ||
282 | showAboutBugReporting(); | 277 | showAboutBugReporting(); | ||
283 | } else if (link == DRKONQI_REPORT_BUG_URL) { | 278 | } else if (link == DRKONQI_REPORT_BUG_URL) { | ||
284 | QDesktopServices::openUrl(QUrl(link)); | 279 | QDesktopServices::openUrl(QUrl(link)); | ||
Show All 21 Lines |