Kaydet (Commit) cf81f3ba authored tarafından Berk Gureken's avatar Berk Gureken Kaydeden (comit) Jan Holesovsky

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/23421Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst b4ddacbc
......@@ -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
......
......@@ -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:
......
......@@ -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
}
......
......@@ -90,6 +90,21 @@
<property name="position">1</property>
</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>
......@@ -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>
......
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