[Libreoffice-commits] core.git: 2 commits - framework/inc framework/source include/svtools svtools/source svtools/uiconfig svtools/UIConfig_svt.mk

Caolán McNamara caolanm at redhat.com
Fri Apr 14 10:52:01 UTC 2017


 framework/inc/classes/resource.hrc            |    8 +
 framework/source/classes/resource.src         |   75 +++++----------
 framework/source/uielement/toolbarmanager.cxx |  126 +++++++++++++++-----------
 include/svtools/helpid.hrc                    |    5 -
 include/svtools/svtools.hrc                   |    2 
 svtools/UIConfig_svt.mk                       |    1 
 svtools/source/contnr/fileview.cxx            |   36 +++----
 svtools/source/contnr/fileview.hrc            |   23 ----
 svtools/source/contnr/fileview.src            |   22 ----
 svtools/uiconfig/ui/fileviewmenu.ui           |   25 +++++
 10 files changed, 151 insertions(+), 172 deletions(-)

New commits:
commit c6e96bb4519176edc8668e5a8ec20b43863cd61b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 14 11:49:47 2017 +0100

    rework POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION
    
    don't create a menu in order to copy certain entries under certain
    conditions to another menu, just insert the specific entries
    from more elemental parts
    
    Change-Id: I2254753fdc374742422afdb40fed7e78ae5dfbb2

diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index 6075d10293cb..b4325e7f23ec 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -49,13 +49,17 @@
 #define STR_LANGSTATUS_HINT                     (RID_STR_START+25)
 #define STR_REMOTE_TITLE                        (RID_STR_START+26)
 #define STR_SAFEMODE_TITLE                      (RID_STR_START+27)
+#define STR_TOOLBAR_VISIBLE_BUTTONS             (RID_STR_START+28)
+#define STR_TOOLBAR_CUSTOMIZE_TOOLBAR           (RID_STR_START+29)
+#define STR_TOOLBAR_DOCK_TOOLBAR                (RID_STR_START+30)
+#define STR_TOOLBAR_DOCK_ALL_TOOLBARS           (RID_STR_START+31)
+#define STR_TOOLBAR_LOCK_TOOLBAR                (RID_STR_START+32)
+#define STR_TOOLBAR_CLOSE_TOOLBAR               (RID_STR_START+33)
 
 #define BMP_SAVEMODIFIED_SMALL                  (RID_IMAGE_START+0)
 #define BMP_SAVEMODIFIED_LARGE                  (RID_IMAGE_START+1)
 #define BMP_SAVEMODIFIED_EXTRALARGE             (RID_IMAGE_START+2)
 
-#define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION    (RID_MENU_START+0)
-
 #define MENUITEM_TOOLBAR_VISIBLEBUTTON          1
 #define MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR       2
 #define MENUITEM_TOOLBAR_DOCKTOOLBAR            3
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index 998d3721797c..b045b6d9e029 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -39,53 +39,34 @@ String STR_CLOSEDOC_ANDRETURN
     Text [ en-US ] = "~Close & Return to " ;
 };
 
