diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-14 14:17:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-14 21:21:32 +0200 |
commit | 5bb3a7af2040dc11e424cb4f5bce7a4ee30df38d (patch) | |
tree | 9d908eff41c42817f5e9f9705ba30feb52750be4 /svx | |
parent | 232fb7e4f22d2d0af1121fb3eb39be5afd4e8f07 (diff) |
Resolves: tdf#113286 make Crash report link clickable
Change-Id: Ife9f152e7945d40307e1f8b974e08167981acc6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150414
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/crashreportdlg.cxx | 18 | ||||
-rw-r--r-- | svx/source/dialog/crashreportdlg.hxx | 7 | ||||
-rw-r--r-- | svx/uiconfig/ui/crashreportdlg.ui | 188 |
3 files changed, 129 insertions, 84 deletions
diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index d50f64131b11..bd07ddcb1c3d 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -32,12 +32,13 @@ CrashReportDialog::CrashReportDialog(weld::Window* pParent) , mxBtnCancel(m_xBuilder->weld_button("btn_cancel")) , mxBtnClose(m_xBuilder->weld_button("btn_close")) , mxEditPreUpload(m_xBuilder->weld_label("ed_pre")) - , mxEditPostUpload(m_xBuilder->weld_text_view("ed_post")) - , mxFtBugReport(m_xBuilder->weld_text_view("ed_bugreport")) + , mxEditPostUpload(m_xBuilder->weld_label("ed_post")) + , mxLinkButton(m_xBuilder->weld_link_button("linkbutton")) + , mxFtBugReport(m_xBuilder->weld_label("ed_bugreport")) , mxCBSafeMode(m_xBuilder->weld_check_button("check_safemode")) , mxPrivacyPolicyButton(m_xBuilder->weld_link_button("btnPrivacyPolicy")) { - maSuccessMsg = mxEditPostUpload->get_text(); + maLinkTemplate = mxLinkButton->get_uri(); auto nWidth = mxEditPreUpload->get_preferred_size().Width(); nWidth = std::max(nWidth, mxCBSafeMode->get_size_request().Width()); @@ -83,17 +84,20 @@ IMPL_LINK(CrashReportDialog, BtnHdl, weld::Button&, rBtn, void) if (bSuccess) { - OUString aProcessedMessage - = maSuccessMsg.replaceAll("%CRASHID", aCrashID.replaceAll("Crash-ID=", "")); + OUString aProcessedLink + = maLinkTemplate.replaceAll("%CRASHID", aCrashID.replaceAll("Crash-ID=", "")); // vclbuilder seems to replace _ with ~ even in text - mxEditPostUpload->set_text(aProcessedMessage.replaceAll("~", "_")); + mxLinkButton->set_label(aProcessedLink.replaceAll("~", "_")); + mxLinkButton->set_uri(aProcessedLink); } else { - mxEditPostUpload->set_text(aCrashID); + mxEditPostUpload->set_label(aCrashID); } + mxLinkButton->set_visible(bSuccess); + mxBtnClose->show(); mxFtBugReport->show(); mxEditPostUpload->show(); diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx index f9d477f4d6f5..3f2d9cb121c5 100644 --- a/svx/source/dialog/crashreportdlg.hxx +++ b/svx/source/dialog/crashreportdlg.hxx @@ -24,12 +24,13 @@ private: std::unique_ptr<weld::Button> mxBtnCancel; std::unique_ptr<weld::Button> mxBtnClose; std::unique_ptr<weld::Label> mxEditPreUpload; - std::unique_ptr<weld::TextView> mxEditPostUpload; - std::unique_ptr<weld::TextView> mxFtBugReport; + std::unique_ptr<weld::Label> mxEditPostUpload; + std::unique_ptr<weld::LinkButton> mxLinkButton; + std::unique_ptr<weld::Label> mxFtBugReport; std::unique_ptr<weld::CheckButton> mxCBSafeMode; std::unique_ptr<weld::LinkButton> mxPrivacyPolicyButton; - OUString maSuccessMsg; + OUString maLinkTemplate; DECL_LINK(BtnHdl, weld::Button&, void); DECL_STATIC_LINK(CrashReportDialog, InstallLOKNotifierHdl, void*, diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui index 342cc06b51bf..5aa6056366f7 100644 --- a/svx/uiconfig/ui/crashreportdlg.ui +++ b/svx/uiconfig/ui/crashreportdlg.ui @@ -2,16 +2,6 @@ <!-- Generated with glade 3.40.0 --> <interface domain="svx"> <requires lib="gtk+" version="3.20"/> - <object class="GtkTextBuffer" id="textbuffer1"> - <property name="text" translatable="yes" context="crashreportdlg|ed_post">The crash report was successfully uploaded. -You can soon find the report at: -https://crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> - </object> - <object class="GtkTextBuffer" id="textbuffer2"> - <property name="text" translatable="yes" context="crashreportdlg|ed_bugreport">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 %PRODUCTNAME.</property> - </object> <object class="GtkDialog" id="CrashReportDialog"> <property name="can-focus">False</property> <property name="border-width">6</property> @@ -75,18 +65,127 @@ Thank you for your help in improving %PRODUCTNAME.</property> <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">5</property> + <property name="position">2</property> </packing> </child> <child> - <object class="GtkLabel" id="ed_pre"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="crashreportdlg|ed_pre">Unfortunately it seems that %PRODUCTNAME crashed when it was last run. + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="ed_pre"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes" context="crashreportdlg|ed_pre">Unfortunately it seems that %PRODUCTNAME crashed when it was last run. You can help us to fix this issue by sending an anonymous crash report to the %PRODUCTNAME crash reporting server.</property> - <property name="wrap">True</property> - <property name="max-width-chars">80</property> + <property name="wrap">True</property> + <property name="max-width-chars">80</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <!-- n-columns=1 n-rows=2 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="row-spacing">3</property> + <child> + <object class="GtkLinkButton" id="linkbutton"> + <property name="label" translatable="no">https://crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="no-show-all">True</property> + <property name="halign">start</property> + <property name="hexpand">True</property> + <property name="relief">none</property> + <property name="uri">https://crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="ed_post"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes" context="crashreportdlg|ed_post">The crash report was successfully uploaded. You can soon find the report at:</property> + <property name="use-underline">True</property> + <property name="wrap">True</property> + <property name="mnemonic-widget">linkbutton</property> + <property name="max-width-chars">80</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="ed_bugreport"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes" context="crashreportdlg|ed_bugreport">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 %PRODUCTNAME.</property> + <property name="wrap">True</property> + <property name="max-width-chars">80</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_safemode"> + <property name="label" translatable="yes" context="crashreportdlg|check_safemode">Restart %PRODUCTNAME to enter safe mode</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkLinkButton" id="btnPrivacyPolicy"> + <property name="label" translatable="yes" context="crashreportdlg|privacy">Privacy Policy</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="relief">none</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -94,65 +193,6 @@ You can help us to fix this issue by sending an anonymous crash report to the %P <property name="position">0</property> </packing> </child> - <child> - <object class="GtkTextView" id="ed_post"> - <property name="can-focus">False</property> - <property name="valign">center</property> - <property name="editable">False</property> - <property name="wrap-mode">word</property> - <property name="cursor-visible">False</property> - <property name="buffer">textbuffer1</property> - <property name="accepts-tab">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkTextView" id="ed_bugreport"> - <property name="can-focus">False</property> - <property name="editable">False</property> - <property name="wrap-mode">word</property> - <property name="cursor-visible">False</property> - <property name="buffer">textbuffer2</property> - <property name="accepts-tab">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check_safemode"> - <property name="label" translatable="yes" context="crashreportdlg|check_safemode">Restart %PRODUCTNAME to enter safe mode</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkLinkButton" id="btnPrivacyPolicy"> - <property name="label" translatable="yes" context="crashreportdlg|privacy">Privacy Policy</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="relief">none</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> </object> </child> </object> |