Kaydet (Commit) 54b2615e authored tarafından Tamás Zolnai's avatar Tamás Zolnai

MSForms: Show restart dialog when MS compatible Forms menu setting is changed

Change-Id: Icb98dac73dea5f5cb18e1ca34e37e9d9bf84782e
Reviewed-on: https://gerrit.libreoffice.org/67906
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst dc3a2546
......@@ -60,6 +60,9 @@ enum RestartReason {
// For the OpenCL changes to take effect,
// %PRODUCTNAME must be restarted:
RESTART_REASON_OPENCL,
// For restructuring the Forms menu,
// %PRODUCTNAME must be restarted:
RESTART_REASON_MSCOMPATIBLE_FORMS_MENU,
// No particular reason:
RESTART_REASON_NONE
};
......
......@@ -65,6 +65,9 @@ public:
case svtools::RESTART_REASON_OPENCL:
reason_ = m_xBuilder->weld_widget("reason_opencl");
break;
case svtools::RESTART_REASON_MSCOMPATIBLE_FORMS_MENU:
reason_ = m_xBuilder->weld_widget("reason_mscompatible_formsmenu");
break;
default:
assert(false); // this cannot happen
}
......
......@@ -243,6 +243,21 @@
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="reason_mscompatible_formsmenu">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes" context="restartdialog|reason_mscompatible_formsmenu">For restructuring the Forms menu, %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">12</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
......@@ -254,7 +269,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">12</property>
<property name="position">13</property>
</packing>
</child>
</object>
......
......@@ -35,6 +35,8 @@
#include <vcl/treelistentry.hxx>
#include <IDocumentSettingAccess.hxx>
#include <vector>
#include <svtools/restartdialog.hxx>
#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::document;
......@@ -452,6 +454,16 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* )
m_aViewConfigItem.SetMSOCompatibleFormsMenu(bNewMSFormsMenuOption);
m_bSavedMSFormsMenuOption = bNewMSFormsMenuOption;
bModified = true;
// Show a message about that the option needs a restart to be applied
{
SolarMutexGuard aGuard;
if (svtools::executeRestartDialog(comphelper::getProcessComponentContext(),
GetFrameWeld(), svtools::RESTART_REASON_MSCOMPATIBLE_FORMS_MENU))
{
GetParentDialog()->EndDialog(RET_OK);
}
}
}
return bModified;
......
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