From 660b91b07788077cfee9ba309d45db6819c00781 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 3 Jun 2016 13:26:46 +0200 Subject: report the crash id back to the user Change-Id: I5cc1e698294a5674d691529af8cc14e4cd87a711 Reviewed-on: https://gerrit.libreoffice.org/25865 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- svx/source/dialog/crashreportdlg.cxx | 29 ++++++++++++++++++++++++----- svx/source/dialog/crashreportdlg.hxx | 5 +++++ 2 files changed, 29 insertions(+), 5 deletions(-) (limited to 'svx/source/dialog') diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 511199b4bf5f..00dcedd0f76e 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -23,9 +23,13 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent): { get(mpBtnSend, "btn_send"); get(mpBtnCancel, "btn_cancel"); + get(mpBtnClose, "btn_close"); + get(mpEditPreUpload, "ed_pre"); + get(mpEditPostUpload, "ed_post"); mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); + mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); } CrashReportDialog::~CrashReportDialog() @@ -37,6 +41,9 @@ void CrashReportDialog::dispose() { mpBtnSend.clear(); mpBtnCancel.clear(); + mpBtnClose.clear(); + mpEditPreUpload.clear(); + mpEditPostUpload.clear(); Dialog::dispose(); } @@ -59,17 +66,29 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) { std::string ini_path = CrashReporter::getIniFileName(); - readConfig(ini_path); - // TODO: moggi: return the id for the user to look it up - Close(); + std::string response; + bool bSuccess = readConfig(ini_path, response); + + OUString aCrashID = OUString::createFromAscii(response.c_str()); + + if (bSuccess) + mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " " + aCrashID); + else + mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " Error!"); + + mpBtnClose->Show(); + mpEditPreUpload->Hide(); + mpEditPostUpload->Show(); + mpBtnSend->Hide(); + mpBtnCancel->Hide(); } else if (pBtn == mpBtnCancel.get()) { Close(); } - else + else if (pBtn == mpBtnClose.get()) { - assert(false); + Close(); } } diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx index d1304a1063e4..f090af1211a6 100644 --- a/svx/source/dialog/crashreportdlg.hxx +++ b/svx/source/dialog/crashreportdlg.hxx @@ -12,6 +12,8 @@ #include #include +#include +#include class CrashReportDialog : public Dialog { @@ -27,6 +29,9 @@ private: VclPtr