[Libreoffice-commits] core.git: cui/source cui/uiconfig
Muhammet Kara
muhammet.kara at pardus.org.tr
Tue Oct 25 13:15:36 UTC 2016
cui/source/customize/cfg.cxx | 65 +++++++++++++++++++++++---------------
cui/source/inc/cfg.hxx | 2 +
cui/uiconfig/ui/menuassignpage.ui | 29 ++++++++--------
3 files changed, 57 insertions(+), 39 deletions(-)
New commits:
commit cd7b306e614a938b7b39a66784899c22ee6f6c64
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date: Mon Oct 24 11:59:03 2016 +0300
tdf#103160 Add 'Add Submenu' button in Customize dialog
And remove the 'Add Submenu' entry from Modify split button
in Customize dialog
Change-Id: I6ac940f5f1f41ac1f962f66f458c7e14d702b2be
Reviewed-on: https://gerrit.libreoffice.org/30230
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85 at hotmail.com>
Tested-by: Yousuf Philips <philipz85 at hotmail.com>
Reviewed-by: Muhammet Kara <muhammet.kara at pardus.org.tr>
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index dcbe98f..6d08562 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1754,6 +1754,7 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
get(m_pContentsLabel, "contentslabel");
get(m_pAddCommandsButton, "add");
get(m_pAddSeparatorButton, "addseparatorbtn");
+ get(m_pAddSubmenuButton, "addsubmenubtn");
get(m_pModifyCommandButton, "modify");
get(m_pDeleteCommandButton, "deletebtn");
get(m_pResetTopLevelButton, "resetbtn");
@@ -1773,7 +1774,7 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
// This button is applicable only for the toolbar config tab
m_pResetTopLevelButton->Enable( false );
m_pResetTopLevelButton->Hide();
- //These radio buttons are applicable only for the toolbar config tab
+ // These radio buttons are applicable only for the toolbar config tab
m_pIconsOnlyRB->Enable( false );
m_pTextOnlyRB->Enable( false );
m_pIconsAndTextRB->Enable( false );
@@ -1781,6 +1782,9 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
m_pTextOnlyRB->Hide();
m_pIconsAndTextRB->Hide();
m_pToolbarStyleLabel->Hide();
+ // This button is applicable only for the Menus and Context Menus tabs
+ m_pAddSubmenuButton->Disable();
+ m_pAddSubmenuButton->Hide();
}
SvxConfigPage::~SvxConfigPage()
@@ -1804,6 +1808,7 @@ void SvxConfigPage::dispose()
m_pEntries.clear();
m_pAddCommandsButton.clear();
m_pAddSeparatorButton.clear();
+ m_pAddSubmenuButton.clear();
m_pModifyCommandButton.clear();
m_pDeleteCommandButton.clear();
m_pResetTopLevelButton.clear();
@@ -2443,6 +2448,9 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
m_pContentsListBox->set_vexpand(true);
m_pContentsListBox->Show();
+ m_pAddSubmenuButton->Enable();
+ m_pAddSubmenuButton->Show();
+
m_pTopLevelListBox->SetSelectHdl(
LINK( this, SvxMenuConfigPage, SelectMenu ) );
@@ -2461,6 +2469,9 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
m_pAddSeparatorButton->SetClickHdl (
LINK( this, SvxMenuConfigPage, AddSeparatorHdl ) );
+ m_pAddSubmenuButton->SetClickHdl (
+ LINK( this, SvxMenuConfigPage, AddSubmenuHdl ) );
+
m_pDeleteCommandButton->SetClickHdl (
LINK( this, SvxMenuConfigPage, DeleteCommandHdl ) );
@@ -2713,30 +2724,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton, void )
IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton, void )
{
OString sIdent = pButton->GetCurItemIdent();
- if (sIdent == "addsubmenu")
- {
- OUString aNewName;
- OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
-
- VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
- pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
-
- if ( pNameDialog->Execute() == RET_OK ) {
- pNameDialog->GetName(aNewName);
-
- SvxConfigEntry* pNewEntryData =
- new SvxConfigEntry( aNewName, aNewName, true );
- pNewEntryData->SetUserDefined();
-
- InsertEntry( pNewEntryData );
-
- ReloadTopLevelListBox();
-
- GetSaveInData()->SetModified();
- }
- }
- else if (sIdent == "modrename")
+ if (sIdent == "modrename")
{
SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
SvxConfigEntry* pEntry =
@@ -2821,6 +2809,33 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, AddSeparatorHdl, Button *, void )
}
}
+IMPL_LINK_NOARG( SvxMenuConfigPage, AddSubmenuHdl, Button *, void )
+{
+ OUString aNewName;
+ OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
+
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
+ pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
+
+ if ( pNameDialog->Execute() == RET_OK )
+ {
+ pNameDialog->GetName(aNewName);
+
+ SvxConfigEntry* pNewEntryData =
+ new SvxConfigEntry( aNewName, aNewName, true );
+ pNewEntryData->SetUserDefined();
+
+ InsertEntry( pNewEntryData );
+
+ ReloadTopLevelListBox();
+
+ GetSaveInData()->SetModified();
+
+ UpdateButtonStates();
+ }
+}
+
IMPL_LINK_NOARG( SvxMenuConfigPage, DeleteCommandHdl, Button *, void )
{
DeleteSelectedContent();
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 6ca5756..7ddd3ac 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -381,6 +381,7 @@ protected:
VclPtr<PushButton> m_pAddCommandsButton;
VclPtr<PushButton> m_pAddSeparatorButton;
+ VclPtr<PushButton> m_pAddSubmenuButton;
VclPtr<MenuButton> m_pModifyCommandButton;
VclPtr<PushButton> m_pDeleteCommandButton;
// Resets the top level toolbar to default settings
@@ -484,6 +485,7 @@ private:
DECL_LINK( EntrySelectHdl, MenuButton *, void );
DECL_LINK( AddCommandsHdl, Button *, void );
DECL_LINK( AddSeparatorHdl, Button *, void );
+ DECL_LINK( AddSubmenuHdl, Button *, void );
DECL_LINK( DeleteCommandHdl, Button *, void );
DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog&, void );
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index 193153d..e15ae5d 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -479,6 +479,20 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="addsubmenubtn">
+ <property name="label" translatable="yes">Add Submenu</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -569,6 +583,7 @@
<widget name="modify:modmenu"/>
<widget name="deletebtn"/>
<widget name="resetbtn"/>
+ <widget name="addsubmenubtn"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup2">
@@ -616,20 +631,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkMenuItem" id="addsubmenu">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Add Submenu...</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="menuitem4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- <child>
<object class="GtkMenuItem" id="modrename">
<property name="visible">True</property>
<property name="can_focus">False</property>
More information about the Libreoffice-commits
mailing list