summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2018-03-12 22:11:39 +0300
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-03-13 08:01:57 +0100
commit51617878ddc8f9816af7d63d0b483eefd3aed27d (patch)
tree0338618fe87645f641f9d083c2269907f708dd59 /cui
parentf495a324921589d731d7d16f4554e36d4230476b (diff)
tdf#114260: Allow moving top-level menus
in the Customize dialog. Change-Id: I0dafe59e017e05977d00cf564cfef21190a0a7a1 Reviewed-on: https://gerrit.libreoffice.org/51163 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx17
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx4
-rw-r--r--cui/source/customize/cfg.cxx5
-rw-r--r--cui/source/inc/cfg.hxx1
-rw-r--r--cui/uiconfig/ui/menuassignpage.ui8
5 files changed, 35 insertions, 0 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index 1737744dbb25..75fbaa16378b 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -223,6 +223,7 @@ void SvxMenuConfigPage::UpdateButtonStates()
// Add option (gear_add) will always be enabled
pGearPopup->EnableItem( "gear_delete", pMenuData->IsDeletable() );
pGearPopup->EnableItem( "gear_rename", pMenuData->IsRenamable() );
+ pGearPopup->EnableItem( "gear_move", pMenuData->IsMovable() );
}
}
@@ -353,6 +354,22 @@ IMPL_LINK( SvxMenuConfigPage, GearHdl, MenuButton *, pButton, void )
GetSaveInData()->SetModified();
}
}
+ else if (sIdent == "gear_move")
+ {
+ SvxConfigEntry* pMenuData = GetTopLevelSelection();
+
+ VclPtrInstance<SvxMainMenuOrganizerDialog> pDialog(
+ this, GetSaveInData()->GetEntries(), pMenuData, false );
+
+ if ( pDialog->Execute() == RET_OK )
+ {
+ GetSaveInData()->SetEntries( pDialog->GetEntries() );
+
+ ReloadTopLevelListBox();
+
+ GetSaveInData()->SetModified();
+ }
+ }
else
{
//This block should never be reached
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 53542657fe81..c09d354cb9e5 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -151,6 +151,10 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
pPopup->EnableItem(OString( "insertsubmenu"), false );
pPopup->RemoveDisabledEntries();
+ // Gear menu's "Move" action is irrelevant to the toolbars
+ pPopup = m_pGearBtn->GetPopupMenu();
+ pPopup->EnableItem("gear_move", false);
+
// default toolbar to select is standardbar unless a different one
// has been passed in
m_aURLToSelect = ITEM_TOOLBAR_URL;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 8ee0080ba441..e90bfa358621 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2100,6 +2100,11 @@ SvxConfigEntry::~SvxConfigEntry()
}
}
+bool SvxConfigEntry::IsMovable()
+{
+ return !IsPopup() || IsMain();
+}
+
bool SvxConfigEntry::IsDeletable()
{
return !IsMain() || IsUserDefined();
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index c1c85c86fa4c..6f79414f0671 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -319,6 +319,7 @@ public:
void SetModified( bool bValue = true ) { bIsModified = bValue; }
bool IsModified() { return bIsModified; }
+ bool IsMovable();
bool IsDeletable();
bool IsRenamable();
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index bd77bf0179a2..425d0c2f84a4 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -30,6 +30,14 @@
<property name="use_underline">True</property>
</object>
</child>
+ <child>
+ <object class="GtkMenuItem" id="gear_move">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="menuassignpage|gear_move">_Move...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>