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 { ...@@ -60,6 +60,9 @@ enum RestartReason {
// For the OpenCL changes to take effect, // For the OpenCL changes to take effect,
// %PRODUCTNAME must be restarted: // %PRODUCTNAME must be restarted:
RESTART_REASON_OPENCL, RESTART_REASON_OPENCL,
// For restructuring the Forms menu,
// %PRODUCTNAME must be restarted:
RESTART_REASON_MSCOMPATIBLE_FORMS_MENU,
// No particular reason: // No particular reason:
RESTART_REASON_NONE RESTART_REASON_NONE
}; };
......
...@@ -65,6 +65,9 @@ public: ...@@ -65,6 +65,9 @@ public:
case svtools::RESTART_REASON_OPENCL: case svtools::RESTART_REASON_OPENCL:
reason_ = m_xBuilder->weld_widget("reason_opencl"); reason_ = m_xBuilder->weld_widget("reason_opencl");
break; break;
case svtools::RESTART_REASON_MSCOMPATIBLE_FORMS_MENU:
reason_ = m_xBuilder->weld_widget("reason_mscompatible_formsmenu");
break;
default: default:
assert(false); // this cannot happen assert(false); // this cannot happen
} }
......
...@@ -243,6 +243,21 @@ ...@@ -243,6 +243,21 @@
<property name="position">11</property> <property name="position">11</property>
</packing> </packing>
</child> </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> <child>
<object class="GtkLabel" id="label"> <object class="GtkLabel" id="label">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -254,7 +269,7 @@ ...@@ -254,7 +269,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">12</property> <property name="position">13</property>
</packing> </packing>
</child> </child>
</object> </object>
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <vcl/treelistentry.hxx> #include <vcl/treelistentry.hxx>
#include <IDocumentSettingAccess.hxx> #include <IDocumentSettingAccess.hxx>
#include <vector> #include <vector>
#include <svtools/restartdialog.hxx>
#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::document; using namespace ::com::sun::star::document;
...@@ -452,6 +454,16 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* ) ...@@ -452,6 +454,16 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* )
m_aViewConfigItem.SetMSOCompatibleFormsMenu(bNewMSFormsMenuOption); m_aViewConfigItem.SetMSOCompatibleFormsMenu(bNewMSFormsMenuOption);
m_bSavedMSFormsMenuOption = bNewMSFormsMenuOption; m_bSavedMSFormsMenuOption = bNewMSFormsMenuOption;
bModified = true; 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; 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