-Menu POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_VISIBLEBUTTON;
-            SubMenu = Menu
-            {
-            };
-            Text[ en-US ] = "Visible ~Buttons";
-        };
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR;
-            Command = ".uno:ConfigureToolboxVisible" ;
-            Text[ en-US ] = "~Customize Toolbar...";
-        };
-        MenuItem
-        {
-            Separator = TRUE ;
-        };
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_DOCKTOOLBAR;
-            Text[ en-US ] = "~Dock Toolbar" ;
-        };
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_DOCKALLTOOLBAR;
-            Text[ en-US ] = "Dock ~All Toolbars" ;
-        };
-        MenuItem
-        {
-            Separator = TRUE ;
-        };
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION;
-            Text[ en-US ] = "~Lock Toolbar Position" ;
-        };
-        MenuItem
-        {
-            Identifier = MENUITEM_TOOLBAR_CLOSE;
-            Text[ en-US ] = "Close ~Toolbar" ;
-        };
-    };
+String STR_TOOLBAR_VISIBLE_BUTTONS
+{
+    Text[ en-US ] = "Visible ~Buttons";
+};
+
+String STR_TOOLBAR_CUSTOMIZE_TOOLBAR
+{
+    Text[ en-US ] = "~Customize Toolbar...";
+};
+
+String STR_TOOLBAR_DOCK_TOOLBAR
+{
+    Text[ en-US ] = "~Dock Toolbar" ;
+};
+
+String STR_TOOLBAR_DOCK_ALL_TOOLBARS
+{
+    Text[ en-US ] = "Dock ~All Toolbars" ;
+};
+
+String STR_TOOLBAR_LOCK_TOOLBAR
+{
+    Text[ en-US ] = "~Lock Toolbar Position" ;
+};
+
+String STR_TOOLBAR_CLOSE_TOOLBAR
+{
+    Text[ en-US ] = "Close ~Toolbar" ;
 };
 
 String STR_SAVECOPYDOC
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 0ad9f1a01f85..0f792ccb0519 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1399,8 +1399,6 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
 
 void ToolBarManager::AddCustomizeMenuItems(ToolBox* pToolBar)
 {
-    ::PopupMenu *pMenu = pToolBar->GetMenu();
-
     // No config menu entries if command ".uno:ConfigureDialog" is not enabled
     Reference< XDispatch > xDisp;
     css::util::URL aURL;
@@ -1418,12 +1416,56 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox* pToolBar)
 
     // popup menu for quick customization
     bool bHideDisabledEntries = !SvtMenuOptions().IsEntryHidingEnabled();
-    ScopedVclPtrInstance<::PopupMenu> aQuickCustomizationMenu( FwkResId( POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION ));
 
-    if ( m_pToolBar->IsCustomize() )
+    ::PopupMenu *pMenu = pToolBar->GetMenu();
+
+    // copy all menu items 'Visible buttons, Customize toolbar, Dock toolbar,
+    // Dock all Toolbars) from the loaded resource into the toolbar menu
+    sal_uInt16 nGroupLen = pMenu->GetItemCount();
+    if (nGroupLen)
+        pMenu->InsertSeparator();
+
+    VclPtr<PopupMenu> xVisibleItemsPopupMenu;
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_VISIBLEBUTTON))
+    {
+        pMenu->InsertItem(MENUITEM_TOOLBAR_VISIBLEBUTTON, FWK_RESSTR(STR_TOOLBAR_VISIBLE_BUTTONS));
+        xVisibleItemsPopupMenu = VclPtr<PopupMenu>::Create();
+        pMenu->SetPopupMenu(MENUITEM_TOOLBAR_VISIBLEBUTTON, xVisibleItemsPopupMenu);
+    }
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR) && m_pToolBar->IsCustomize())
+    {
+        pMenu->InsertItem(MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, FWK_RESSTR(STR_TOOLBAR_CUSTOMIZE_TOOLBAR));
+        pMenu->SetItemCommand(MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, ".uno:ConfigureToolboxVisible");
+    }
+
+    if (nGroupLen != pMenu->GetItemCount())
     {
-        ::PopupMenu*  pVisibleItemsPopupMenu( aQuickCustomizationMenu->GetPopupMenu( 1 ));
+        pMenu->InsertSeparator();
+        nGroupLen = pMenu->GetItemCount();
+    }
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_DOCKTOOLBAR))
+        pMenu->InsertItem(MENUITEM_TOOLBAR_DOCKTOOLBAR, FWK_RESSTR(STR_TOOLBAR_DOCK_TOOLBAR));
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_DOCKALLTOOLBAR))
+        pMenu->InsertItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, FWK_RESSTR(STR_TOOLBAR_DOCK_ALL_TOOLBARS));
+
+    if (nGroupLen != pMenu->GetItemCount())
+    {
+        pMenu->InsertSeparator();
+        nGroupLen = pMenu->GetItemCount();
+    }
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION))
+        pMenu->InsertItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, FWK_RESSTR(STR_TOOLBAR_LOCK_TOOLBAR));
+
+    if (MenuItemAllowed(MENUITEM_TOOLBAR_CLOSE))
+        pMenu->InsertItem(MENUITEM_TOOLBAR_CLOSE, FWK_RESSTR(STR_TOOLBAR_CLOSE_TOOLBAR));
 
