desktop/source/app/app.cxx | 21 +++ desktop/source/app/cmdlineargs.cxx | 5 desktop/source/app/cmdlineargs.hxx | 2 desktop/source/app/cmdlinehelp.cxx | 2 extras/source/templates/presnt/Alizarin.otp |binary extras/source/templates/presnt/Focus.otp |binary extras/source/templates/presnt/Pencil.otp |binary extras/source/templates/presnt/Vivid.otp |binary svx/Library_svx.mk | 2 svx/UIConfig_svx.mk | 1 svx/qa/unit/data/svx-dialogs-test.txt | 2 svx/source/dialog/SafeModeDialog.cxx | 65 ++++++++++++ svx/source/dialog/SafeModeDialog.hxx | 44 ++++++++ svx/source/dialog/SafeModeUI.cxx | 99 ++++++++++++++++++ svx/uiconfig/ui/safemodedialog.ui | 148 ++++++++++++++++++++++++++++ svx/util/svx.component | 4 16 files changed, 394 insertions(+), 1 deletion(-)
New commits: commit 842873d37c2716ced5674ebaadfb2fae9620632d Author: Francisco Adrián Sánchez <[email protected]> Date: Fri Oct 7 18:51:41 2016 +0200 Improve 'Pencil' template Change-Id: Ic4590752354376e9dcd534560918b3463c156411 diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp index 1ef4d13..549714b 100644 Binary files a/extras/source/templates/presnt/Pencil.otp and b/extras/source/templates/presnt/Pencil.otp differ commit 2d997a78fabcc45937e235a92394bca71cc53f90 Author: Francisco Adrián Sánchez <[email protected]> Date: Fri Oct 7 18:51:26 2016 +0200 Improve 'Focus' template Change-Id: I00ded55d07dc1d0e4abf26a53ccc499cf4db6dac diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp index 7d52177..18b3eca 100644 Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ commit ef92954906fe3d4658876fcccb4fd7e239b5185f Author: Francisco Adrián Sánchez <[email protected]> Date: Fri Oct 7 18:51:00 2016 +0200 Improve 'Alizarin' template Change-Id: Ia19f8df552e737b936cbf234b8f91f2846486c1c diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp index f47e4eb..dcd05bb 100644 Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ commit f9a427680f59be8591b5e5d750ce0189a6becd54 Author: Samuel Mehrbrodt <[email protected]> Date: Fri Oct 7 18:19:25 2016 +0200 Show dialog when starting in safe mode Change-Id: Ie4b5f5b7309735dfa844bbaba9cb2763a3de3dc1 diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3456db2..bb836d2 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1056,6 +1056,22 @@ void handleCrashReport() } #endif +void handleSafeMode() +{ + static const char SERVICENAME_SAFEMODE[] = "com.sun.star.comp.svx.SafeModeUI"; + + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + + Reference< css::frame::XSynchronousDispatch > xSafeModeUI( + xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_SAFEMODE, xContext), + css::uno::UNO_QUERY_THROW); + + css::util::URL aURL; + css::uno::Any aRet = xSafeModeUI->dispatchWithReturnValue(aURL, css::uno::Sequence< css::beans::PropertyValue >()); + bool bRet = false; + aRet >>= bRet; +} + /** @short check if recovery must be started or not. @param bCrashed [boolean ... out!] @@ -2029,6 +2045,11 @@ void Desktop::OpenClients() // need some time, where the user won't see any results and wait for finishing the office startup... bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless() ); + // Enter safe mode if requested + if (rArgs.IsSafeMode()) + handleSafeMode(); + + #if HAVE_FEATURE_BREAKPAD if (crashReportInfoExists()) handleCrashReport(); diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index e564af8..2c91b13 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -146,6 +146,8 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/dialog/rlrcitem \ svx/source/dialog/rubydialog \ svx/source/dialog/rulritem \ + svx/source/dialog/SafeModeDialog \ + svx/source/dialog/SafeModeUI \ svx/source/dialog/SpellDialogChildWindow \ svx/source/dialog/srchctrl \ svx/source/dialog/srchdlg \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index bd9c6d8..65b9bde 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -64,6 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/redlinecontrol \ svx/uiconfig/ui/redlinefilterpage \ svx/uiconfig/ui/redlineviewpage \ + svx/uiconfig/ui/safemodedialog \ svx/uiconfig/ui/savemodifieddialog \ svx/uiconfig/ui/sidebararea \ svx/uiconfig/ui/sidebarshadow \ diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx new file mode 100644 index 0000000..c9f6e4c --- /dev/null +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -0,0 +1,65 @@ +/* -*- 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 "SafeModeDialog.hxx" + +#include <config_folders.h> + +#include <rtl/bootstrap.hxx> +#include <osl/file.hxx> + +SafeModeDialog::SafeModeDialog(vcl::Window* pParent): + Dialog(pParent, "SafeModeDialog", "svx/ui/safemodedialog.ui") +{ + get(mpBtnContinue, "btn_continue"); + get(mpBtnQuit, "btn_quit"); + get(mpBtnRestart, "btn_restart"); + get(mpCBCustomizations, "check_customizations"); + get(mpCBExtensions, "check_extensions"); + get(mpCBFull, "check_full"); + + mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); + mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); + mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl)); +} + +SafeModeDialog::~SafeModeDialog() +{ + disposeOnce(); +} + +void SafeModeDialog::dispose() +{ + mpBtnContinue.clear(); + mpBtnQuit.clear(); + mpBtnRestart.clear(); + mpCBCustomizations.clear(); + mpCBExtensions.clear(); + mpCBFull.clear(); + + Dialog::dispose(); +} + +IMPL_LINK(SafeModeDialog, BtnHdl, Button*, pBtn, void) +{ + if (pBtn == mpBtnContinue.get()) + { + Close(); + } + else if (pBtn == mpBtnQuit.get()) + { + Close(); + } + else if (pBtn == mpBtnRestart.get()) + { + Close(); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx new file mode 100644 index 0000000..ac71cf4 --- /dev/null +++ b/svx/source/dialog/SafeModeDialog.hxx @@ -0,0 +1,44 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX +#define INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include <vcl/vclmedit.hxx> + +class SafeModeDialog : public Dialog +{ +public: + + explicit SafeModeDialog(vcl::Window* pParent); + + virtual ~SafeModeDialog() override; + + virtual void dispose() override; + +private: + + VclPtr<Button> mpBtnContinue; + VclPtr<Button> mpBtnQuit; + VclPtr<Button> mpBtnRestart; + + VclPtr<CheckBox> mpCBExtensions; + VclPtr<CheckBox> mpCBCustomizations; + VclPtr<CheckBox> mpCBFull; + + DECL_LINK(BtnHdl, Button*, void); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/SafeModeUI.cxx b/svx/source/dialog/SafeModeUI.cxx new file mode 100644 index 0000000..15da084 --- /dev/null +++ b/svx/source/dialog/SafeModeUI.cxx @@ -0,0 +1,99 @@ +/* -*- 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 <cppuhelper/implbase.hxx> +#include <com/sun/star/frame/XSynchronousDispatch.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> + +#include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> + +#include <vcl/svapp.hxx> + +#include "SafeModeDialog.hxx" + +namespace { + +class SafeModeUI : public ::cppu::WeakImplHelper< css::lang::XServiceInfo, + css::frame::XSynchronousDispatch > // => XDispatch! +{ +public: + explicit SafeModeUI(const css::uno::Reference< css::uno::XComponentContext >& xContext); + virtual ~SafeModeUI() override; + + // css.lang.XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw(css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) + throw(css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() + throw(css::uno::RuntimeException, std::exception) override; + + + virtual css::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL& aURL, + const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) + throw(css::uno::RuntimeException, std::exception) override; + +private: + css::uno::Reference< css::uno::XComponentContext > mxContext; +}; + +SafeModeUI::SafeModeUI(const css::uno::Reference<css::uno::XComponentContext>& xContext): + mxContext(xContext) +{ + +} + +SafeModeUI::~SafeModeUI() +{ +} + +OUString SAL_CALL SafeModeUI::getImplementationName() + throw(css::uno::RuntimeException, std::exception) +{ + return OUString("com.sun.star.comp.svx.SafeModeUI"); +} + +sal_Bool SAL_CALL SafeModeUI::supportsService(const OUString& sServiceName) + throw(css::uno::RuntimeException, std::exception) +{ + return cppu::supportsService(this, sServiceName); +} + +css::uno::Sequence< OUString > SAL_CALL SafeModeUI::getSupportedServiceNames() + throw(css::uno::RuntimeException, std::exception) +{ + css::uno::Sequence< OUString > lServiceNames { "com.sun.star.dialog.SafeModeUI" }; + return lServiceNames; +} + +css::uno::Any SAL_CALL SafeModeUI::dispatchWithReturnValue(const css::util::URL&, + const css::uno::Sequence< css::beans::PropertyValue >& ) + throw(css::uno::RuntimeException, std::exception) +{ + SolarMutexGuard aGuard; + css::uno::Any aRet; + ScopedVclPtrInstance<SafeModeDialog> xDialog(nullptr); + xDialog->Execute(); + return aRet; +} + +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_svx_SafeModeUI_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new SafeModeUI(context)); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/safemodedialog.ui b/svx/uiconfig/ui/safemodedialog.ui new file mode 100644 index 0000000..8ac77b2 --- /dev/null +++ b/svx/uiconfig/ui/safemodedialog.ui @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.12"/> + <object class="GtkDialog" id="SafeModeDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Safe Mode</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="btn_continue"> + <property name="label" translatable="yes">_Continue in Safe Mode</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="btn_quit"> + <property name="label" translatable="yes">_Quit</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="btn_restart"> + <property name="label" translatable="yes">_Make Changes and Restart</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">%PRODUCTNAME is now running in Safe Mode, which temporarily disables your custom settings and extensions. + +You can make some or all these changes permanent:</property> + <property name="wrap">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkCheckButton" id="check_extensions"> + <property name="label" translatable="yes">Disable all extensions</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">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_customizations"> + <property name="label" translatable="yes">Reset customizations (Settings and User Interface modifications)</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">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_full"> + <property name="label" translatable="yes">Reset the whole User Profile</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> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkActionGroup" id="actiongroup1"/> +</interface> diff --git a/svx/util/svx.component b/svx/util/svx.component index 31c8005..eeecf60 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -36,6 +36,10 @@ constructor="com_sun_star_comp_svx_CrashReportUI_get_implementation"> <service name="com.sun.star.dialog.CrashReportUI"/> </implementation> + <implementation name="com.sun.star.comp.svx.SafeModeUI" + constructor="com_sun_star_comp_svx_SafeModeUI_get_implementation"> + <service name="com.sun.star.dialog.SafeModeUI"/> + </implementation> <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine" constructor="com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation"> <service name="com.sun.star.drawing.CustomShapeEngine"/> commit 8ac6b51cc484a36bfd789588a03cbf8e978e4236 Author: Samuel Mehrbrodt <[email protected]> Date: Fri Oct 7 18:19:03 2016 +0200 safemode: Add command line option Change-Id: I081cc6b4d61be4541a3bdcf475385b5ce0f59cda diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 0ddc29a..41d3512 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -242,6 +242,10 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { m_eventtesting = true; } + else if ( oArg == "safe-mode" ) + { + m_safemode = true; + } else if ( oArg == "cat" ) { m_textcat = true; @@ -613,6 +617,7 @@ void CommandLineArgs::InitParamValues() m_bEmpty = true; m_bDocumentArgs = false; m_textcat = false; + m_safemode = false; } bool CommandLineArgs::HasModuleParam() const diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 9464855..c8f0711 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -92,6 +92,7 @@ class CommandLineArgs bool HasModuleParam() const; bool WantsToLoadDocument() const { return m_bDocumentArgs;} bool IsTextCat() const { return m_textcat;} + bool IsSafeMode() const { return m_safemode; } const OUString& GetUnknown() const { return m_unknown;} @@ -155,6 +156,7 @@ class CommandLineArgs bool m_version; bool m_splashpipe; bool m_textcat; + bool m_safemode; OUString m_unknown; diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 1537747..a674b5e 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -55,6 +55,7 @@ namespace desktop "--invisible \n"\ "--norestore \n"\ "--quickstart \n"\ + "--safe-mode \n"\ "--nologo \n"\ "--nolockcheck \n"\ "--nodefault \n"\ @@ -76,6 +77,7 @@ namespace desktop "no startup screen, no default document and no UI.\n"\ "suppress restart/restore after fatal errors.\n"\ "starts the quickstart service\n"\ + "starts the safe mode\n"\ "don't show startup screen.\n"\ "don't check for remote instances using the installation\n"\ "don't start with an empty document\n"\ commit 9ad88a1e0fb2c68eedee37d093518960dd8615b7 Author: Samuel Mehrbrodt <[email protected]> Date: Fri Oct 7 17:18:34 2016 +0200 Fix typo Change-Id: I20bb74183e134c9bf597cd8b471fd6dc4104eb24 diff --git a/svx/qa/unit/data/svx-dialogs-test.txt b/svx/qa/unit/data/svx-dialogs-test.txt index 07ddb87..bd7ff04 100644 --- a/svx/qa/unit/data/svx-dialogs-test.txt +++ b/svx/qa/unit/data/svx-dialogs-test.txt @@ -13,7 +13,7 @@ # workdir/screenshots using the pattern of the ui-file name. # # Syntax: -# - emty lines are allowed +# - empty lines are allowed # - lines starting with '#' are treated as comment # - all other lines should contain a *.ui filename in the same # notation as in the dialog constructors (see code) commit 3ead7de845065fb647f073c69557277dbdb54c26 Author: Francisco Adrián Sánchez <[email protected]> Date: Fri Oct 7 16:30:28 2016 +0200 Improve 'Vivid' template Improve styles, use "Source Sans Pro" instead of "Open Sans" (Open Sans light is not bundled, though required in this template) Change-Id: I2980ec7c3ec30a879e2f00032eeccf2bcb253bad diff --git a/extras/source/templates/presnt/Vivid.otp b/extras/source/templates/presnt/Vivid.otp index 6b77361..6152b9e 100644 Binary files a/extras/source/templates/presnt/Vivid.otp and b/extras/source/templates/presnt/Vivid.otp differ
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
