[Libreoffice-commits] core.git: Branch 'feature/gsoc17-revamp-customize-dialog' - cui/source

Muhammet Kara muhammet.kara at pardus.org.tr
Fri Aug 18 15:59:02 UTC 2017


 cui/source/customize/SvxMenuConfigPage.cxx    |   12 ++++++++----
 cui/source/customize/SvxToolbarConfigPage.cxx |    8 ++++----
 cui/source/inc/SvxMenuConfigPage.hxx          |    2 +-
 cui/source/inc/SvxToolbarConfigPage.hxx       |    2 +-
 4 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit bfb7ab019ecc21c07c094d0f8a537f058877dbd9
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Fri Aug 18 09:56:52 2017 +0300

    Implement "Remove" button in the Customize dialog
    
    By using the already implemented DeleteSelectedContent function.
    
    Now toolbar and menu/context menu items can be removed by using
    the "Remove" (Left Arrow) button which is between the commands
    list and the enrtries list boxes.
    
    Change-Id: If445ec6d431bc10263d961563bdd204e7868b931
    Reviewed-on: https://gerrit.libreoffice.org/41272
    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 eafed333422f..336a769cea5e 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -126,7 +126,7 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
     m_pMoveDownButton->SetClickHdl ( LINK( this, SvxConfigPage, MoveHdl) );
 
     m_pAddCommandButton->SetClickHdl( LINK( this, SvxMenuConfigPage, AddCommandHdl ) );
-    //m_pRemoveCommandButton->SetClickHdl( LINK( this, SvxMenuConfigPage, RemoveCommandHdl ) );
+    m_pRemoveCommandButton->SetClickHdl( LINK( this, SvxMenuConfigPage, RemoveCommandHdl ) );
 }
 
 SvxMenuConfigPage::~SvxMenuConfigPage()
@@ -297,10 +297,14 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, AddCommandHdl, Button *, void )
     AddFunction();
 }
 
-/*IMPL_LINK_NOARG( SvxMenuConfigPage, RemoveCommandHdl, Button *, void )
+IMPL_LINK_NOARG( SvxMenuConfigPage, RemoveCommandHdl, Button *, void )
 {
-    //TODO:Implement
-}*/
+    DeleteSelectedContent();
+    if ( GetSaveInData()->IsModified() )
+    {
+        UpdateButtonStates();
+    }
+}
 
 SaveInData* SvxMenuConfigPage::CreateSaveInData(
     const css::uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr,
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 43bf0a5aaa60..df92295c5444 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -136,7 +136,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
     m_pMoveUpButton->Enable();
 
     m_pAddCommandButton->SetClickHdl( LINK( this, SvxToolbarConfigPage, AddCommandHdl ) );
-    //m_pRemoveCommandButton->SetClickHdl( LINK( this, SvxToolbarConfigPage, RemoveCommandHdl ) );
+    m_pRemoveCommandButton->SetClickHdl( LINK( this, SvxToolbarConfigPage, RemoveCommandHdl ) );
 
     // default toolbar to select is standardbar unless a different one
     // has been passed in
@@ -329,10 +329,10 @@ IMPL_LINK_NOARG( SvxToolbarConfigPage, AddCommandHdl, Button *, void )
     AddFunction();
 }
 
-/*IMPL_LINK_NOARG( SvxToolbarConfigPage, RemoveCommandHdl, Button *, void )
+IMPL_LINK_NOARG( SvxToolbarConfigPage, RemoveCommandHdl, Button *, void )
 {
-    //TODO:Implement
-}*/
+    DeleteSelectedContent();
+}
 
 
 void SvxToolbarConfigPage::UpdateButtonStates()
diff --git a/cui/source/inc/SvxMenuConfigPage.hxx b/cui/source/inc/SvxMenuConfigPage.hxx
index 9110edeeaf9d..162adc94c198 100644
--- a/cui/source/inc/SvxMenuConfigPage.hxx
+++ b/cui/source/inc/SvxMenuConfigPage.hxx
@@ -57,7 +57,7 @@ private:
     DECL_LINK( SelectCategory, ListBox&, void );
 
     DECL_LINK( AddCommandHdl, Button *, void );
-    //DECL_LINK( RemoveCommandHdl, Button *, void );
+    DECL_LINK( RemoveCommandHdl, Button *, void );
 
     void            Init() override;
     void            UpdateButtonStates() override;
diff --git a/cui/source/inc/SvxToolbarConfigPage.hxx b/cui/source/inc/SvxToolbarConfigPage.hxx
index e4721553477f..29e48078b596 100644
--- a/cui/source/inc/SvxToolbarConfigPage.hxx
+++ b/cui/source/inc/SvxToolbarConfigPage.hxx
@@ -58,7 +58,7 @@ private:
     DECL_LINK( SelectCategory, ListBox&, void );
 
     DECL_LINK( AddCommandHdl, Button *, void );
-    //DECL_LINK( RemoveCommandHdl, Button *, void );
+    DECL_LINK( RemoveCommandHdl, Button *, void );
 
     void            UpdateButtonStates() override;
     short           QueryReset() override;


More information about the Libreoffice-commits mailing list