summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerk Gureken <berkgureken@gmail.com>2016-03-22 07:15:05 +0200
committerJan Holesovsky <kendy@collabora.com>2016-04-11 07:11:19 +0000
commitcf81f3ba0602eeffad8907a1bb9cdd24e62c2d1e (patch)
treec6af501c71350ce3b91b0fbdd512b5d7f6e6f2ad
parentb4ddacbc552905d0434e9204ee954cb4522a00cd (diff)
tdf#79656 Restart now window for language change
When you change the UI language and click OK, Restart Now window opens instead of warning window. Change-Id: Ic503bf4536a855891456f48745b748786857200f Reviewed-on: https://gerrit.libreoffice.org/23421 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--cui/source/options/optgdlg.cxx8
-rw-r--r--include/svtools/restartdialog.hxx5
-rw-r--r--svtools/source/dialogs/restartdialog.cxx3
-rw-r--r--svtools/uiconfig/ui/restartdialog.ui23
4 files changed, 32 insertions, 7 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 52ef10e0e058..396d1eea3f81 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -97,6 +97,8 @@
#include <svx/ofaitem.hxx>
#include <svtools/apearcfg.hxx>
#include <svtools/optionsdrawinglayer.hxx>
+#include <svtools/restartdialog.hxx>
+#include <comphelper/solarmutex.hxx>
#include <config_vclplug.h>
@@ -1285,8 +1287,10 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
// display info
- ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
- aBox->Execute();
+ SolarMutexGuard aGuard;
+ svtools::executeRestartDialog(
+ comphelper::getProcessComponentContext(), nullptr,
+ svtools::RESTART_REASON_LANGUAGE_CHANGE);
// tell quickstarter to stop being a veto listener
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index e1ca07d34479..d90ec4ddd9bc 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -32,9 +32,12 @@ enum RestartReason {
RESTART_REASON_BIBLIOGRAPHY_INSTALL,
// "For the bibliography to work properly,
// %PRODUCTNAME must be restarted."
- RESTART_REASON_MAILMERGE_INSTALL
+ RESTART_REASON_MAILMERGE_INSTALL,
// "For the mail merge to work properly,
// %PRODUCTNAME must be restarted."
+ RESTART_REASON_LANGUAGE_CHANGE
+ // "For the updated language settings to take effect,
+ // %PRODUCTNAME must be restarted."
};
// Must be called with the solar mutex locked:
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 0ff1340f85bb..3b9df0ff3ee7 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -43,6 +43,9 @@ public:
case svtools::RESTART_REASON_MAILMERGE_INSTALL:
get(reason_, "reason_mailmerge_install");
break;
+ case svtools::RESTART_REASON_LANGUAGE_CHANGE:
+ get(reason_, "reason_language_change");
+ break;
default:
assert(false); // this cannot happen
}
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index 9e4b984e0228..2dc71d79eadf 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -91,6 +91,21 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="reason_mailmerge_install">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">For mail merge to work properly, %PRODUCTNAME must be restarted.</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">50</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="reason_bibliography_install">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
@@ -106,18 +121,18 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="reason_mailmerge_install">
+ <object class="GtkLabel" id="reason_language_change">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">For mail merge to work properly, %PRODUCTNAME must be restarted.</property>
+ <property name="label" translatable="yes">For the updated language settings to take effect, %PRODUCTNAME must be restarted.</property>
<property name="wrap">True</property>
<property name="max_width_chars">50</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -131,7 +146,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">5</property>
</packing>
</child>
</object>