summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-10-10 21:55:10 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-10-11 08:55:08 +0200
commit5daafc88ca0d8fd06080a6fe2f7487188953ebe3 (patch)
tree2db2caccfc025ccda1492ad772c2999d28ba7180
parent6cded5c853defdda928036d11ae88fa3cf19a79a (diff)
Allow entering safemode after crash
Change-Id: Id12d3c10714b7ce5722c2270e9e897db63bedcf2
-rw-r--r--svx/source/dialog/crashreportdlg.cxx15
-rw-r--r--svx/source/dialog/crashreportdlg.hxx1
-rw-r--r--svx/uiconfig/ui/crashreportdlg.ui15
3 files changed, 31 insertions, 0 deletions
diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx
index d31a8636b44e..bbac21157dfb 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -15,8 +15,12 @@
#include <rtl/bootstrap.hxx>
#include <desktop/crashreport.hxx>
#include <desktop/minidump.hxx>
+#include <comphelper/processfactory.hxx>
#include <osl/file.hxx>
+#include <com/sun/star/task/OfficeRestartManager.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
CrashReportDialog::CrashReportDialog(vcl::Window* pParent):
Dialog(pParent, "CrashReportDialog",
"svx/ui/crashreportdlg.ui")
@@ -27,6 +31,7 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent):
get(mpEditPreUpload, "ed_pre");
get(mpEditPostUpload, "ed_post");
get(mpFtBugReport, "ed_bugreport");
+ get(mpCBSafeMode, "check_safemode");
maSuccessMsg = mpEditPostUpload->GetText();
@@ -49,6 +54,7 @@ void CrashReportDialog::dispose()
mpEditPreUpload.clear();
mpEditPostUpload.clear();
mpFtBugReport.clear();
+ mpCBSafeMode.clear();
Dialog::dispose();
}
@@ -94,6 +100,15 @@ IMPL_LINK(CrashReportDialog, BtnHdl, Button*, pBtn, void)
{
Close();
}
+
+ // Check whether to go to safe mode
+ if (mpCBSafeMode->IsChecked())
+ {
+ //TODO: Actually set the safe mode, currently it's only restarting
+ css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ css::task::OfficeRestartManager::get(xContext)->requestRestart(
+ css::uno::Reference< css::task::XInteractionHandler >());
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx
index 602d706d7a8e..ecdd44553eb7 100644
--- a/svx/source/dialog/crashreportdlg.hxx
+++ b/svx/source/dialog/crashreportdlg.hxx
@@ -34,6 +34,7 @@ private:
VclPtr<FixedText> mpEditPreUpload;
VclPtr<VclMultiLineEdit> mpEditPostUpload;
VclPtr<VclMultiLineEdit> mpFtBugReport;
+ VclPtr<CheckBox> mpCBSafeMode;
OUString maSuccessMsg;
diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui
index 9dd35f672229..4b8b2298a37e 100644
--- a/svx/uiconfig/ui/crashreportdlg.ui
+++ b/svx/uiconfig/ui/crashreportdlg.ui
@@ -111,6 +111,21 @@ Thank you for your help in improving %PRODUCTNAME.</property>
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="check_safemode">
+ <property name="label" translatable="yes">Restart LibreOffice to enter Safe Mode</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</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>
</object>
</child>
</object>