[nautilus] Migrate menu bar to a view menu button
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Migrate menu bar to a view menu button
- Date: Mon, 2 Jul 2012 22:58:42 +0000 (UTC)
commit faf646539de95824ad19b2d96113ecb3d32cc3b2
Author: William Jon McCann <jmccann redhat com>
Date: Sat May 26 15:25:31 2012 -0400
Migrate menu bar to a view menu button
https://bugzilla.gnome.org/show_bug.cgi?id=676531
src/nautilus-directory-view-ui.xml | 387 ++++++++++++++++++------------------
src/nautilus-icon-view-ui.xml | 99 +++++-----
src/nautilus-list-view-ui.xml | 14 +-
src/nautilus-shell-ui.xml | 150 +++++++--------
src/nautilus-toolbar.c | 56 ++++--
src/nautilus-toolbar.h | 3 +-
src/nautilus-view.c | 12 +-
src/nautilus-window-bookmarks.c | 2 +-
src/nautilus-window-menus.c | 3 +-
src/nautilus-window.c | 11 +-
10 files changed, 371 insertions(+), 366 deletions(-)
---
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index 5334093..2644f9f 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -1,208 +1,207 @@
+<?xml version="1.0" encoding="utf-8"?>
<ui>
<accelerator action="OpenAccel"/>
<accelerator action="OpenCloseParent"/>
<accelerator action="PropertiesAccel"/>
<accelerator action="RenameSelectAll"/>
-<menubar name="MenuBar">
- <menu action="File">
- <placeholder name="New Items Placeholder">
- <menuitem name="New Folder" action="New Folder"/>
- <menuitem name="New Folder with Selection" action="New Folder with Selection"/>
- <menu action="New Documents">
- <placeholder name="New Documents Placeholder"/>
- <separator name="After New Documents"/>
- <menuitem name="New Empty Document" action="New Empty Document"/>
- </menu>
- </placeholder>
- <placeholder name="Open Placeholder">
- <menuitem name="Open" action="Open"/>
- <menuitem name="OpenInNewTab" action="OpenInNewTab"/>
- <menuitem name="OpenAlternate" action="OpenAlternate"/>
- <placeholder name="Applications Placeholder">
- </placeholder>
- <menu action="Open With">
- <placeholder name="Applications Placeholder"/>
- <separator name="Open With Separator"/>
- <menuitem name="OtherApplication" action="OtherApplication1"/>
- </menu>
- <placeholder name="OtherApplicationPlaceholder">
- <menuitem name="OtherApplication" action="OtherApplication2"/>
- </placeholder>
- <menu action="Scripts">
- <placeholder name="Scripts Placeholder"/>
- <separator name="After Scripts"/>
- <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
- </menu>
- </placeholder>
- <placeholder name="File Items Placeholder">
- <menuitem name="Self Mount Volume" action="Self Mount Volume"/>
- <menuitem name="Self Unmount Volume" action="Self Unmount Volume"/>
- <menuitem name="Self Eject Volume" action="Self Eject Volume"/>
- <menuitem name="Self Start Volume" action="Self Start Volume"/>
- <menuitem name="Self Stop Volume" action="Self Stop Volume"/>
- <menuitem name="Self Poll" action="Self Poll"/>
- <separator name="Properties Separator"/>
- <menuitem name="Properties" action="Properties"/>
- </placeholder>
- <placeholder name="Global File Items Placeholder">
- <menuitem name="Empty Trash" action="Empty Trash"/>
- <menuitem name="Save Search" action="Save Search"/>
- <menuitem name="Save Search As" action="Save Search As"/>
- </placeholder>
- </menu>
- <menu action="Edit">
- <placeholder name="Clipboard Actions">
- <menuitem name="Cut" action="Cut"/>
- <menuitem name="Copy" action="Copy"/>
- <menuitem name="Paste" action="Paste"/>
- </placeholder>
- <placeholder name="Undostack Actions">
- <menuitem name="Undo" action="Undo"/>
- <menuitem name="Redo" action="Redo"/>
- </placeholder>
- <placeholder name="Select Items">
- <menuitem name="Select All" action="Select All"/>
- <menuitem name="Select Pattern" action="Select Pattern"/>
- <menuitem name="Invert Selection" action="Invert Selection"/>
- </placeholder>
- <placeholder name="File Items Placeholder">
- <menuitem name="Duplicate" action="Duplicate"/>
- <menuitem name="Create Link" action="Create Link"/>
- <menuitem name="Rename" action="Rename"/>
- </placeholder>
- <placeholder name="Dangerous File Items Placeholder">
- <menuitem name="Trash" action="Trash"/>
- <menuitem name="Delete" action="Delete"/>
- <menuitem name="Restore From Trash" action="Restore From Trash"/>
- </placeholder>
- <placeholder name="Extension Actions"/>
- </menu>
- <menu action="View">
- <placeholder name="View Preferences Placeholder">
- <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
- <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
- </placeholder>
- </menu>
-</menubar>
+<popup name="ViewMenu">
+ <placeholder name="New Items Placeholder">
+ <menuitem name="New Folder" action="New Folder"/>
+ <menuitem name="New Folder with Selection" action="New Folder with Selection"/>
+ <menu action="New Documents">
+ <placeholder name="New Documents Placeholder"/>
+ <separator name="After New Documents"/>
+ <menuitem name="New Empty Document" action="New Empty Document"/>
+ </menu>
+ </placeholder>
+ <placeholder name="Open Placeholder">
+ <menuitem name="Open" action="Open"/>
+ <menuitem name="OpenInNewTab" action="OpenInNewTab"/>
+ <menuitem name="OpenAlternate" action="OpenAlternate"/>
+ <placeholder name="Applications Placeholder">
+ </placeholder>
+ <menu action="Open With">
+ <placeholder name="Applications Placeholder"/>
+ <separator name="Open With Separator"/>
+ <menuitem name="OtherApplication" action="OtherApplication1"/>
+ </menu>
+ <placeholder name="OtherApplicationPlaceholder">
+ <menuitem name="OtherApplication" action="OtherApplication2"/>
+ </placeholder>
+ <menu action="Scripts">
+ <placeholder name="Scripts Placeholder"/>
+ <separator name="After Scripts"/>
+ <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
+ </menu>
+ </placeholder>
+ <placeholder name="File Items Placeholder">
+ <menuitem name="Self Mount Volume" action="Self Mount Volume"/>
+ <menuitem name="Self Unmount Volume" action="Self Unmount Volume"/>
+ <menuitem name="Self Eject Volume" action="Self Eject Volume"/>
+ <menuitem name="Self Start Volume" action="Self Start Volume"/>
+ <menuitem name="Self Stop Volume" action="Self Stop Volume"/>
+ <menuitem name="Self Poll" action="Self Poll"/>
+ <separator name="Properties Separator"/>
+ <menuitem name="Properties" action="Properties"/>
+ </placeholder>
+ <placeholder name="Global File Items Placeholder">
+ <menuitem name="Empty Trash" action="Empty Trash"/>
+ <menuitem name="Save Search" action="Save Search"/>
+ <menuitem name="Save Search As" action="Save Search As"/>
+ </placeholder>
+ <menu action="Edit">
+ <placeholder name="Clipboard Actions">
+ <menuitem name="Cut" action="Cut"/>
+ <menuitem name="Copy" action="Copy"/>
+ <menuitem name="Paste" action="Paste"/>
+ </placeholder>
+ <placeholder name="Undostack Actions">
+ <menuitem name="Undo" action="Undo"/>
+ <menuitem name="Redo" action="Redo"/>
+ </placeholder>
+ <placeholder name="Select Items">
+ <menuitem name="Select All" action="Select All"/>
+ <menuitem name="Select Pattern" action="Select Pattern"/>
+ <menuitem name="Invert Selection" action="Invert Selection"/>
+ </placeholder>
+ <placeholder name="File Items Placeholder">
+ <menuitem name="Duplicate" action="Duplicate"/>
+ <menuitem name="Create Link" action="Create Link"/>
+ <menuitem name="Rename" action="Rename"/>
+ </placeholder>
+ <placeholder name="Dangerous File Items Placeholder">
+ <menuitem name="Trash" action="Trash"/>
+ <menuitem name="Delete" action="Delete"/>
+ <menuitem name="Restore From Trash" action="Restore From Trash"/>
+ </placeholder>
+ <placeholder name="Extension Actions"/>
+ </menu>
+ <menu action="View">
+ <placeholder name="View Preferences Placeholder">
+ <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
+ <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
+ </placeholder>
+ </menu>
+</popup>
<popup name="background">
- <placeholder name="Before Zoom Items">
- <placeholder name="New Object Items">
- <menuitem name="New Folder" action="New Folder"/>
- <menu action="New Documents">
- <placeholder name="New Documents Placeholder"/>
- <separator name="After New Documents"/>
- <menuitem name="New Empty Document" action="New Empty Document"/>
- </menu>
- <menu action="Scripts">
- <placeholder name="Scripts Placeholder"/>
- <separator name="After Scripts"/>
- <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
- </menu>
- </placeholder>
- <separator name="View items separator"/>
- <placeholder name="View Items"/>
- <separator name="Clipboard separator"/>
- <placeholder name="File Clipboard Actions">
- <menuitem name="Paste" action="Paste"/>
- </placeholder>
- </placeholder>
+ <placeholder name="Before Zoom Items">
+ <placeholder name="New Object Items">
+ <menuitem name="New Folder" action="New Folder"/>
+ <menu action="New Documents">
+ <placeholder name="New Documents Placeholder"/>
+ <separator name="After New Documents"/>
+ <menuitem name="New Empty Document" action="New Empty Document"/>
+ </menu>
+ <menu action="Scripts">
+ <placeholder name="Scripts Placeholder"/>
+ <separator name="After Scripts"/>
+ <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
+ </menu>
+ </placeholder>
+ <separator name="View items separator"/>
+ <placeholder name="View Items"/>
+ <separator name="Clipboard separator"/>
+ <placeholder name="File Clipboard Actions">
+ <menuitem name="Paste" action="Paste"/>
+ </placeholder>
+ </placeholder>
- <separator name="Folder Items separator"/>
- <placeholder name="Folder Items Placeholder">
- <menuitem name="Self Mount Volume" action="Self Mount Volume"/>
- <menuitem name="Self Unmount Volume" action="Self Unmount Volume"/>
- <menuitem name="Self Eject Volume" action="Self Eject Volume"/>
- <menuitem name="Self Start Volume" action="Self Start Volume"/>
- <menuitem name="Self Stop Volume" action="Self Stop Volume"/>
- <menuitem name="Self Poll" action="Self Poll"/>
- <separator name="Properties separator"/>
- <menuitem name="Properties" action="Properties"/>
- </placeholder>
+ <separator name="Folder Items separator"/>
+ <placeholder name="Folder Items Placeholder">
+ <menuitem name="Self Mount Volume" action="Self Mount Volume"/>
+ <menuitem name="Self Unmount Volume" action="Self Unmount Volume"/>
+ <menuitem name="Self Eject Volume" action="Self Eject Volume"/>
+ <menuitem name="Self Start Volume" action="Self Start Volume"/>
+ <menuitem name="Self Stop Volume" action="Self Stop Volume"/>
+ <menuitem name="Self Poll" action="Self Poll"/>
+ <separator name="Properties separator"/>
+ <menuitem name="Properties" action="Properties"/>
+ </placeholder>
</popup>
<popup name="selection">
- <placeholder name="New Object Items">
- <menuitem name="New Folder with Selection" action="New Folder with Selection"/>
- <separator name="new folder with selection separator"/>
- </placeholder>
- <placeholder name="Open Placeholder">
- <menuitem name="Open" action="Open"/>
- <menuitem name="OpenInNewTab" action="OpenInNewTab"/>
- <menuitem name="OpenAlternate" action="OpenAlternate"/>
- <separator name="applications separator"/>
- <placeholder name="Applications Placeholder"/>
- <menu action="Open With">
- <placeholder name="Applications Placeholder"/>
- <separator name="open with separator"/>
- <menuitem name="OtherApplication" action="OtherApplication1"/>
- </menu>
- <placeholder name="OtherApplicationPlaceholder">
- <menuitem name="OtherApplication2" action="OtherApplication2"/>
- </placeholder>
- <menu action="Scripts">
- <placeholder name="Scripts Placeholder"/>
- <separator name="After Scripts"/>
- <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
- </menu>
- </placeholder>
- <separator name="Clipboard separator"/>
- <placeholder name="File Clipboard Actions">
- <menuitem name="Cut" action="Cut"/>
- <menuitem name="Copy" action="Copy"/>
- <menuitem name="Paste Files Into" action="Paste Files Into"/>
- </placeholder>
- <separator name="File actions separator"/>
- <placeholder name="File Actions">
- <menuitem name="Properties" action="Properties"/>
- <menuitem name="Rename" action="Rename"/>
- </placeholder>
- <separator name="Dangerous separator"/>
- <placeholder name="Dangerous File Actions">
- <menuitem name="Trash" action="Trash"/>
- <menuitem name="Delete" action="Delete"/>
- <menuitem name="Restore From Trash" action="Restore From Trash"/>
- </placeholder>
- <separator name="Appearance separator"/>
- <placeholder name="Icon Appearance Items">
- </placeholder>
- <separator name="Extension actions separator"/>
- <placeholder name="Extension Actions"/>
- <separator name="Removable separator"/>
- <placeholder name="Removable Media Placeholder">
- <menuitem name="Mount Volume" action="Mount Volume"/>
- <menuitem name="Unmount Volume" action="Unmount Volume"/>
- <menuitem name="Eject Volume" action="Eject Volume"/>
- <menuitem name="Start Volume" action="Start Volume"/>
- <menuitem name="Stop Volume" action="Stop Volume"/>
- <menuitem name="Poll" action="Poll"/>
- </placeholder>
- <menuitem name="Connect To Server Link" action="Connect To Server Link"/>
+ <placeholder name="New Object Items">
+ <menuitem name="New Folder with Selection" action="New Folder with Selection"/>
+ <separator name="new folder with selection separator"/>
+ </placeholder>
+ <placeholder name="Open Placeholder">
+ <menuitem name="Open" action="Open"/>
+ <menuitem name="OpenInNewTab" action="OpenInNewTab"/>
+ <menuitem name="OpenAlternate" action="OpenAlternate"/>
+ <separator name="applications separator"/>
+ <placeholder name="Applications Placeholder"/>
+ <menu action="Open With">
+ <placeholder name="Applications Placeholder"/>
+ <separator name="open with separator"/>
+ <menuitem name="OtherApplication" action="OtherApplication1"/>
+ </menu>
+ <placeholder name="OtherApplicationPlaceholder">
+ <menuitem name="OtherApplication2" action="OtherApplication2"/>
+ </placeholder>
+ <menu action="Scripts">
+ <placeholder name="Scripts Placeholder"/>
+ <separator name="After Scripts"/>
+ <menuitem name="Open Scripts Folder" action="Open Scripts Folder"/>
+ </menu>
+ </placeholder>
+ <separator name="Clipboard separator"/>
+ <placeholder name="File Clipboard Actions">
+ <menuitem name="Cut" action="Cut"/>
+ <menuitem name="Copy" action="Copy"/>
+ <menuitem name="Paste Files Into" action="Paste Files Into"/>
+ </placeholder>
+ <separator name="File actions separator"/>
+ <placeholder name="File Actions">
+ <menuitem name="Properties" action="Properties"/>
+ <menuitem name="Rename" action="Rename"/>
+ </placeholder>
+ <separator name="Dangerous separator"/>
+ <placeholder name="Dangerous File Actions">
+ <menuitem name="Trash" action="Trash"/>
+ <menuitem name="Delete" action="Delete"/>
+ <menuitem name="Restore From Trash" action="Restore From Trash"/>
+ </placeholder>
+ <separator name="Appearance separator"/>
+ <placeholder name="Icon Appearance Items">
+ </placeholder>
+ <separator name="Extension actions separator"/>
+ <placeholder name="Extension Actions"/>
+ <separator name="Removable separator"/>
+ <placeholder name="Removable Media Placeholder">
+ <menuitem name="Mount Volume" action="Mount Volume"/>
+ <menuitem name="Unmount Volume" action="Unmount Volume"/>
+ <menuitem name="Eject Volume" action="Eject Volume"/>
+ <menuitem name="Start Volume" action="Start Volume"/>
+ <menuitem name="Stop Volume" action="Stop Volume"/>
+ <menuitem name="Poll" action="Poll"/>
+ </placeholder>
+ <menuitem name="Connect To Server Link" action="Connect To Server Link"/>
</popup>
<popup name="location">
- <placeholder name="Open Placeholder">
- <menuitem name="LocationOpenInNewTab" action="LocationOpenInNewTab"/>
- <menuitem name="LocationOpenAlternate" action="LocationOpenAlternate"/>
- </placeholder>
- <separator name="Location After Open Separator"/>
- <placeholder name="Clipboard Actions">
- <menuitem name="Cut" action="LocationCut"/>
- <menuitem name="Copy" action="LocationCopy"/>
- <menuitem name="LocationPasteFilesInto" action="LocationPasteFilesInto"/>
- </placeholder>
- <separator name="Location After Clipboard Separator"/>
- <placeholder name="Dangerous File Actions">
- <menuitem name="Trash" action="LocationTrash"/>
- <menuitem name="Delete" action="LocationDelete"/>
- <menuitem name="Restore From Trash" action="LocationRestoreFromTrash"/>
- </placeholder>
- <separator name="Location After Dangerous Separator"/>
- <menuitem name="Location Mount Volume" action="Location Mount Volume"/>
- <menuitem name="Location Unmount Volume" action="Location Unmount Volume"/>
- <menuitem name="Location Eject Volume" action="Location Eject Volume"/>
- <menuitem name="Location Start Volume" action="Location Start Volume"/>
- <menuitem name="Location Stop Volume" action="Location Stop Volume"/>
- <menuitem name="Location Poll" action="Location Poll"/>
- <separator name="Properties Separator"/>
- <menuitem name="LocationProperties" action="LocationProperties"/>
+ <placeholder name="Open Placeholder">
+ <menuitem name="LocationOpenInNewTab" action="LocationOpenInNewTab"/>
+ <menuitem name="LocationOpenAlternate" action="LocationOpenAlternate"/>
+ </placeholder>
+ <separator name="Location After Open Separator"/>
+ <placeholder name="Clipboard Actions">
+ <menuitem name="Cut" action="LocationCut"/>
+ <menuitem name="Copy" action="LocationCopy"/>
+ <menuitem name="LocationPasteFilesInto" action="LocationPasteFilesInto"/>
+ </placeholder>
+ <separator name="Location After Clipboard Separator"/>
+ <placeholder name="Dangerous File Actions">
+ <menuitem name="Trash" action="LocationTrash"/>
+ <menuitem name="Delete" action="LocationDelete"/>
+ <menuitem name="Restore From Trash" action="LocationRestoreFromTrash"/>
+ </placeholder>
+ <separator name="Location After Dangerous Separator"/>
+ <menuitem name="Location Mount Volume" action="Location Mount Volume"/>
+ <menuitem name="Location Unmount Volume" action="Location Unmount Volume"/>
+ <menuitem name="Location Eject Volume" action="Location Eject Volume"/>
+ <menuitem name="Location Start Volume" action="Location Start Volume"/>
+ <menuitem name="Location Stop Volume" action="Location Stop Volume"/>
+ <menuitem name="Location Poll" action="Location Poll"/>
+ <separator name="Properties Separator"/>
+ <menuitem name="LocationProperties" action="LocationProperties"/>
</popup>
</ui>
diff --git a/src/nautilus-icon-view-ui.xml b/src/nautilus-icon-view-ui.xml
index 7c1e70b..b8b2c51 100644
--- a/src/nautilus-icon-view-ui.xml
+++ b/src/nautilus-icon-view-ui.xml
@@ -1,52 +1,51 @@
<ui>
-<menubar name="MenuBar">
- <menu action="Edit">
- <placeholder name="Edit Items Placeholder">
- <menuitem name="Stretch" action="Stretch"/>
- <menuitem name="Unstretch" action="Unstretch"/>
- </placeholder>
- </menu>
- <menu action="View">
- <placeholder name="View Items Placeholder">
- <menu action="Arrange Items">
- <menuitem name="Manual Layout" action="Manual Layout"/>
- <placeholder name="Auto Layout">
- <menuitem name="Sort by Name" action="Sort by Name"/>
- <menuitem name="Sort by Size" action="Sort by Size"/>
- <menuitem name="Sort by Type" action="Sort by Type"/>
- <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
- <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
- </placeholder>
- <separator name="Layout separator"/>
- <menuitem name="Reversed Order" action="Reversed Order"/>
- </menu>
- <menuitem name="Clean Up" action="Clean Up"/>
- <menuitem name="Keep Aligned" action="Keep Aligned"/>
- </placeholder>
-
- </menu>
-</menubar>
-<popup name="background">
- <placeholder name="Before Zoom Items">
- <placeholder name="View Items">
- <menu action="Arrange Items">
- <menuitem name="Manual Layout" action="Manual Layout"/>
- <placeholder name="Auto Layout">
- <menuitem name="Sort by Name" action="Sort by Name"/>
- <menuitem name="Sort by Size" action="Sort by Size"/>
- <menuitem name="Sort by Type" action="Sort by Type"/>
- <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
- <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
- </placeholder>
- <separator name="Layout separator"/>
- <menuitem name="Reversed Order" action="Reversed Order"/>
- </menu>
- <menuitem name="Clean Up" action="Clean Up"/>
- <menuitem name="Keep Aligned" action="Keep Aligned"/>
- </placeholder>
- </placeholder>
-</popup>
-<popup name="selection">
- <placeholder name="Icon Appearance Items"/>
-</popup>
+ <popup name="ViewMenu">
+ <menu action="Edit">
+ <placeholder name="Edit Items Placeholder">
+ <menuitem name="Stretch" action="Stretch"/>
+ <menuitem name="Unstretch" action="Unstretch"/>
+ </placeholder>
+ </menu>
+ <menu action="View">
+ <placeholder name="View Items Placeholder">
+ <menu action="Arrange Items">
+ <menuitem name="Manual Layout" action="Manual Layout"/>
+ <placeholder name="Auto Layout">
+ <menuitem name="Sort by Name" action="Sort by Name"/>
+ <menuitem name="Sort by Size" action="Sort by Size"/>
+ <menuitem name="Sort by Type" action="Sort by Type"/>
+ <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
+ <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
+ </placeholder>
+ <separator name="Layout separator"/>
+ <menuitem name="Reversed Order" action="Reversed Order"/>
+ </menu>
+ <menuitem name="Clean Up" action="Clean Up"/>
+ <menuitem name="Keep Aligned" action="Keep Aligned"/>
+ </placeholder>
+ </menu>
+ </popup>
+ <popup name="background">
+ <placeholder name="Before Zoom Items">
+ <placeholder name="View Items">
+ <menu action="Arrange Items">
+ <menuitem name="Manual Layout" action="Manual Layout"/>
+ <placeholder name="Auto Layout">
+ <menuitem name="Sort by Name" action="Sort by Name"/>
+ <menuitem name="Sort by Size" action="Sort by Size"/>
+ <menuitem name="Sort by Type" action="Sort by Type"/>
+ <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
+ <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
+ </placeholder>
+ <separator name="Layout separator"/>
+ <menuitem name="Reversed Order" action="Reversed Order"/>
+ </menu>
+ <menuitem name="Clean Up" action="Clean Up"/>
+ <menuitem name="Keep Aligned" action="Keep Aligned"/>
+ </placeholder>
+ </placeholder>
+ </popup>
+ <popup name="selection">
+ <placeholder name="Icon Appearance Items"/>
+ </popup>
</ui>
diff --git a/src/nautilus-list-view-ui.xml b/src/nautilus-list-view-ui.xml
index ad9e625..ac3699c 100644
--- a/src/nautilus-list-view-ui.xml
+++ b/src/nautilus-list-view-ui.xml
@@ -1,9 +1,9 @@
<ui>
-<menubar name="MenuBar">
- <menu action="View">
- <placeholder name="View Items Placeholder">
- <menuitem name="Visible Columns" action="Visible Columns"/>
- </placeholder>
- </menu>
-</menubar>
+ <popup name="ViewMenu">
+ <menu action="View">
+ <placeholder name="View Items Placeholder">
+ <menuitem name="Visible Columns" action="Visible Columns"/>
+ </placeholder>
+ </menu>
+ </popup>
</ui>
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index f0307ca..e131abe 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -7,88 +7,74 @@
<accelerator action="ZoomInAccel"/>
<accelerator action="ZoomInAccel2"/>
<accelerator action="ZoomOutAccel"/>
-<menubar name="MenuBar">
- <menu action="File">
- <placeholder name="New Items Placeholder">
- <menuitem name="New Tab" action="New Tab"/>
- <menuitem name="New Window" action="New Window"/>
- </placeholder>
- <separator/>
- <placeholder name="Open Placeholder"/>
- <separator/>
- <placeholder name="Location Placeholder"/>
- <menuitem name="Connect to Server" action="Connect to Server"/>
- <separator/>
- <placeholder name="File Items Placeholder"/>
- <separator/>
- <placeholder name="Global File Items Placeholder"/>
- <separator/>
- <placeholder name="Extension Actions"/>
- <separator/>
- <placeholder name="Close Items Placeholder">
- <menuitem name="Close All Windows" action="Close All Windows"/>
- </placeholder>
- <menuitem name="Close" action="Close"/>
- </menu>
- <menu action="Edit">
- <placeholder name="Undostack Actions"/>
- <separator/>
- <placeholder name="Clipboard Actions">
- </placeholder>
- <separator/>
- <placeholder name="Select Items"/>
- <separator/>
- <placeholder name="File Items Placeholder"/>
- <separator/>
- <placeholder name="Dangerous File Items Placeholder"/>
- <separator/>
- <placeholder name="Edit Items Placeholder"/>
- <placeholder name="Global Edit Items Placeholder"/>
- <separator/>
- <placeholder name="Extension Actions"/>
- <separator/>
- <menuitem name="Preferences" action="Preferences"/>
- </menu>
- <menu action="View">
- <menuitem name="Stop" action="Stop"/>
- <menuitem name="Reload" action="Reload"/>
- <separator/>
- <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
- <separator/>
- <placeholder name="View Preferences Placeholder"/>
- <separator/>
- <placeholder name="View Items Placeholder"/>
- <separator/>
- <placeholder name="Zoom Items Placeholder">
- <menuitem name="Zoom In" action="Zoom In"/>
- <menuitem name="Zoom Out" action="Zoom Out"/>
- <menuitem name="Zoom Normal" action="Zoom Normal"/>
- </placeholder>
- <placeholder name="View Choices">
- <separator name="Before Short List"/>
- <placeholder name="Short List"/>
- </placeholder>
- </menu>
- <placeholder name="Other Menus">
- <menu action="Bookmarks">
- <menuitem name="Add Bookmark" action="Add Bookmark"/>
- <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
- <menuitem name="Go to Location" action="Go to Location"/>
- <separator/>
- <placeholder name="Bookmarks Placeholder"/>
- </menu>
-
- </placeholder>
- <menu action="Help">
- <menuitem action="NautilusHelp"/>
- <menuitem action="NautilusHelpSearch"/>
- <menuitem action="NautilusHelpSort"/>
- <menuitem action="NautilusHelpLost"/>
- <menuitem action="NautilusHelpShare"/>
- <separator/>
- <menuitem name="About Nautilus" action="About Nautilus"/>
- </menu>
-</menubar>
+<popup name="ViewMenu">
+ <placeholder name="New Items Placeholder">
+ <menuitem name="New Tab" action="New Tab"/>
+ <menuitem name="New Window" action="New Window"/>
+ </placeholder>
+ <separator/>
+ <placeholder name="Open Placeholder"/>
+ <separator/>
+ <placeholder name="Location Placeholder"/>
+ <menuitem name="Connect to Server" action="Connect to Server"/>
+ <separator/>
+ <placeholder name="File Items Placeholder"/>
+ <separator/>
+ <placeholder name="Global File Items Placeholder"/>
+ <separator/>
+ <menu action="Edit">
+ <placeholder name="Undostack Actions"/>
+ <separator/>
+ <placeholder name="Clipboard Actions">
+ </placeholder>
+ <separator/>
+ <placeholder name="Select Items"/>
+ <separator/>
+ <placeholder name="File Items Placeholder"/>
+ <separator/>
+ <placeholder name="Dangerous File Items Placeholder"/>
+ <separator/>
+ <placeholder name="Edit Items Placeholder"/>
+ <placeholder name="Global Edit Items Placeholder"/>
+ <separator/>
+ <placeholder name="Extension Actions"/>
+ <separator/>
+ <menuitem name="Preferences" action="Preferences"/>
+ </menu>
+ <menu action="View">
+ <menuitem name="Stop" action="Stop"/>
+ <menuitem name="Reload" action="Reload"/>
+ <separator/>
+ <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
+ <separator/>
+ <placeholder name="View Preferences Placeholder"/>
+ <separator/>
+ <placeholder name="View Items Placeholder"/>
+ <separator/>
+ <placeholder name="Zoom Items Placeholder">
+ <menuitem name="Zoom In" action="Zoom In"/>
+ <menuitem name="Zoom Out" action="Zoom Out"/>
+ <menuitem name="Zoom Normal" action="Zoom Normal"/>
+ </placeholder>
+ <placeholder name="View Choices">
+ <separator name="Before Short List"/>
+ <placeholder name="Short List"/>
+ </placeholder>
+ </menu>
+ <menu action="Bookmarks">
+ <menuitem name="Add Bookmark" action="Add Bookmark"/>
+ <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
+ <menuitem name="Go to Location" action="Go to Location"/>
+ <separator/>
+ <placeholder name="Bookmarks Placeholder"/>
+ </menu>
+ <placeholder name="Extension Actions"/>
+ <separator/>
+ <placeholder name="Close Items Placeholder">
+ <menuitem name="Close All Windows" action="Close All Windows"/>
+ </placeholder>
+ <menuitem name="Close" action="Close"/>
+</popup>
<popup name="background">
<placeholder name="Before Zoom Items">
<placeholder name="New Window Items"/>
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index fe9c360..75c8cbe 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -54,6 +54,7 @@ struct _NautilusToolbarPriv {
enum {
PROP_ACTION_GROUP = 1,
+ PROP_UI_MANAGER,
PROP_SHOW_LOCATION_ENTRY,
PROP_SHOW_SEARCH_BAR,
PROP_SHOW_MAIN_BAR,
@@ -88,12 +89,14 @@ static void
nautilus_toolbar_constructed (GObject *obj)
{
NautilusToolbar *self = NAUTILUS_TOOLBAR (obj);
- GtkToolItem *item;
GtkWidget *hbox, *toolbar;
GtkStyleContext *context;
- GtkWidget *tool_button, *box;
+ GtkWidget *tool_button;
+ GtkWidget *menu;
+ GtkWidget *image;
+ GtkWidget *box;
GtkToolItem *back_forward;
- GtkToolItem *search;
+ GtkToolItem *tool_item;
GtkActionGroup *action_group;
GtkAction *action;
@@ -159,14 +162,14 @@ nautilus_toolbar_constructed (GObject *obj)
self->priv->location_bar = nautilus_location_bar_new ();
gtk_box_pack_start (GTK_BOX (hbox), self->priv->location_bar, TRUE, TRUE, 0);
- item = gtk_tool_item_new ();
- gtk_tool_item_set_expand (item, TRUE);
- gtk_container_add (GTK_CONTAINER (item), hbox);
- gtk_container_add (GTK_CONTAINER (self->priv->toolbar), GTK_WIDGET (item));
- gtk_widget_show (GTK_WIDGET (item));
+ tool_item = gtk_tool_item_new ();
+ gtk_tool_item_set_expand (tool_item, TRUE);
+ gtk_container_add (GTK_CONTAINER (tool_item), hbox);
+ gtk_container_add (GTK_CONTAINER (self->priv->toolbar), GTK_WIDGET (tool_item));
+ gtk_widget_show (GTK_WIDGET (tool_item));
/* search */
- search = gtk_tool_item_new ();
+ tool_item = gtk_tool_item_new ();
tool_button = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (tool_button), gtk_image_new ());
action = gtk_action_group_get_action (action_group, NAUTILUS_ACTION_SEARCH);
@@ -174,10 +177,23 @@ nautilus_toolbar_constructed (GObject *obj)
action);
gtk_button_set_label (GTK_BUTTON (tool_button), NULL);
gtk_widget_set_name (tool_button, "nautilus-search-button");
- gtk_container_add (GTK_CONTAINER (search), GTK_WIDGET (tool_button));
- gtk_container_add (GTK_CONTAINER (self->priv->toolbar), GTK_WIDGET (search));
- gtk_widget_show_all (GTK_WIDGET (search));
- gtk_widget_set_margin_left (GTK_WIDGET (search), 12);
+ gtk_container_add (GTK_CONTAINER (tool_item), GTK_WIDGET (tool_button));
+ gtk_container_add (GTK_CONTAINER (self->priv->toolbar), GTK_WIDGET (tool_item));
+ gtk_widget_show_all (GTK_WIDGET (tool_item));
+ gtk_widget_set_margin_left (GTK_WIDGET (tool_item), 12);
+
+ /* Page Menu */
+ tool_item = gtk_tool_item_new ();
+ tool_button = gtk_menu_button_new ();
+ menu = gtk_ui_manager_get_widget (self->priv->ui_manager, "/ViewMenu");
+ gtk_menu_button_set_menu (GTK_MENU_BUTTON (tool_button), menu);
+ image = gtk_image_new ();
+ gtk_image_set_from_icon_name (GTK_IMAGE (image), "emblem-system-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_button_set_image (GTK_BUTTON (tool_button), image);
+ gtk_container_add (GTK_CONTAINER (tool_item), tool_button);
+ gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (tool_item));
+ gtk_widget_show_all (GTK_WIDGET (tool_item));
+ gtk_widget_set_margin_left (GTK_WIDGET (tool_item), 6);
/* search bar */
self->priv->search_bar = nautilus_search_bar_new ();
@@ -231,6 +247,9 @@ nautilus_toolbar_set_property (GObject *object,
NautilusToolbar *self = NAUTILUS_TOOLBAR (object);
switch (property_id) {
+ case PROP_UI_MANAGER:
+ self->priv->ui_manager = g_value_get_object (value);
+ break;
case PROP_ACTION_GROUP:
self->priv->action_group = g_value_dup_object (value);
break;
@@ -281,6 +300,13 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
GTK_TYPE_ACTION_GROUP,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+ properties[PROP_UI_MANAGER] =
+ g_param_spec_object ("ui-manager",
+ "The UI manager",
+ "The UI manager",
+ GTK_TYPE_UI_MANAGER,
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS);
properties[PROP_SHOW_LOCATION_ENTRY] =
g_param_spec_boolean ("show-location-entry",
"Whether to show the location entry",
@@ -305,10 +331,12 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
}
GtkWidget *
-nautilus_toolbar_new (GtkActionGroup *action_group)
+nautilus_toolbar_new (GtkUIManager *ui_manager,
+ GtkActionGroup *action_group)
{
return g_object_new (NAUTILUS_TYPE_TOOLBAR,
"action-group", action_group,
+ "ui-manager", ui_manager,
"orientation", GTK_ORIENTATION_VERTICAL,
NULL);
}
diff --git a/src/nautilus-toolbar.h b/src/nautilus-toolbar.h
index 582fa1f..742f05b 100644
--- a/src/nautilus-toolbar.h
+++ b/src/nautilus-toolbar.h
@@ -62,7 +62,8 @@ struct _NautilusToolbarClass {
GType nautilus_toolbar_get_type (void);
-GtkWidget *nautilus_toolbar_new (GtkActionGroup *action_group);
+GtkWidget *nautilus_toolbar_new (GtkUIManager *ui_manager,
+ GtkActionGroup *action_group);
GtkWidget *nautilus_toolbar_get_path_bar (NautilusToolbar *self);
GtkWidget *nautilus_toolbar_get_location_bar (NautilusToolbar *self);
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 20b96d1..aa7d56f 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -104,12 +104,12 @@
#define MAX_QUEUED_UPDATES 500
-#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/MenuBar/File/Open Placeholder/Open With/Applications Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/MenuBar/File/Open Placeholder/Applications Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/MenuBar/File/Open Placeholder/Scripts/Scripts Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_EXTENSION_ACTIONS_PLACEHOLDER "/MenuBar/Edit/Extension Actions"
-#define NAUTILUS_VIEW_MENU_PATH_NEW_DOCUMENTS_PLACEHOLDER "/MenuBar/File/New Items Placeholder/New Documents/New Documents Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_OPEN "/MenuBar/File/Open Placeholder/Open"
+#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/ViewMenu/Open Placeholder/Open With/Applications Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/ViewMenu/Open Placeholder/Applications Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/ViewMenu/Open Placeholder/Scripts/Scripts Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_EXTENSION_ACTIONS_PLACEHOLDER "/ViewMenu/Edit/Extension Actions"
+#define NAUTILUS_VIEW_MENU_PATH_NEW_DOCUMENTS_PLACEHOLDER "/ViewMenu/New Items Placeholder/New Documents/New Documents Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_OPEN "/ViewMenu/Open Placeholder/Open"
#define NAUTILUS_VIEW_POPUP_PATH_SELECTION "/selection"
#define NAUTILUS_VIEW_POPUP_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/selection/Open Placeholder/Open With/Applications Placeholder"
diff --git a/src/nautilus-window-bookmarks.c b/src/nautilus-window-bookmarks.c
index 3debe60..3f9c70a 100644
--- a/src/nautilus-window-bookmarks.c
+++ b/src/nautilus-window-bookmarks.c
@@ -41,7 +41,7 @@
#include <glib/gi18n.h>
#define MENU_ITEM_MAX_WIDTH_CHARS 32
-#define MENU_PATH_BOOKMARKS_PLACEHOLDER "/MenuBar/Other Menus/Bookmarks/Bookmarks Placeholder"
+#define MENU_PATH_BOOKMARKS_PLACEHOLDER "/ViewMenu/Bookmarks/Bookmarks Placeholder"
static GtkWindow *bookmarks_window = NULL;
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index ff98b64..4548550 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -60,7 +60,7 @@
#include <libnautilus-private/nautilus-trash-monitor.h>
#include <string.h>
-#define MENU_PATH_EXTENSION_ACTIONS "/MenuBar/File/Extension Actions"
+#define MENU_PATH_EXTENSION_ACTIONS "/ViewMenu/Extension Actions"
#define POPUP_PATH_EXTENSION_ACTIONS "/background/Before Zoom Items/Extension Actions"
#define NETWORK_URI "network:"
@@ -729,7 +729,6 @@ nautilus_window_create_toolbar_action_group (NautilusWindow *window)
NULL));
gtk_action_group_add_action (action_group, action);
gtk_action_set_icon_name (GTK_ACTION (action), "edit-find-symbolic");
-
g_object_unref (action);
navigation_state = nautilus_window_get_navigation_state (window);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index b711e69..c01d0ca 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -71,7 +71,7 @@
#include <sys/time.h>
/* dock items */
-#define NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER "/MenuBar/View/View Choices/Short List"
+#define NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER "/ViewMenu/View/View Choices/Short List"
#define MAX_TITLE_LENGTH 180
@@ -1141,7 +1141,7 @@ create_toolbar (NautilusWindow *window)
G_CALLBACK (action_show_hide_search_callback), window);
nautilus_navigation_state_set_master (window->details->nav_state, window->details->toolbar_action_group );
- toolbar = nautilus_toolbar_new (action_group);
+ toolbar = nautilus_toolbar_new (nautilus_window_get_ui_manager (NAUTILUS_WINDOW (window)), action_group);
g_object_bind_property (window, "disable-chrome",
toolbar, "visible",
@@ -1219,7 +1219,6 @@ nautilus_window_constructed (GObject *self)
{
NautilusWindow *window;
GtkWidget *grid;
- GtkWidget *menu;
NautilusWindowSlot *slot;
window = NAUTILUS_WINDOW (self);
@@ -1239,12 +1238,6 @@ nautilus_window_constructed (GObject *self)
nautilus_window_initialize_menus (window);
nautilus_window_initialize_actions (window);
- menu = gtk_ui_manager_get_widget (window->details->ui_manager, "/MenuBar");
- window->details->menubar = menu;
- gtk_widget_set_hexpand (menu, TRUE);
- gtk_widget_show (menu);
- gtk_container_add (GTK_CONTAINER (grid), menu);
-
/* Register to menu provider extension signal managing menu updates */
g_signal_connect_object (nautilus_signaller_get_current (), "popup_menu_changed",
G_CALLBACK (nautilus_window_load_extension_menus), window, G_CONNECT_SWAPPED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]