no-packagekit-per-default
authorDebian LibreOffice Maintainers <debian-openoffice@lists.debian.org>
Sat, 22 Feb 2020 13:46:04 +0000 (13:46 +0000)
committerRene Engelhard <rene@debian.org>
Sat, 22 Feb 2020 13:46:04 +0000 (13:46 +0000)
Gbp-Pq: Name no-packagekit-per-default.diff

officecfg/registry/data/org/openoffice/Office/Common.xcu
officecfg/registry/schema/org/openoffice/Office/Common.xcs
sfx2/source/appl/appserv.cxx
sw/source/uibase/app/apphdl.cxx

index 24125bf454f9857277a26bad1febcd53c9ef3836..d35bb920cd130e9ebd470b2d6b4234606528a953 100644 (file)
   </node>
   <node oor:name="PackageKit">
       <prop oor:name="EnableFontInstallation" oor:type="xs:boolean">
-        <value install:module="unx">true</value>
+        <value install:module="unx">false</value>
       </prop>
       <prop oor:name="EnableLangpackInstallation" oor:type="xs:boolean">
-        <value install:module="unx">true</value>
+        <value install:module="unx">false</value>
+      </prop>
+      <prop oor:name="EnableBaseInstallation" oor:type="xs:boolean">
+        <value install:module="unx">false</value>
       </prop>
   </node>
   <node oor:name="Classification">
index cebb7d7ec0efa3b8c2a27bc6b7bcd5099ff3cf9f..c54a95549cd50004bc487ece7655bdaf71848982 100644 (file)
Binary files a/officecfg/registry/schema/org/openoffice/Office/Common.xcs and b/officecfg/registry/schema/org/openoffice/Office/Common.xcs differ
index c73d8d9d39c975c5ec0be32be75e8030d567de31..c1a4fc0831d9804953233c6b74352a2d0955c3d2 100644 (file)
@@ -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;
         }
index a2a2ff35b45511a56597163fa2eba8aba36c8f51..0c012cf778e888043f77d143bf8cf1dd36e478fc 100644 (file)
@@ -81,6 +81,8 @@
 #include <salhelper/simplereferenceobject.hxx>
 #include <rtl/ref.hxx>
 
+#include <officecfg/Office/Common.hxx>
+
 using namespace ::com::sun::star;
 
 // Slotmaps for the application's methods
@@ -415,21 +417,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<weld::MessageDialog> 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))