+    if (m_pToolBar->IsCustomize())
+    {
         bool    bIsFloating( false );
 
         DockingManager* pDockMgr = vcl::Window::GetDockingManager();
@@ -1432,52 +1474,51 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox* pToolBar)
 
         if ( !bIsFloating )
         {
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_DOCKTOOLBAR, false );
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false );
+            pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKTOOLBAR, false);
+            pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false);
             Reference< XDockableWindow > xDockable( VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY );
             if( xDockable.is() )
-                aQuickCustomizationMenu->CheckItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, xDockable->isLocked() );
+                pMenu->CheckItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, xDockable->isLocked());
         }
         else
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false );
+            pMenu->EnableItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false);
 
-        if ( SvtMiscOptions().DisableUICustomization() )
+        if (SvtMiscOptions().DisableUICustomization())
         {
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, false );
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, false );
-            aQuickCustomizationMenu->EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false );
+            pMenu->EnableItem(MENUITEM_TOOLBAR_VISIBLEBUTTON, false);
+            pMenu->EnableItem(MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, false);
+            pMenu->EnableItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false);
         }
 
         // Disable menu item CLOSE if the toolbar has no closer
         if( !(pToolBar->GetFloatStyle() & WB_CLOSEABLE) )
-            aQuickCustomizationMenu->EnableItem(MENUITEM_TOOLBAR_CLOSE, false);
+            pMenu->EnableItem(MENUITEM_TOOLBAR_CLOSE, false);
 
         // Temporary stores a Command --> Url map to update contextual menu with the
         // correct icons. The popup icons are by default the same as those in the
         // toolbar. They are not correct for contextual popup menu.
         std::map< OUString, Image > commandToImage;
 
-        // Go through all toolbar items and add them to the context menu
-        for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos )
+        if (xVisibleItemsPopupMenu)
         {
-            if ( m_pToolBar->GetItemType(nPos) == ToolBoxItemType::BUTTON )
+            // Go through all toolbar items and add them to the context menu
+            for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos )
             {
-                sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
-                OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
-                pVisibleItemsPopupMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE );
-                    //TODO: ToolBox::ImplToolItems::size_type -> sal_uInt16!
-                pVisibleItemsPopupMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) );
-                    //TODO: ToolBox::ImplToolItems::size_type -> sal_uInt16!
-                pVisibleItemsPopupMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL );
-                    //TODO: ToolBox::ImplToolItems::size_type -> sal_uInt16!
-                Image aImage(vcl::CommandInfoProvider::GetImageForCommand(aCommandURL, m_xFrame));
-                commandToImage[aCommandURL] = aImage;
-                pVisibleItemsPopupMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, aImage );
-                    //TODO: ToolBox::ImplToolItems::size_type -> sal_uInt16!
-            }
-            else
-            {
-                pVisibleItemsPopupMenu->InsertSeparator();
+                if ( m_pToolBar->GetItemType(nPos) == ToolBoxItemType::BUTTON )
+                {
+                    sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
+                    OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
+                    xVisibleItemsPopupMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE );
+                    xVisibleItemsPopupMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) );
+                    xVisibleItemsPopupMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL );
+                    Image aImage(vcl::CommandInfoProvider::GetImageForCommand(aCommandURL, m_xFrame));
+                    commandToImage[aCommandURL] = aImage;
+                    xVisibleItemsPopupMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, aImage );
+                }
+                else
+                {
+                    xVisibleItemsPopupMenu->InsertSeparator();
+                }
             }
         }
 
@@ -1493,25 +1534,6 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox* pToolBar)
             }
         }
     }
-    else
-    {
-        sal_uInt16 nPos = aQuickCustomizationMenu->GetItemPos( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR );
-        if ( nPos != MENU_ITEM_NOTFOUND )
-            aQuickCustomizationMenu->RemoveItem( nPos );
-    }
-
-    // copy all menu items 'Visible buttons, Customize toolbar, Dock toolbar,
-    // Dock all Toolbars) from the loaded resource into the toolbar menu
-    if( pMenu->GetItemCount() )
-        pMenu->InsertSeparator();
-
-    sal_uInt16 i;
-    for( i=0; i< aQuickCustomizationMenu->GetItemCount(); i++)
-    {
-        sal_uInt16 nId = aQuickCustomizationMenu->GetItemId( i );
-        if ( MenuItemAllowed( nId ))
-            pMenu->CopyItem( *aQuickCustomizationMenu.get(), i );
-    }
 
     // Set the title of the menu
     pMenu->SetText( pToolBar->GetText() );
