From a1b7231a33322bbbb8352e2cd6aeff3b473b01d4 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 13 Oct 2016 18:31:51 +0200 Subject: profilesafe: Adapted to UI Adaptions to UI, added more modes what the user can do in SafeMode. Adapted locations to write pack information and added places where to enter SafeMode. Implemented basically all five possible user choices Change-Id: Ic5324a8f77ab434309e840949c3803e65a75c538 Reviewed-on: https://gerrit.libreoffice.org/29785 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- desktop/source/app/app.cxx | 64 ++++------------------ .../ui/querytrytorestoreconfigurationdialog.ui | 37 ------------- 2 files changed, 12 insertions(+), 89 deletions(-) delete mode 100644 desktop/uiconfig/ui/querytrytorestoreconfigurationdialog.ui (limited to 'desktop') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cd3fbfa96326..6be6d6139bfa 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -951,64 +951,23 @@ void Desktop::HandleBootstrapErrors( } else if ( aBootstrapError == BE_OFFICECONFIG_BROKEN ) { - bool bFireOriginalError(true); - comphelper::BackupFileHelper aBackupFileHelper; - - // crerate BackupFileHelper and check if active and if pop is possible - if (aBackupFileHelper.isPopPossible()) - { - // for linux (and probably others?) we need to instantiate XDesktop2 - // to be able to open a *.ui-file based dialog, so do this here locally. - // does no harm on win, so better always do this (in error case only anyways) - Reference< XComponentContext > xLocalContext = ::comphelper::getProcessComponentContext(); - Reference< XDesktop2 > xDesktop = css::frame::Desktop::create(xLocalContext); - - ScopedVclPtrInstance< MessageDialog > aQueryShouldRestore( - Application::GetDefDialogParent(), - "QueryTryToRestoreConfigurationDialog", - "desktop/ui/querytrytorestoreconfigurationdialog.ui"); - - if (aQueryShouldRestore.get()) - { - if (!aErrorMessage.isEmpty()) - { - OUString aPrimaryText(aQueryShouldRestore->get_primary_text()); - - aPrimaryText += "\n(\"" + aErrorMessage + "\")"; - aQueryShouldRestore->set_primary_text(aPrimaryText); - } - - if (RET_YES == aQueryShouldRestore->Execute()) - { - aBackupFileHelper.tryPop(); - bFireOriginalError = false; - } - } - } - // set flag at BackupFileHelper to be able to know if _exit was called and // actions are executed after this. This method we are in will not return, // but end up in a _exit() call comphelper::BackupFileHelper::setExitWasCalled(); - if (bFireOriginalError) - { - OUString msg( - GetMsgString( - STR_CONFIG_ERR_ACCESS_GENERAL, - ("A general error occurred while accessing your central" - " configuration."))); - if (!aErrorMessage.isEmpty()) { - msg += "\n(\"" + aErrorMessage + "\")"; - } - FatalError(MakeStartupErrorMessage(msg)); - } - else - { - // Already presented all information to the user. - // just do what FatalError does at it's end - _exit(EXITHELPER_FATAL_ERROR); + // enter safe mode, too + sfx2::SafeMode::putFlag(); + + OUString msg( + GetMsgString( + STR_CONFIG_ERR_ACCESS_GENERAL, + ("A general error occurred while accessing your central" + " configuration. SafeMode is initiated."))); + if (!aErrorMessage.isEmpty()) { + msg += "\n(\"" + aErrorMessage + "\")"; } + FatalError(MakeStartupErrorMessage(msg)); } else if ( aBootstrapError == BE_USERINSTALL_FAILED ) { @@ -1824,6 +1783,7 @@ int Desktop::doShutdown() comphelper::BackupFileHelper aBackupFileHelper; aBackupFileHelper.tryPush(); + aBackupFileHelper.tryPushExtensionInfo(); } // The acceptors in the AcceptorMap must be released (in DeregisterServices) diff --git a/desktop/uiconfig/ui/querytrytorestoreconfigurationdialog.ui b/desktop/uiconfig/ui/querytrytorestoreconfigurationdialog.ui deleted file mode 100644 index 4c332d1889d6..000000000000 --- a/desktop/uiconfig/ui/querytrytorestoreconfigurationdialog.ui +++ /dev/null @@ -1,37 +0,0 @@ - - - - - False - 6 - LibreOffice Startup: General Configuration Error - False - dialog - True - question - yes-no - A general error occurred during startup while accessing the central configuration. - A Backup of your configuration was detected. Restoring the configuration might solve this problem, but is not guaranteed to work. A restart of the Program is needed. - -Do you want to restore the configuration? - - - False - vertical - 12 - - - False - end - - - False - True - end - 0 - - - - - - -- cgit