summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-17 18:49:26 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 14:23:28 +0000
commitfabd384e1596d8a5d8753985cca9a4c14c49a1fc (patch)
treeb2eeed1598685e67256724ebff839f395a2fbd30 /svx/source
parent6d0298f8049cf4a3565a5563d16095b8da317bf0 (diff)
better message for crash report dialog
Change-Id: I02903cda46809798ec7664cf620c06ea7687e54e Reviewed-on: https://gerrit.libreoffice.org/26443 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/crashreportdlg.cxx20
-rw-r--r--svx/source/dialog/crashreportdlg.hxx6
2 files changed, 23 insertions, 3 deletions
diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx
index 8cb5c29f9324..4186892d7759 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -26,10 +26,14 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent):
get(mpBtnClose, "btn_close");
get(mpEditPreUpload, "ed_pre");
get(mpEditPostUpload, "ed_post");
+ get(mpFtBugReport, "ed_bugreport");
+
+ maSuccessMsg = mpEditPostUpload->GetText();
mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
+ mpEditPostUpload->SetReadOnly(true);
}
CrashReportDialog::~CrashReportDialog()
@@ -44,6 +48,7 @@ void CrashReportDialog::dispose()
mpBtnClose.clear();
mpEditPreUpload.clear();
mpEditPostUpload.clear();
+ mpFtBugReport.clear();
Dialog::dispose();
}
@@ -60,15 +65,26 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void)
OUString aCrashID = OUString::createFromAscii(response.c_str());
if (bSuccess)
- mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " " + aCrashID);
+ {
+ OUString aProcessedMessage = maSuccessMsg.replaceAll("%CRASHID", aCrashID.replaceAll("Crash-ID=",""));
+
+ // vclbuilder seems to replace _ with ~ even in text
+ mpEditPostUpload->SetText(aProcessedMessage.replaceAll("~", "_"));
+ }
else
- mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " Error!");
+ mpEditPostUpload->SetText("Error!");
mpBtnClose->Show();
+ mpFtBugReport->Show();
mpEditPreUpload->Hide();
mpEditPostUpload->Show();
mpBtnSend->Hide();
+ mpBtnSend->Disable();
mpBtnCancel->Hide();
+ mpBtnCancel->Disable();
+ mpBtnClose->GrabFocus();
+
+ this->setOptimalLayoutSize();
}
else if (pBtn == mpBtnCancel.get())
{
diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx
index f090af1211a6..3f3cb402281a 100644
--- a/svx/source/dialog/crashreportdlg.hxx
+++ b/svx/source/dialog/crashreportdlg.hxx
@@ -14,6 +14,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
+#include <vcl/vclmedit.hxx>
class CrashReportDialog : public Dialog
{
@@ -31,7 +32,10 @@ private:
VclPtr<Button> mpBtnCancel;
VclPtr<Button> mpBtnClose;
VclPtr<FixedText> mpEditPreUpload;
- VclPtr<FixedText> mpEditPostUpload;
+ VclPtr<VclMultiLineEdit> mpEditPostUpload;
+ VclPtr<VclMultiLineEdit> mpFtBugReport;
+
+ OUString maSuccessMsg;
DECL_LINK_TYPED(BtnHdl, Button*, void);
};