diff --git a/src/bugzillaintegration/reportassistantdialog.h b/src/bugzillaintegration/reportassistantdialog.h --- a/src/bugzillaintegration/reportassistantdialog.h +++ b/src/bugzillaintegration/reportassistantdialog.h @@ -1,6 +1,7 @@ /******************************************************************* * reportassistantdialog.h * Copyright 2009 Dario Andres Rodriguez +* Copyright 2019 Harald Sitter * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,6 +21,7 @@ #ifndef REPORTASSISTANTDIALOG__H #define REPORTASSISTANTDIALOG__H +#include #include #include @@ -41,6 +43,8 @@ return m_reportInterface; } + void setAboutToSend(bool aboutTo); + private Q_SLOTS: void currentPageChanged_slot(KPageWidgetItem *, KPageWidgetItem *); @@ -68,6 +72,9 @@ ReportInterface * m_reportInterface = nullptr; bool m_canClose; + + QIcon m_nextButtonIconCache; + QString m_nextButtonTextCache; }; #endif diff --git a/src/bugzillaintegration/reportassistantdialog.cpp b/src/bugzillaintegration/reportassistantdialog.cpp --- a/src/bugzillaintegration/reportassistantdialog.cpp +++ b/src/bugzillaintegration/reportassistantdialog.cpp @@ -1,6 +1,7 @@ /******************************************************************* * reportassistantdialog.cpp * Copyright 2009,2010 Dario Andres Rodriguez +* Copyright 2019 Harald Sitter * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -174,6 +175,21 @@ { } +void ReportAssistantDialog::setAboutToSend(bool aboutTo) +{ + if (aboutTo) { + m_nextButtonIconCache = nextButton()->icon(); + m_nextButtonTextCache = nextButton()->text(); + nextButton()->setIcon(QIcon::fromTheme(QStringLiteral("document-send"))); + nextButton()->setText(i18nc("@action button to submit report", "Submit")); + return; + } + nextButton()->setIcon(m_nextButtonIconCache); + nextButton()->setText(m_nextButtonTextCache); + m_nextButtonIconCache = QIcon(); + m_nextButtonTextCache = QString(); +} + void ReportAssistantDialog::connectSignals(ReportAssistantPage * page) { //React to the changes in the assistant pages diff --git a/src/bugzillaintegration/reportassistantpages_bugzilla.h b/src/bugzillaintegration/reportassistantpages_bugzilla.h --- a/src/bugzillaintegration/reportassistantpages_bugzilla.h +++ b/src/bugzillaintegration/reportassistantpages_bugzilla.h @@ -1,6 +1,7 @@ /******************************************************************* * reportassistantpages_bugzilla.h * Copyright 2009, 2011 Dario Andres Rodriguez +* Copyright 2019 Harald Sitter * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -113,6 +114,7 @@ explicit BugzillaPreviewPage(ReportAssistantDialog *); void aboutToShow() override; + void aboutToHide() override; private: Ui::AssistantPageBugzillaPreview ui; diff --git a/src/bugzillaintegration/reportassistantpages_bugzilla.cpp b/src/bugzillaintegration/reportassistantpages_bugzilla.cpp --- a/src/bugzillaintegration/reportassistantpages_bugzilla.cpp +++ b/src/bugzillaintegration/reportassistantpages_bugzilla.cpp @@ -1,6 +1,7 @@ /******************************************************************* * reportassistantpages_bugzilla.cpp * Copyright 2009, 2010, 2011 Dario Andres Rodriguez +* Copyright 2019 Harald Sitter * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -620,6 +621,12 @@ void BugzillaPreviewPage::aboutToShow() { ui.m_previewEdit->setText(reportInterface()->generateReportFullText(true)); + assistant()->setAboutToSend(true); +} + +void BugzillaPreviewPage::aboutToHide() +{ + assistant()->setAboutToSend(false); } //END BugzillaPreviewPage