[Libreoffice-commits] core.git: cui/inc cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 18 15:16:10 UTC 2018


 cui/inc/strings.hrc              |    2 +-
 cui/source/options/optopencl.cxx |   17 ++++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 84ee78fce5e980d3593fbbbe49005f35c5b3e2d0
Author:     Nickson Thanda <nicksonthanda10 at msn.com>
AuthorDate: Tue Jul 17 05:12:57 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jul 18 17:15:42 2018 +0200

    tdf#104277 - Added restart buttons to OpenCL restart dialog
    
    Change-Id: Icf31d0516deb7844c8be1003219cbacae1cdc5ec
    Reviewed-on: https://gerrit.libreoffice.org/57537
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index 66da2d39506d..99e0b1b69030 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -384,7 +384,7 @@
 #define RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT          NC_("RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT", "Cast Shadow to Bottom Left")
 #define RID_SVXSTR_SHADOW_STYLE_TOPLEFT             NC_("RID_SVXSTR_SHADOW_STYLE_TOPLEFT", "Cast Shadow to Top Left")
 #define RID_SVXSTR_SIGNATURELINE_SIGNED_BY          NC_("RID_SVXSTR_SIGNATURELINE_SIGNED_BY", "Signed by: %1")
-
+#define RID_SVXSTR_OPENCL_RESTART                   NC_("RID_SVXSTR_OPENCL_RESTART", "For the OpenCL changes to take effect, %PRODUCTNAME must be restarted.")
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index cefd3b2cd71c..4448ed99405c 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -34,6 +34,9 @@
 #include <com/sun/star/ui/dialogs/FolderPicker.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 #include <com/sun/star/util/XChangesBatch.hpp>
+#include <com/sun/star/task/OfficeRestartManager.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <strings.hrc>
 #include <dialmgr.hxx>
@@ -103,10 +106,18 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
     if (bModified)
     {
         std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(GetFrameWeld(),
-                                                      VclMessageType::Info, VclButtonsType::Ok,
-                                                      CuiResId(RID_SVXSTR_OPTIONS_RESTART)));
-        xWarnBox->run();
+                                                      VclMessageType::Question, VclButtonsType::NONE,
+                                                      CuiResId(RID_SVXSTR_OPENCL_RESTART)));
+        xWarnBox->add_button("Restart Now",RET_YES);
+        xWarnBox->add_button("Restart Later",RET_NO);
+        sal_uInt16 nRet = xWarnBox->run();
         batch->commit();
+        if (nRet == RET_YES)
+        {
+            css::task::OfficeRestartManager::get(comphelper::getProcessComponentContext())->requestRestart(
+            css::uno::Reference< css::task::XInteractionHandler >());
+        }
+
     }
 
     return bModified;


More information about the Libreoffice-commits mailing list