commit f1489399d50070c17ca7cbf4fa6b67a2bb307c66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 14 10:43:17 2017 +0100

    convert fileview context menu to .ui
    
    Change-Id: I4631b4fa0312c6548a1176872e3a836d377f518c

diff --git a/include/svtools/helpid.hrc b/include/svtools/helpid.hrc
index ecc3fbf45d3c..db1601f7de55 100644
--- a/include/svtools/helpid.hrc
+++ b/include/svtools/helpid.hrc
@@ -24,11 +24,6 @@
 #define HID_FILEDLG_PREVIEW_CB                                 "SVT_HID_FILEDLG_PREVIEW_CB"
 #define HID_FILEDLG_STANDARD                                  "SVT_HID_FILEDLG_STANDARD"
 
-// Help ids for the filepicker dialogs
-// help ids for fileview contextmenu
-#define HID_FILEVIEW_MENU_DELETE                               "SVT_HID_FILEVIEW_MENU_DELETE"
-#define HID_FILEVIEW_MENU_RENAME                               "SVT_HID_FILEVIEW_MENU_RENAME"
-
 // help ids for the different modi of the file picker dialog
 #define HID_FILESAVE_LEVELUP                                   "SVT_HID_FILESAVE_LEVELUP"
 #define HID_FILESAVE_CREATEDIRECTORY                           "SVT_HID_FILESAVE_CREATEDIRECTORY"
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index c75524835b4c..fa134e81c061 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -35,7 +35,7 @@
 #define STR_SVT_GB                      (RID_SVTOOLS_START + 28)
 #define STR_SVT_FILEVIEW_COLUMN_TYPE    (RID_SVTOOLS_START + 29)
 #define STR_FILTERNAME_ALL              (RID_SVTOOLS_START + 30)
-#define RID_FILEVIEW_CONTEXTMENU        (RID_SVTOOLS_START + 31)
+//FREE
 #define STR_SVT_1BIT_THRESHOLD          (RID_SVTOOLS_START + 32)
 #define STR_SVT_1BIT_DITHERED           (RID_SVTOOLS_START + 33)
 #define STR_SVT_4BIT_GRAYSCALE          (RID_SVTOOLS_START + 34)
diff --git a/svtools/UIConfig_svt.mk b/svtools/UIConfig_svt.mk
index dd6182e50125..3aeeff899dd8 100644
--- a/svtools/UIConfig_svt.mk
+++ b/svtools/UIConfig_svt.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,svt))
 
 $(eval $(call gb_UIConfig_add_uifiles,svt,\
 	svtools/uiconfig/ui/addresstemplatedialog \
+	svtools/uiconfig/ui/fileviewmenu \
 	svtools/uiconfig/ui/graphicexport \
 	svtools/uiconfig/ui/GraphicExportOptionsDialog \
 	svtools/uiconfig/ui/javadisableddialog \
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index dbca494e3578..b310c60282ee 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -30,7 +30,6 @@
 #include <svtools/svtools.hrc>
 #include <svtools/viewdataentry.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
-#include "fileview.hrc"
 #include "contentenumeration.hxx"
 #include <svtools/AccessibleBrowseBoxObjType.hxx>
 #include <com/sun/star/util/DateTime.hpp>
@@ -162,6 +161,8 @@ class ViewTabListBox_Impl : public SvHeaderTabListBox
 {
 private:
     Reference< XCommandEnvironment >    mxCmdEnv;
+    std::unique_ptr<VclBuilder> mxBuilder;
+    VclPtr<PopupMenu> mxMenu;
 
     ::osl::Mutex            maMutex;
     VclPtr<HeaderBar>       mpHeaderBar;
@@ -533,7 +534,6 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
     EnableContextMenuHandling();
 }
 
-
 ViewTabListBox_Impl::~ViewTabListBox_Impl()
 {
     disposeOnce();
@@ -543,11 +543,13 @@ void ViewTabListBox_Impl::dispose()
 {
     maResetQuickSearch.Stop();
 
+    mxMenu.disposeAndClear();
+    mxBuilder.reset();
+
     mpHeaderBar.disposeAndClear();
     SvHeaderTabListBox::dispose();
 }
 
-
 IMPL_LINK_NOARG(ViewTabListBox_Impl, ResetQuickSearch_Impl, Timer *, void)
 {
     ::osl::MutexGuard aGuard( maMutex );
@@ -692,32 +694,26 @@ VclPtr<PopupMenu> ViewTabListBox_Impl::CreateContextMenu()
 
     if ( bEnableDelete || bEnableRename )
     {
-        VclPtrInstance<PopupMenu> pRet(SvtResId( RID_FILEVIEW_CONTEXTMENU ));
-        pRet->EnableItem( MID_FILEVIEW_DELETE, bEnableDelete );
-        pRet->EnableItem( MID_FILEVIEW_RENAME, bEnableRename );
-        pRet->RemoveDisabledEntries( true, true );
-        return pRet;
+        mxMenu.disposeAndClear();
+        mxBuilder.reset(new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svt/ui/fileviewmenu.ui", ""));
+        mxMenu.set(mxBuilder->get_menu("menu"));
+        mxMenu->EnableItem(mxMenu->GetItemId("delete"), bEnableDelete);
+        mxMenu->EnableItem(mxMenu->GetItemId("rename"), bEnableRename);
+        mxMenu->RemoveDisabledEntries( true, true );
+        return mxMenu;
     }
 
     return nullptr;
 }
 
-
 void ViewTabListBox_Impl::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
 {
-    switch ( nSelectedPopupEntry )
-    {
-        case MID_FILEVIEW_DELETE :
-            DeleteEntries();
-            break;
-
-        case MID_FILEVIEW_RENAME :
-            EditEntry( FirstSelected() );
-            break;
-    }
+    if (nSelectedPopupEntry == mxMenu->GetItemId("delete"))
+        DeleteEntries();
+    else if (nSelectedPopupEntry == mxMenu->GetItemId("rename"))
+        EditEntry( FirstSelected() );
 }
 
-
 void ViewTabListBox_Impl::ClearAll()
 {
     for ( sal_uLong i = 0; i < GetEntryCount(); ++i )
diff --git a/svtools/source/contnr/fileview.hrc b/svtools/source/contnr/fileview.hrc
deleted file mode 100644
index 94fed39d9d0c..000000000000
--- a/svtools/source/contnr/fileview.hrc
+++ /dev/null
@@ -1,23 +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 MID_FILEVIEW_DELETE     1
-#define MID_FILEVIEW_RENAME     2
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index 8e433edf0a83..7e933e12d3f2 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -18,7 +18,6 @@
  */
 
 #include <svtools/svtools.hrc>
-#include "fileview.hrc"
 #include <svtools/helpid.hrc>
 
 // strings --------------------------------------------------------------------
@@ -73,25 +72,4 @@ Bitmap RID_BMP_FOLDER_OPEN
     File = "folderop.png";
 };
 
-// Menus -----------------------------------------------------------------
-
-Menu RID_FILEVIEW_CONTEXTMENU
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = MID_FILEVIEW_DELETE ;
-            HelpId = HID_FILEVIEW_MENU_DELETE ;
-            Text [ en-US ] = "~Delete";
-        };
-        MenuItem
-        {
-            Identifier = MID_FILEVIEW_RENAME ;
-            HelpId = HID_FILEVIEW_MENU_RENAME ;
-            Text [ en-US ] = "~Rename";
-        };
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/uiconfig/ui/fileviewmenu.ui b/svtools/uiconfig/ui/fileviewmenu.ui
new file mode 100644
index 000000000000..a63f7061abee
--- /dev/null
+++ b/svtools/uiconfig/ui/fileviewmenu.ui
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+  <requires lib="gtk+" version="3.10"/>
+  <object class="GtkMenu" id="menu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="delete">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Delete</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="rename">
+        <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>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list