summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-30 17:27:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-30 20:58:20 +0000
commit4649a2c6b3323622336b9713f90526fbb039bb39 (patch)
tree53fac8f9a1286c75db6e082abb391546be1cb723 /cui
parent20ca0d67e709ea798337f4020ba98dfc9ee4543c (diff)
convert toolbar config context menu to .ui
Change-Id: I8f8a9517680f02cb8efa3e6e46d3d4ebf7da1510
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx407
-rw-r--r--cui/source/customize/cfg.hrc34
-rw-r--r--cui/source/customize/cfg.src55
-rw-r--r--cui/source/inc/cfg.hxx4
-rw-r--r--cui/uiconfig/ui/menuassignpage.ui60
5 files changed, 261 insertions, 299 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 21c66b27457c..e10ecd7ddf4b 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -52,7 +52,6 @@
#include <algorithm>
#include <cuires.hrc>
-#include "cfg.hrc"
#include "helpid.hrc"
#include "acccfg.hxx"
@@ -3122,8 +3121,8 @@ bool SvxConfigEntry::IsRenamable()
SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
: SvxConfigPage(pParent, rSet)
- , m_pMenu(CUI_RES(MODIFY_TOOLBAR))
- , m_pEntry(CUI_RES(MODIFY_TOOLBAR_CONTENT))
+ , m_pMenu(get_menu("modifymenu"))
+ , m_pEntry(get_menu("contentmenu"))
{
SetHelpId( HID_SVX_CONFIG_TOOLBAR );
@@ -3243,8 +3242,8 @@ void SvxToolbarConfigPage::dispose()
}
m_pSaveInListBox->Clear();
- m_pEntry.disposeAndClear();
- m_pMenu.disposeAndClear();
+ m_pEntry.clear();
+ m_pMenu.clear();
SvxConfigPage::dispose();
}
@@ -3349,38 +3348,35 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, void )
ToolbarSaveInData* pSaveInData = static_cast<ToolbarSaveInData*>( GetSaveInData() );
- switch( pButton->GetCurItemId() )
+ OString sCommand = m_pMenu->GetItemIdent(pButton->GetCurItemId());
+
+ if (sCommand == "modtooldelete")
{
- case ID_DELETE:
- {
- DeleteSelectedTopLevel();
- UpdateButtonStates();
- break;
- }
- case ID_RENAME:
- {
- OUString aNewName( stripHotKey( pToolbar->GetName() ) );
- OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
+ DeleteSelectedTopLevel();
+ UpdateButtonStates();
+ }
+ else if (sCommand == "modtoolrename")
+ {
+ OUString aNewName( stripHotKey( pToolbar->GetName() ) );
+ OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
- pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
+ pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
- if ( pNameDialog->Execute() == RET_OK )
- {
- pNameDialog->GetName(aNewName);
+ if ( pNameDialog->Execute() == RET_OK )
+ {
+ pNameDialog->GetName(aNewName);
- pToolbar->SetName( aNewName );
- pSaveInData->ApplyToolbar( pToolbar );
+ pToolbar->SetName( aNewName );
+ pSaveInData->ApplyToolbar( pToolbar );
- // have to use remove and insert to change the name
- m_pTopLevelListBox->RemoveEntry( nSelectionPos );
- nSelectionPos =
- m_pTopLevelListBox->InsertEntry( aNewName, nSelectionPos );
- m_pTopLevelListBox->SetEntryData( nSelectionPos, pToolbar );
- m_pTopLevelListBox->SelectEntryPos( nSelectionPos );
- }
- break;
+ // have to use remove and insert to change the name
+ m_pTopLevelListBox->RemoveEntry( nSelectionPos );
+ nSelectionPos =
+ m_pTopLevelListBox->InsertEntry( aNewName, nSelectionPos );
+ m_pTopLevelListBox->SetEntryData( nSelectionPos, pToolbar );
+ m_pTopLevelListBox->SelectEntryPos( nSelectionPos );
}
}
}
@@ -3392,231 +3388,226 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton, void )
// get currently selected toolbar
SvxConfigEntry* pToolbar = GetTopLevelSelection();
- switch( pButton->GetCurItemId() )
+ OString sCommand = m_pEntry->GetItemIdent(pButton->GetCurItemId());
+
+ if (sCommand == "toolrename")
{
- case ID_RENAME:
- {
- SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
+ SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
+ SvxConfigEntry* pEntry =
+ static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
- OUString aNewName( stripHotKey( pEntry->GetName() ) );
- OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
+ OUString aNewName( stripHotKey( pEntry->GetName() ) );
+ OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
- pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
+ pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
- if ( pNameDialog->Execute() == RET_OK ) {
- pNameDialog->GetName(aNewName);
+ if ( pNameDialog->Execute() == RET_OK ) {
+ pNameDialog->GetName(aNewName);
- if( aNewName.isEmpty() ) //tdf#80758 - Accelerator character ("~") is passed as
- pEntry->SetName( "~" ); // the button name in case of empty values.
- else
- pEntry->SetName( aNewName );
+ if( aNewName.isEmpty() ) //tdf#80758 - Accelerator character ("~") is passed as
+ pEntry->SetName( "~" ); // the button name in case of empty values.
+ else
+ pEntry->SetName( aNewName );
- m_pContentsListBox->SetEntryText( pActEntry, aNewName );
- bNeedsApply = true;
- }
- break;
+ m_pContentsListBox->SetEntryText( pActEntry, aNewName );
+ bNeedsApply = true;
}
- case ID_DEFAULT_COMMAND:
- {
- SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
+ }
+ else if (sCommand == "toolrestore")
+ {
+ SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
+ SvxConfigEntry* pEntry =
+ static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
- sal_uInt16 nSelectionPos = 0;
+ sal_uInt16 nSelectionPos = 0;
- // find position of entry within the list
- for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ // find position of entry within the list
+ for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ {
+ if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
{
- if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
+ nSelectionPos = i;
+ break;
}
+ }
- ToolbarSaveInData* pSaveInData =
- static_cast<ToolbarSaveInData*>( GetSaveInData() );
+ ToolbarSaveInData* pSaveInData =
+ static_cast<ToolbarSaveInData*>( GetSaveInData() );
- OUString aSystemName =
- pSaveInData->GetSystemUIName( pEntry->GetCommand() );
+ OUString aSystemName =
+ pSaveInData->GetSystemUIName( pEntry->GetCommand() );
- if ( !pEntry->GetName().equals( aSystemName ) )
- {
- pEntry->SetName( aSystemName );
- m_pContentsListBox->SetEntryText(
- pActEntry, stripHotKey( aSystemName ) );
- bNeedsApply = true;
- }
+ if ( !pEntry->GetName().equals( aSystemName ) )
+ {
+ pEntry->SetName( aSystemName );
+ m_pContentsListBox->SetEntryText(
+ pActEntry, stripHotKey( aSystemName ) );
+ bNeedsApply = true;
+ }
- uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
+ uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
- try
- {
- GetSaveInData()->GetImageManager()->removeImages(
- GetImageType(), aURLSeq );
+ try
+ {
+ GetSaveInData()->GetImageManager()->removeImages(
+ GetImageType(), aURLSeq );
- // reset backup in entry
- pEntry->SetBackupGraphic(
- uno::Reference< graphic::XGraphic >() );
+ // reset backup in entry
+ pEntry->SetBackupGraphic(
+ uno::Reference< graphic::XGraphic >() );
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
+ GetSaveInData()->PersistChanges(
+ GetSaveInData()->GetImageManager() );
- m_pContentsListBox->GetModel()->Remove( pActEntry );
+ m_pContentsListBox->GetModel()->Remove( pActEntry );
- SvTreeListEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
+ SvTreeListEntry* pNewLBEntry =
+ InsertEntryIntoUI( pEntry, nSelectionPos );
- m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SvButtonState::Checked : SvButtonState::Unchecked );
+ m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
+ pEntry->IsVisible() ?
+ SvButtonState::Checked : SvButtonState::Unchecked );
- m_pContentsListBox->Select( pNewLBEntry );
- m_pContentsListBox->MakeVisible( pNewLBEntry );
+ m_pContentsListBox->Select( pNewLBEntry );
+ m_pContentsListBox->MakeVisible( pNewLBEntry );
- bNeedsApply = true;
- }
- catch ( uno::Exception& )
- {
- SAL_WARN("cui.customize", "Error restoring image");
- }
- break;
+ bNeedsApply = true;
}
- case ID_CHANGE_SYMBOL:
+ catch ( uno::Exception& )
{
- SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
+ SAL_WARN("cui.customize", "Error restoring image");
+ }
+ }
+ else if (sCommand == "toolchange")
+ {
+ SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
+ SvxConfigEntry* pEntry =
+ static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
- sal_uInt16 nSelectionPos = 0;
+ sal_uInt16 nSelectionPos = 0;
- // find position of entry within the list
- for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ // find position of entry within the list
+ for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ {
+ if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
{
- if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
+ nSelectionPos = i;
+ break;
}
+ }
- ScopedVclPtr<SvxIconSelectorDialog> pIconDialog(
- VclPtr<SvxIconSelectorDialog>::Create( nullptr,
- GetSaveInData()->GetImageManager(),
- GetSaveInData()->GetParentImageManager() ));
+ ScopedVclPtr<SvxIconSelectorDialog> pIconDialog(
+ VclPtr<SvxIconSelectorDialog>::Create( nullptr,
+ GetSaveInData()->GetImageManager(),
+ GetSaveInData()->GetParentImageManager() ));
- if ( pIconDialog->Execute() == RET_OK )
+ if ( pIconDialog->Execute() == RET_OK )
+ {
+ uno::Reference< graphic::XGraphic > newgraphic =
+ pIconDialog->GetSelectedIcon();
+
+ if ( newgraphic.is() )
{
- uno::Reference< graphic::XGraphic > newgraphic =
- pIconDialog->GetSelectedIcon();
+ uno::Sequence< uno::Reference< graphic::XGraphic > >
+ aGraphicSeq( 1 );
- if ( newgraphic.is() )
- {
- uno::Sequence< uno::Reference< graphic::XGraphic > >
- aGraphicSeq( 1 );
+ uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
- uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
+ if ( !pEntry->GetBackupGraphic().is() )
+ {
+ uno::Reference< graphic::XGraphic > backup;
+ backup = GetGraphic(
+ GetSaveInData()->GetImageManager(), aURLSeq[ 0 ] );
- if ( !pEntry->GetBackupGraphic().is() )
+ if ( backup.is() )
{
- uno::Reference< graphic::XGraphic > backup;
- backup = GetGraphic(
- GetSaveInData()->GetImageManager(), aURLSeq[ 0 ] );
-
- if ( backup.is() )
- {
- pEntry->SetBackupGraphic( backup );
- }
+ pEntry->SetBackupGraphic( backup );
}
+ }
- aGraphicSeq[ 0 ] = newgraphic;
- try
- {
- GetSaveInData()->GetImageManager()->replaceImages(
- GetImageType(), aURLSeq, aGraphicSeq );
+ aGraphicSeq[ 0 ] = newgraphic;
+ try
+ {
+ GetSaveInData()->GetImageManager()->replaceImages(
+ GetImageType(), aURLSeq, aGraphicSeq );
- m_pContentsListBox->GetModel()->Remove( pActEntry );
- SvTreeListEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
+ m_pContentsListBox->GetModel()->Remove( pActEntry );
+ SvTreeListEntry* pNewLBEntry =
+ InsertEntryIntoUI( pEntry, nSelectionPos );
- m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SvButtonState::Checked : SvButtonState::Unchecked );
+ m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
+ pEntry->IsVisible() ?
+ SvButtonState::Checked : SvButtonState::Unchecked );
- m_pContentsListBox->Select( pNewLBEntry );
- m_pContentsListBox->MakeVisible( pNewLBEntry );
+ m_pContentsListBox->Select( pNewLBEntry );
+ m_pContentsListBox->MakeVisible( pNewLBEntry );
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
- }
- catch ( uno::Exception& )
- {
- SAL_WARN("cui.customize", "Error replacing image");
- }
+ GetSaveInData()->PersistChanges(
+ GetSaveInData()->GetImageManager() );
+ }
+ catch ( uno::Exception& )
+ {
+ SAL_WARN("cui.customize", "Error replacing image");
}
}
- break;
}
- case ID_RESET_SYMBOL:
- {
- SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
+ }
+ else if (sCommand == "toolreset")
+ {
+ SvTreeListEntry* pActEntry = m_pContentsListBox->GetCurEntry();
+ SvxConfigEntry* pEntry =
+ static_cast<SvxConfigEntry*>(pActEntry->GetUserData());
- sal_uInt16 nSelectionPos = 0;
+ sal_uInt16 nSelectionPos = 0;
- // find position of entry within the list
- for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ // find position of entry within the list
+ for ( sal_uLong i = 0; i < m_pContentsListBox->GetEntryCount(); ++i )
+ {
+ if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
{
- if ( m_pContentsListBox->GetEntry( nullptr, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
+ nSelectionPos = i;
+ break;
}
+ }
- uno::Reference< graphic::XGraphic > backup =
- pEntry->GetBackupGraphic();
+ uno::Reference< graphic::XGraphic > backup =
+ pEntry->GetBackupGraphic();
- uno::Sequence< uno::Reference< graphic::XGraphic > >
- aGraphicSeq( 1 );
- aGraphicSeq[ 0 ] = backup;
+ uno::Sequence< uno::Reference< graphic::XGraphic > >
+ aGraphicSeq( 1 );
+ aGraphicSeq[ 0 ] = backup;
- uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
+ uno::Sequence<OUString> aURLSeq { pEntry->GetCommand() };
- try
- {
- GetSaveInData()->GetImageManager()->replaceImages(
- GetImageType(), aURLSeq, aGraphicSeq );
+ try
+ {
+ GetSaveInData()->GetImageManager()->replaceImages(
+ GetImageType(), aURLSeq, aGraphicSeq );
- m_pContentsListBox->GetModel()->Remove( pActEntry );
+ m_pContentsListBox->GetModel()->Remove( pActEntry );
- SvTreeListEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
+ SvTreeListEntry* pNewLBEntry =
+ InsertEntryIntoUI( pEntry, nSelectionPos );
- m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SvButtonState::Checked : SvButtonState::Unchecked );
+ m_pContentsListBox->SetCheckButtonState( pNewLBEntry,
+ pEntry->IsVisible() ?
+ SvButtonState::Checked : SvButtonState::Unchecked );
- m_pContentsListBox->Select( pNewLBEntry );
- m_pContentsListBox->MakeVisible( pNewLBEntry );
+ m_pContentsListBox->Select( pNewLBEntry );
+ m_pContentsListBox->MakeVisible( pNewLBEntry );
- // reset backup in entry
- pEntry->SetBackupGraphic(
- uno::Reference< graphic::XGraphic >() );
+ // reset backup in entry
+ pEntry->SetBackupGraphic(
+ uno::Reference< graphic::XGraphic >() );
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
- }
- catch ( uno::Exception& )
- {
- SAL_WARN("cui.customize", "Error resetting image");
- }
- break;
+ GetSaveInData()->PersistChanges(
+ GetSaveInData()->GetImageManager() );
+ }
+ catch ( uno::Exception& )
+ {
+ SAL_WARN("cui.customize", "Error resetting image");
}
}
@@ -4471,10 +4462,10 @@ IMPL_LINK_NOARG( SvxToolbarConfigPage, SelectToolbarEntry, SvTreeListBox *, void
void SvxToolbarConfigPage::UpdateButtonStates()
{
PopupMenu* pPopup = m_pModifyCommandButton->GetPopupMenu();
- pPopup->EnableItem( ID_RENAME, false );
- pPopup->EnableItem( ID_DEFAULT_COMMAND, false );
- pPopup->EnableItem( ID_CHANGE_SYMBOL, false );
- pPopup->EnableItem( ID_RESET_SYMBOL, false );
+ pPopup->EnableItem(pPopup->GetItemId("toolrename"), false);
+ pPopup->EnableItem(pPopup->GetItemId("toolrestore"), false);
+ pPopup->EnableItem(pPopup->GetItemId("toolchange"), false);
+ pPopup->EnableItem(pPopup->GetItemId("toolreset"), false);
m_pDeleteCommandButton->Enable( false );
m_pAddSeparatorButton->Enable( false );
@@ -4494,17 +4485,17 @@ void SvxToolbarConfigPage::UpdateButtonStates()
}
else
{
- pPopup->EnableItem( ID_RENAME );
- pPopup->EnableItem( ID_CHANGE_SYMBOL );
+ pPopup->EnableItem(pPopup->GetItemId("toolrename"));
+ pPopup->EnableItem(pPopup->GetItemId("toolchange"));
m_pDeleteCommandButton->Enable();
m_pAddSeparatorButton->Enable();
if ( !pEntryData->IsUserDefined() )
- pPopup->EnableItem( ID_DEFAULT_COMMAND );
+ pPopup->EnableItem(pPopup->GetItemId("toolrestore"));
if ( pEntryData->IsIconModified() )
- pPopup->EnableItem( ID_RESET_SYMBOL );
+ pPopup->EnableItem(pPopup->GetItemId("toolreset"));
m_pDescriptionField->SetText(pEntryData->GetHelpText());
}
@@ -4555,8 +4546,8 @@ IMPL_LINK_NOARG( SvxToolbarConfigPage, SelectToolbar, ListBox&, void )
PopupMenu* pPopup = m_pModifyTopLevelButton->GetPopupMenu();
- pPopup->EnableItem( ID_DELETE, pToolbar->IsDeletable() );
- pPopup->EnableItem( ID_RENAME, pToolbar->IsRenamable() );
+ pPopup->EnableItem(m_pMenu->GetItemId("modtooldelete"), pToolbar->IsDeletable());
+ pPopup->EnableItem(m_pMenu->GetItemId("modtoolrename"), pToolbar->IsRenamable());
switch( pToolbar->GetStyle() )
{
diff --git a/cui/source/customize/cfg.hrc b/cui/source/customize/cfg.hrc
deleted file mode 100644
index 5f7a37413a89..000000000000
--- a/cui/source/customize/cfg.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define CFG_OFFSET 300
-
-#define ID_RENAME (42 + CFG_OFFSET)
-#define ID_MOVE (43 + CFG_OFFSET)
-#define ID_DELETE (44 + CFG_OFFSET)
-
-// There is a gap here
-#define ID_CHANGE_SYMBOL (53 + CFG_OFFSET)
-#define ID_RESET_SYMBOL (54 + CFG_OFFSET)
-#define ID_DEFAULT_COMMAND (55 + CFG_OFFSET)
-
-#define MODIFY_TOOLBAR (60 + CFG_OFFSET)
-#define MODIFY_TOOLBAR_CONTENT (61 + CFG_OFFSET)
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/cfg.src b/cui/source/customize/cfg.src
index 306e5d8fe776..3d6f4cc48121 100644
--- a/cui/source/customize/cfg.src
+++ b/cui/source/customize/cfg.src
@@ -17,63 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cuires.hrc>
-#include "cfg.hrc"
#include "helpid.hrc"
-#define TEXT_RENAME \
- Text [ en-US ] = "Rename..." ;\
-
-#define TEXT_DELETE_NODOTS \
- Text [ en-US ] = "Delete" ;\
-
-Menu MODIFY_TOOLBAR
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Identifier = ID_DELETE ;
- TEXT_DELETE_NODOTS
- };
- };
-};
-
-Menu MODIFY_TOOLBAR_CONTENT
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Identifier = ID_DEFAULT_COMMAND ;
- Text [ en-US ] = "Restore Default Command" ;
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_CHANGE_SYMBOL ;
- Text [ en-US ] = "Change Icon..." ;
- };
- MenuItem
- {
- Identifier = ID_RESET_SYMBOL ;
- Text [ en-US ] = "Reset Icon" ;
- };
- };
-};
-
/* %n will be replaced at runtime by a number starting with 1 and increasing as necessary */
String RID_SVXSTR_NEW_MENU
{
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index d41568e4aa4c..0b2556b71f40 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -592,8 +592,8 @@ private:
void DeleteSelectedContent() override;
void DeleteSelectedTopLevel() override;
- VclPtrInstance<PopupMenu> m_pMenu;
- VclPtrInstance<PopupMenu> m_pEntry;
+ VclPtr<PopupMenu> m_pMenu;
+ VclPtr<PopupMenu> m_pEntry;
public:
SvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index e15ae5dad812..435a33e9737a 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -2,6 +2,48 @@
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.10"/>
+ <object class="GtkMenu" id="contentmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="toolrename">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Rename...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="toolrestore">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Restore Default Command</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="menuitem9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="toolchange">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Change Icon...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="toolreset">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Reset Icon</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -627,6 +669,24 @@
</object>
</child>
</object>
+ <object class="GtkMenu" id="modifymenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="modtoolrename">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Rename...</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="modtooldelete">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Delete</property>
+ </object>
+ </child>
+ </object>
<object class="GtkMenu" id="modmenu">
<property name="visible">True</property>
<property name="can_focus">False</property>