From: Debian LibreOffice Maintainers Date: Thu, 21 May 2020 11:43:43 +0000 (+0100) Subject: no-packagekit-per-default X-Git-Tag: archive/raspbian/1%6.4.4-1+rpi1^2~27 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1b14da5fca4c8d8debdb8aefc41cfccb1cf2857c;p=libreoffice.git no-packagekit-per-default Gbp-Pq: Name no-packagekit-per-default.diff --- diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 24125bf454f..d35bb920cd1 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -551,10 +551,13 @@ - true + false - true + false + + + false diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index cebb7d7ec0e..c54a95549cd 100644 Binary files a/officecfg/registry/schema/org/openoffice/Office/Common.xcs and b/officecfg/registry/schema/org/openoffice/Office/Common.xcs differ diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index c73d8d9d39c..c1a4fc0831d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -204,20 +204,23 @@ namespace // make sure we actually can instantiate services from base first if(!lcl_isBaseAvailable()) { - try - { - using namespace org::freedesktop::PackageKit; - using namespace svtools; - Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); - Sequence< OUString > vPackages { "libreoffice-base" }; - xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString()); - // Ill be back (hopefully)! - SolarMutexGuard aGuard; - executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_BIBLIOGRAPHY_INSTALL); - } - catch (const Exception &) + if (officecfg::Office::Common::PackageKit::EnableBaseInstallation::get()) { - TOOLS_INFO_EXCEPTION("sfx.appl", "trying to install LibreOffice Base"); + try + { + using namespace org::freedesktop::PackageKit; + using namespace svtools; + Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); + Sequence< OUString > vPackages { "libreoffice-base" }; + xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString()); + // I'll be back (hopefully)! + SolarMutexGuard aGuard; + executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_BIBLIOGRAPHY_INSTALL); + } + catch (const Exception &) + { + TOOLS_INFO_EXCEPTION("sfx.appl", "trying to install LibreOffice Base"); + } } return; } diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 0465bf430e7..45373e961f5 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -81,6 +81,8 @@ #include #include +#include + using namespace ::com::sun::star; // Slotmaps for the application's methods @@ -394,21 +396,36 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs { if(!lcl_hasAllComponentsAvailable()) { - try - { - using namespace org::freedesktop::PackageKit; - using namespace svtools; - css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); - const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" }; - xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString()); - SolarMutexGuard aGuard; - executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL); - } - catch (const css::uno::Exception &) + if (officecfg::Office::Common::PackageKit::EnableBaseInstallation::get()) { - TOOLS_INFO_EXCEPTION( - "sw.core", - "trying to install LibreOffice Base, caught"); + try + { + using namespace org::freedesktop::PackageKit; + using namespace svtools; + css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); + const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" }; + xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString()); + SolarMutexGuard aGuard; + executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL); + } + catch (const css::uno::Exception &) + { + TOOLS_INFO_EXCEPTION( + "sw.core", + "trying to install LibreOffice Base, caught"); + auto xRestartManager + = css::task::OfficeRestartManager::get(comphelper::getProcessComponentContext()); + if (!xRestartManager->isRestartRequested(false)) + { + // Base is absent, and could not initiate its install - ask user to do that manually + // Only show the dialog if restart is not initiated yet + std::unique_ptr xWarnBox(Application::CreateMessageDialog( + nullptr, VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_NO_BASE_FOR_MERGE))); + xWarnBox->run(); + } + } + } else { auto xRestartManager = css::task::OfficeRestartManager::get(comphelper::getProcessComponentContext()); if (!xRestartManager->isRestartRequested(false))