Kaydet (Commit) 2b6bd096 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#104277 follow-up: use svtools::executeRestartDialog

This harmonizes this setting's prompt with other places asking for restart.
Related obsolete strings are removed.

Change-Id: I2da63585747056714eb688681194acd35550e1c7
Reviewed-on: https://gerrit.libreoffice.org/65022
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 22be500b
......@@ -317,7 +317,6 @@
#define RID_SVXSTR_JRE_NOT_RECOGNIZED NC_("RID_SVXSTR_JRE_NOT_RECOGNIZED", "The folder you selected does not contain a Java runtime environment.\nPlease select a different folder.")
#define RID_SVXSTR_JRE_FAILED_VERSION NC_("RID_SVXSTR_JRE_FAILED_VERSION", "The Java runtime environment you selected is not the required version.\nPlease select a different folder.")
#define RID_SVXSTR_OPTIONS_RESTART NC_("RID_SVXSTR_OPTIONS_RESTART", "Please restart %PRODUCTNAME now so the new or modified values can take effect.")
#define RID_SVXSTR_JAVA_START_PARAM NC_("RID_SVXSTR_JAVA_START_PARAM", "Edit Parameter")
#define RID_SVXSTR_OPT_PROXYPORTS NC_("RID_SVXSTR_OPT_PROXYPORTS", "Invalid value!\n\nThe maximum value for a port number is 65535.")
......@@ -391,7 +390,6 @@
#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.")
#define RID_SVXSTR_FILTER_ALL NC_("RID_SVXSTR_FILTER_ALL", "All files")
......
......@@ -26,6 +26,7 @@
#include <opencl/openclconfig.hxx>
#include <opencl/openclwrapper.hxx>
#include <officecfg/Office/Common.hxx>
#include <svtools/restartdialog.hxx>
#include <svtools/simptabl.hxx>
#include "optHeaderTabListbox.hxx"
......@@ -34,9 +35,6 @@
#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>
......@@ -94,19 +92,10 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
if (bModified)
{
std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(GetFrameWeld(),
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 >());
}
SolarMutexGuard aGuard;
svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr,
svtools::RESTART_REASON_OPENCL);
}
return bModified;
......
......@@ -23,37 +23,42 @@ namespace com { namespace sun { namespace star { namespace uno {
namespace svtools {
enum RestartReason {
RESTART_REASON_JAVA,
// "For the selected Java runtime environment to work properly,
// %PRODUCTNAME must be restarted."
RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
RESTART_REASON_JAVA,
// For the modified default print job format to take effect,
// %PRODUCTNAME must be restarted.
RESTART_REASON_BIBLIOGRAPHY_INSTALL,
RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
// "For the bibliography to work properly,
// %PRODUCTNAME must be restarted."
RESTART_REASON_MAILMERGE_INSTALL,
RESTART_REASON_BIBLIOGRAPHY_INSTALL,
// "For the mail merge to work properly,
// %PRODUCTNAME must be restarted."
RESTART_REASON_LANGUAGE_CHANGE,
RESTART_REASON_MAILMERGE_INSTALL,
// "For the updated language settings to take effect,
// %PRODUCTNAME must be restarted."
RESTART_REASON_ADDING_PATH,
RESTART_REASON_LANGUAGE_CHANGE,
// "For the added path to take effect,
// %PRODUCTNAME must be restarted."
RESTART_REASON_ASSIGNING_JAVAPARAMETERS,
RESTART_REASON_ADDING_PATH,
// "For the assigned java parameters to take effect,
// %PRODUCTNAME must be restarted."
RESTART_REASON_ASSIGNING_FOLDERS,
RESTART_REASON_ASSIGNING_JAVAPARAMETERS,
// "For the assigned folders and archives to take effect,
// %PRODUCTNAME must be restarted."
RESTART_REASON_EXP_FEATURES,
RESTART_REASON_ASSIGNING_FOLDERS,
// "For the modified experimental features to take effect,
// %PRODUCTNAME must be restarted."
RESTART_REASON_EXTENSION_INSTALL,
RESTART_REASON_EXP_FEATURES,
// "For the extension to work properly,
// %PRODUCTNAME must be restarted."
RESTART_REASON_EXTENSION_INSTALL,
// For the OpenGL changes to take effect,
// %PRODUCTNAME must be restarted.
RESTART_REASON_OPENGL,
// For the OpenCL changes to take effect,
// %PRODUCTNAME must be restarted.
RESTART_REASON_OPENCL,
// No particular reason
RESTART_REASON_NONE
};
......
......@@ -62,6 +62,9 @@ public:
case svtools::RESTART_REASON_OPENGL:
reason_ = m_xBuilder->weld_widget("reason_opengl");
break;
case svtools::RESTART_REASON_OPENCL:
reason_ = m_xBuilder->weld_widget("reason_opencl");
break;
default:
assert(false); // this cannot happen
}
......
......@@ -228,6 +228,21 @@
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="reason_opencl">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes" context="restartdialog|reason_opencl">For the OpenCL changes to take effect, %PRODUCTNAME must be restarted.</property>
<property name="wrap">True</property>
<property name="max_width_chars">50</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
......@@ -239,7 +254,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">11</property>
<property name="position">12</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment