[Libreoffice-commits] core.git: Branch 'feature/gsoc17-revamp-customize-dialog' - cui/source
Muhammet Kara
muhammet.kara at pardus.org.tr
Tue Aug 29 14:15:50 UTC 2017
cui/source/customize/SvxMenuConfigPage.cxx | 20 +++++---------------
cui/source/customize/cfg.cxx | 26 ++++++++++++++++++++++++++
cui/source/inc/cfg.hxx | 1 +
3 files changed, 32 insertions(+), 15 deletions(-)
New commits:
commit 1e21383d023739cf9b77f3e83710235b4518a5d3
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date: Fri Aug 25 23:53:37 2017 +0300
Disable the individual reset button for the menubar menus
And:
* Cut m_pDescriptionField's ties to the entries list on the right.
* Disable Add and Remove buttons depending on current command selection
* Display the description of the selected command
Change-Id: I65a06f2f143c335f26de9007c6067f3116465c30
Reviewed-on: https://gerrit.libreoffice.org/41582
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index c07b057f7f34..af426bf0b2fc 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -144,6 +144,11 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
m_pPlusBtn->Hide();
m_pMinusBtn->Hide();
}
+ else
+ {
+ // TODO: Remove this when it is possible to reset menubar menus individually
+ m_pResetBtn->Disable();
+ }
}
@@ -189,7 +194,6 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, SelectMenuEntry, SvTreeListBox *, void )
void SvxMenuConfigPage::UpdateButtonStates()
{
-
// Disable Up and Down buttons depending on current selection
SvTreeListEntry* selection = m_pContentsListBox->GetCurEntry();
@@ -198,8 +202,6 @@ void SvxMenuConfigPage::UpdateButtonStates()
m_pMoveUpButton->Enable( false );
m_pMoveDownButton->Enable( false );
- m_pDescriptionField->SetText("");
-
return;
}
@@ -208,18 +210,6 @@ void SvxMenuConfigPage::UpdateButtonStates()
m_pMoveUpButton->Enable( selection != first );
m_pMoveDownButton->Enable( selection != last );
-
- SvxConfigEntry* pEntryData =
- static_cast<SvxConfigEntry*>(selection->GetUserData());
-
- if ( pEntryData->IsSeparator() )
- {
- m_pDescriptionField->SetText("");
- }
- else
- {
- m_pDescriptionField->SetText(pEntryData->GetHelpText());
- }
}
void SvxMenuConfigPage::DeleteSelectedTopLevel()
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index f37bae121971..01d32e8fbb74 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1177,6 +1177,9 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
m_pSearchEdit->SetUpdateDataHdl ( LINK( this, SvxConfigPage, SearchUpdateHdl ));
m_pSearchEdit->EnableUpdateData();
+
+ m_pFunctions->SetSelectHdl(
+ LINK( this, SvxConfigPage, SelectFunctionHdl ) );
}
SvxConfigPage::~SvxConfigPage()
@@ -1772,6 +1775,29 @@ IMPL_LINK( SvxConfigPage, MoveHdl, Button *, pButton, void )
MoveEntry(pButton == m_pMoveUpButton);
}
+IMPL_LINK_NOARG( SvxConfigPage, SelectFunctionHdl, SvTreeListBox *, void )
+{
+ // GetScriptURL() returns a non-empty string if a
+ // valid command is selected on the left box
+ bool bIsValidCommand = !GetScriptURL().isEmpty();
+
+ // Enable/disable Add and Remove buttons depending on current selection
+ if (bIsValidCommand)
+ {
+ m_pAddCommandButton->Enable();
+ m_pRemoveCommandButton->Enable();
+
+ m_pDescriptionField->SetText( m_pFunctions->GetHelpText() );
+ }
+ else
+ {
+ m_pAddCommandButton->Disable();
+ m_pRemoveCommandButton->Disable();
+
+ m_pDescriptionField->SetText("");
+ }
+}
+
IMPL_LINK_NOARG(SvxConfigPage, SearchUpdateHdl, Edit&, void)
{
OUString aSearchTerm( m_pSearchEdit->GetText() );
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index bddd41a4307b..c7190648e3cd 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -424,6 +424,7 @@ protected:
SvxConfigPage( vcl::Window*, const SfxItemSet& );
DECL_LINK( MoveHdl, Button *, void );
+ DECL_LINK( SelectFunctionHdl, SvTreeListBox *, void );
virtual SaveInData* CreateSaveInData(
const css::uno::Reference< css::ui::XUIConfigurationManager >&,
More information about the Libreoffice-commits
mailing list