From e509c22863b5184421e710cf8ae81e2ddc961623 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 2 Nov 2016 10:26:39 +0100 Subject: SafeModeDialog: Allow to create zip file from profile Change-Id: I4296d1cf5058be359ffed46745673cf26eba3375 Reviewed-on: https://gerrit.libreoffice.org/30479 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt --- svx/AllLangResTarget_svx.mk | 1 + svx/UIConfig_svx.mk | 1 + svx/source/dialog/SafeMode.src | 17 +++++++ svx/source/dialog/SafeModeDialog.cxx | 65 ++++++++++++++++++++++-- svx/source/dialog/SafeModeDialog.hxx | 4 +- svx/uiconfig/ui/profileexporteddialog.ui | 84 ++++++++++++++++++++++++++++++++ svx/uiconfig/ui/safemodedialog.ui | 40 ++++++++++++--- 7 files changed, 199 insertions(+), 13 deletions(-) create mode 100644 svx/source/dialog/SafeMode.src create mode 100644 svx/uiconfig/ui/profileexporteddialog.ui (limited to 'svx') diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 3a987344f040..8f4be3fbcf7c 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -50,6 +50,7 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\ svx/source/dialog/prtqry.src \ svx/source/dialog/ruler.src \ svx/source/dialog/spacing.src \ + svx/source/dialog/SafeMode.src \ svx/source/dialog/samecontent.src \ svx/source/dialog/sdstring.src \ svx/source/dialog/srchdlg.src \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 65b9bdedd088..5c71dc2240de 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -53,6 +53,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/paralrspacing \ svx/uiconfig/ui/paraulspacing \ svx/uiconfig/ui/passwd \ + svx/uiconfig/ui/profileexporteddialog \ svx/uiconfig/ui/querydeletecontourdialog \ svx/uiconfig/ui/querydeleteobjectdialog \ svx/uiconfig/ui/querydeletethemedialog \ diff --git a/svx/source/dialog/SafeMode.src b/svx/source/dialog/SafeMode.src new file mode 100644 index 000000000000..2de389e72471 --- /dev/null +++ b/svx/source/dialog/SafeMode.src @@ -0,0 +1,17 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +String RID_SVXSTR_SAFEMODE_ZIP_FAILURE +{ + Text[en-US] = "The zip file could not be created."; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index 84d84769c04f..35b135bff628 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -17,8 +17,11 @@ #include #include #include +#include #include #include +#include +#include #include #include @@ -79,14 +82,15 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) get(mpBugLink, "linkbutton_bugs"); get(mpUserProfileLink, "linkbutton_profile"); + get(mpBtnCreateZip, "btn_create_zip"); mpRadioRestore->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); mpRadioConfigure->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); - mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); - mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); - mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); + mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); + mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); + mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); mpCBCheckProfilesafeConfig->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); mpCBCheckProfilesafeExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); @@ -97,6 +101,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) mpCBResetCustomizations->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); mpCBResetWholeUserProfile->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); + mpBtnCreateZip->SetClickHdl(LINK(this, SafeModeDialog, CreateZipBtnHdl)); + // Disable restart btn until some checkbox is active mpBtnRestart->Disable(); @@ -174,6 +180,7 @@ void SafeModeDialog::dispose() mpBugLink.clear(); mpUserProfileLink.clear(); + mpBtnCreateZip.clear(); Dialog::dispose(); } @@ -276,7 +283,7 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void) } } -IMPL_LINK(SafeModeDialog, BtnHdl, Button*, pBtn, void) +IMPL_LINK(SafeModeDialog, DialogBtnHdl, Button*, pBtn, void) { if (pBtn == mpBtnContinue.get()) { @@ -294,6 +301,56 @@ IMPL_LINK(SafeModeDialog, BtnHdl, Button*, pBtn, void) } } +namespace { + class ProfileExportedDialog : public ModalDialog + { + private: + DECL_LINK(OpenHdl, Button*, void); + public: + explicit ProfileExportedDialog(); + }; + + ProfileExportedDialog::ProfileExportedDialog() + : ModalDialog(nullptr, "SafeModeQueryDialog", "svx/ui/profileexporteddialog.ui") + { + get