Kaydet (Commit) fabd384e authored tarafından Markus Mohrhard's avatar Markus Mohrhard

better message for crash report dialog

Change-Id: I02903cda46809798ec7664cf620c06ea7687e54e
Reviewed-on: https://gerrit.libreoffice.org/26443Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 6d0298f8
...@@ -26,10 +26,14 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent): ...@@ -26,10 +26,14 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent):
get(mpBtnClose, "btn_close"); get(mpBtnClose, "btn_close");
get(mpEditPreUpload, "ed_pre"); get(mpEditPreUpload, "ed_pre");
get(mpEditPostUpload, "ed_post"); get(mpEditPostUpload, "ed_post");
get(mpFtBugReport, "ed_bugreport");
maSuccessMsg = mpEditPostUpload->GetText();
mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl));
mpEditPostUpload->SetReadOnly(true);
} }
CrashReportDialog::~CrashReportDialog() CrashReportDialog::~CrashReportDialog()
...@@ -44,6 +48,7 @@ void CrashReportDialog::dispose() ...@@ -44,6 +48,7 @@ void CrashReportDialog::dispose()
mpBtnClose.clear(); mpBtnClose.clear();
mpEditPreUpload.clear(); mpEditPreUpload.clear();
mpEditPostUpload.clear(); mpEditPostUpload.clear();
mpFtBugReport.clear();
Dialog::dispose(); Dialog::dispose();
} }
...@@ -60,15 +65,26 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) ...@@ -60,15 +65,26 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void)
OUString aCrashID = OUString::createFromAscii(response.c_str()); OUString aCrashID = OUString::createFromAscii(response.c_str());
if (bSuccess) 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 else
mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " Error!"); mpEditPostUpload->SetText("Error!");
mpBtnClose->Show(); mpBtnClose->Show();
mpFtBugReport->Show();
mpEditPreUpload->Hide(); mpEditPreUpload->Hide();
mpEditPostUpload->Show(); mpEditPostUpload->Show();
mpBtnSend->Hide(); mpBtnSend->Hide();
mpBtnSend->Disable();
mpBtnCancel->Hide(); mpBtnCancel->Hide();
mpBtnCancel->Disable();
mpBtnClose->GrabFocus();
this->setOptimalLayoutSize();
} }
else if (pBtn == mpBtnCancel.get()) else if (pBtn == mpBtnCancel.get())
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/vclmedit.hxx>
class CrashReportDialog : public Dialog class CrashReportDialog : public Dialog
{ {
...@@ -31,7 +32,10 @@ private: ...@@ -31,7 +32,10 @@ private:
VclPtr<Button> mpBtnCancel; VclPtr<Button> mpBtnCancel;
VclPtr<Button> mpBtnClose; VclPtr<Button> mpBtnClose;
VclPtr<FixedText> mpEditPreUpload; VclPtr<FixedText> mpEditPreUpload;
VclPtr<FixedText> mpEditPostUpload; VclPtr<VclMultiLineEdit> mpEditPostUpload;
VclPtr<VclMultiLineEdit> mpFtBugReport;
OUString maSuccessMsg;
DECL_LINK_TYPED(BtnHdl, Button*, void); DECL_LINK_TYPED(BtnHdl, Button*, void);
}; };
......
...@@ -62,16 +62,16 @@ ...@@ -62,16 +62,16 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">3</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="ed_pre"> <object class="GtkLabel" id="ed_pre">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">We are sorry but it seems that LibreOffice crashed the last time. <property name="label" translatable="yes">We are sorry but it seems that %PRODUCTNAME crashed the last time.
You can help us fix this issue by sending the crash report to the LibreOffice crash reporting server.</property> You can help us fix this issue by sending the crash report to the %PRODUCTNAME crash reporting server.</property>
<property name="wrap">True</property> <property name="wrap">True</property>
</object> </object>
<packing> <packing>
...@@ -81,14 +81,15 @@ You can help us fix this issue by sending the crash report to the LibreOffice cr ...@@ -81,14 +81,15 @@ You can help us fix this issue by sending the crash report to the LibreOffice cr
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="ed_post"> <object class="GtkTextView" id="ed_post">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">The crash report was successfully uploaded. <property name="label" translatable="yes">The crash report was successfully uploaded.
You can soon find the report on crashreport.libreoffice.org. You can soon find the report on:
The report can be found by</property> crashreport.libreoffice.org/stats/crash_details/%CRASHID</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="selectable">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -96,6 +97,20 @@ The report can be found by</property> ...@@ -96,6 +97,20 @@ The report can be found by</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkTextView" id="ed_bugreport">
<property name="can_focus">False</property>
<property name="label" translatable="yes">Please check the report and if no bug report is connected to the crash report yet, open a new bug report at bugs.documentfoundation.org.
Add detailed instructions on how to reproduce the crash and the shown crash ID into the crash report field.
Thank you for your help in improving LibreOffice.</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment