[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - svx/source svx/uiconfig

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Jun 20 00:41:52 UTC 2016


 svx/source/dialog/crashreportdlg.cxx |   20 ++++++++++++++++++--
 svx/source/dialog/crashreportdlg.hxx |    6 +++++-
 svx/uiconfig/ui/crashreportdlg.ui    |   27 +++++++++++++++++++++------
 3 files changed, 44 insertions(+), 9 deletions(-)

New commits:
commit 505b83487ff82e400d1467a3ee0c6112506d7a3f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jun 17 18:49:26 2016 +0200

    better message for crash report dialog
    
    Change-Id: I02903cda46809798ec7664cf620c06ea7687e54e
    Reviewed-on: https://gerrit.libreoffice.org/26443
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit fabd384e1596d8a5d8753985cca9a4c14c49a1fc)
    Reviewed-on: https://gerrit.libreoffice.org/26488

diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx
index 973a593..acb3ccf 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 f090af1..3f3cb40 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);
 };
diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui
index d483d61..240b334 100644
--- a/svx/uiconfig/ui/crashreportdlg.ui
+++ b/svx/uiconfig/ui/crashreportdlg.ui
@@ -62,16 +62,16 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">3</property>
+            <property name="position">4</property>
           </packing>
         </child>
         <child>
           <object class="GtkLabel" id="ed_pre">
             <property name="visible">True</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>
           </object>
           <packing>
@@ -81,14 +81,15 @@ You can help us fix this issue by sending the crash report to the LibreOffice cr
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="ed_post">
+          <object class="GtkTextView" id="ed_post">
             <property name="can_focus">False</property>
             <property name="valign">center</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">The crash report was successfully uploaded.
-You can soon find the report on crashreport.libreoffice.org.
-The report can be found by</property>
+You can soon find the report on:
+crashreport.libreoffice.org/stats/crash_details/%CRASHID</property>
             <property name="wrap">True</property>
+            <property name="selectable">True</property>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -96,6 +97,20 @@ The report can be found by</property>
             <property name="position">1</property>
           </packing>
         </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>
     </child>
   </object>


More information about the Libreoffice-commits mailing list