diff --git a/libnemo-private/nemo-global-preferences.h b/libnemo-private/nemo-global-preferences.h index 0b0d1dd94..de67c0093 100644 --- a/libnemo-private/nemo-global-preferences.h +++ b/libnemo-private/nemo-global-preferences.h @@ -78,6 +78,13 @@ typedef enum #define NEMO_PREFERENCES_NEW_TAB_POSITION "tabs-open-position" #define NEMO_PREFERENCES_SHOW_LOCATION_ENTRY "show-location-entry" +#define NEMO_PREFERENCES_SHOW_UP_ICON_TOOLBAR "show-up-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_EDIT_ICON_TOOLBAR "show-edit-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_RELOAD_ICON_TOOLBAR "show-reload-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_HOME_ICON_TOOLBAR "show-home-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_COMPUTER_ICON_TOOLBAR "show-computer-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_SEARCH_ICON_TOOLBAR "show-search-icon-toolbar" +#define NEMO_PREFERENCES_SHOW_LABEL_SEARCH_ICON_TOOLBAR "show-label-search-icon-toolbar" /* Which views should be displayed for new windows */ #define NEMO_WINDOW_STATE_START_WITH_STATUS_BAR "start-with-status-bar" diff --git a/libnemo-private/nemo-icon-names.h b/libnemo-private/nemo-icon-names.h index b5dfdbede..ab34861a4 100644 --- a/libnemo-private/nemo-icon-names.h +++ b/libnemo-private/nemo-icon-names.h @@ -4,7 +4,7 @@ /* Icons for places */ #define NEMO_ICON_COMPUTER "computer" #define NEMO_ICON_DESKTOP "user-desktop" -#define NEMO_ICON_FILESYSTEM "drive-harddisk-system" +#define NEMO_ICON_FILESYSTEM "drive-harddisk" #define NEMO_ICON_FOLDER "folder" #define NEMO_ICON_FOLDER_REMOTE "folder-remote" #define NEMO_ICON_HOME "user-home" diff --git a/libnemo-private/nemo.convert b/libnemo-private/nemo.convert index e4a2ac83c..39b542b10 100644 --- a/libnemo-private/nemo.convert +++ b/libnemo-private/nemo.convert @@ -2,6 +2,13 @@ tabs-open-position = /desktop/gnome/file_views/tabs_open_position always-use-browser = /apps/nemo/preferences/always_use_browser always-use-location-entry = /apps/nemo/preferences/always_use_location_entry +show-up-icon-toolbar = /apps/nemo/preferences/show-up-icon-toolbar +show-edit-icon-toolbar = /apps/nemo/preferences/show-edit-icon-toolbar +show-reload-icon-toolbar = /apps/nemo/preferences/show-reload-icon-toolbar +show-home-icon-toolbar = /apps/nemo/preferences/show-home-icon-toolbar +show-computer-icon-toolbar = /apps/nemo/preferences/show-computer-icon-toolbar +show-search-icon-toolbar = /apps/nemo/preferences/show-search-icon-toolbar +show-label-search-icon-toolbar = /apps/nemo/preferences/show-label-search-icon-toolbar confirm-trash = /apps/nemo/preferences/confirm_trash enable-delete = /apps/nemo/preferences/enable_delete show-icon-text = /apps/nemo/preferences/show_icon_text diff --git a/libnemo-private/org.gnome.nemo.gschema.xml.in b/libnemo-private/org.gnome.nemo.gschema.xml.in index 4118c927f..6aa0bf43d 100644 --- a/libnemo-private/org.gnome.nemo.gschema.xml.in +++ b/libnemo-private/org.gnome.nemo.gschema.xml.in @@ -82,6 +82,41 @@ <_summary>Show the location entry by default <_description>If set to true, then Nemo browser windows will show a textual input entry for the location toolbar. + + false + Show Up button in nemo toolbar + If set to true, then Nemo browser windows will show the button. + + + false + Show refresh button in nemo toolbar + If set to true, then Nemo browser windows will show the button. + + + false + Show toggle button location entry/pathbar + If set to true, then Nemo browser windows will show the button. + + + false + Show Home button in nemo toolbar + If set to true, then Nemo browser windows will show the button. + + + false + Show Computer button in nemo toolbar + If set to true, then Nemo browser windows will show the button. + + + true + Show Search button in nemo toolbar + If set to true, then Nemo browser windows will show the button. + + + true + Show the Search button label in nemo toolbar + If set to true, then Nemo browser windows will show the Search label button. + true <_summary>Whether to ask for confirmation when deleting files, or emptying Trash diff --git a/src/nemo-actions.h b/src/nemo-actions.h index e9deec4d7..9c9bdef4a 100644 --- a/src/nemo-actions.h +++ b/src/nemo-actions.h @@ -29,6 +29,7 @@ #define NEMO_ACTION_STOP "Stop" #define NEMO_ACTION_RELOAD "Reload" #define NEMO_ACTION_BACK "Back" +#define NEMO_ACTION_COMPUTER "Computer" #define NEMO_ACTION_UP "Up" #define NEMO_ACTION_UP_ACCEL "UpAccel" #define NEMO_ACTION_UP_ACCEL "UpAccel" @@ -44,6 +45,7 @@ #define NEMO_ACTION_GO_HOME "Home" #define NEMO_ACTION_ADD_BOOKMARK "Add Bookmark" #define NEMO_ACTION_EDIT_BOOKMARKS "Edit Bookmarks" +#define NEMO_ACTION_EDIT "Edit" #define NEMO_ACTION_HOME "Home" #define NEMO_ACTION_ZOOM_IN "Zoom In" #define NEMO_ACTION_ZOOM_OUT "Zoom Out" @@ -115,6 +117,8 @@ #define NEMO_ACTION_LOCATION_STOP_VOLUME "Location Stop Volume" #define NEMO_ACTION_LOCATION_POLL "Location Poll" #define NEMO_ACTION_SCRIPTS "Scripts" +#define NEMO_ACTION_NEW_LAUNCHER "New Launcher" +#define NEMO_ACTION_NEW_LAUNCHER_DESKTOP "New Launcher" #define NEMO_ACTION_NEW_DOCUMENTS "New Documents" #define NEMO_ACTION_NEW_EMPTY_DOCUMENT "New Empty Document" #define NEMO_ACTION_EMPTY_TRASH_CONDITIONAL "Empty Trash Conditional" diff --git a/src/nemo-desktop-icon-view-ui.xml b/src/nemo-desktop-icon-view-ui.xml index 9735b0c01..d437801de 100644 --- a/src/nemo-desktop-icon-view-ui.xml +++ b/src/nemo-desktop-icon-view-ui.xml @@ -4,6 +4,7 @@ + diff --git a/src/nemo-desktop-icon-view.c b/src/nemo-desktop-icon-view.c index e4d220f0c..947fd81b0 100644 --- a/src/nemo-desktop-icon-view.c +++ b/src/nemo-desktop-icon-view.c @@ -666,6 +666,23 @@ action_empty_trash_conditional_callback (GtkAction *action, nemo_file_operations_empty_trash (GTK_WIDGET (data)); } +static void +action_new_launcher_callback (GtkAction *action, gpointer data) +{ + char *desktop_directory; + + g_assert (NEMO_IS_VIEW (data)); + + desktop_directory = nemo_get_desktop_directory (); + + nemo_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (data)), + "gnome-desktop-item-edit", + FALSE, + "--create-new", desktop_directory, NULL); + g_free (desktop_directory); + +} + static gboolean trash_link_is_selection (NemoView *view) { @@ -709,6 +726,13 @@ real_update_menus (NemoView *view) desktop_view = NEMO_DESKTOP_ICON_VIEW (view); + + /* New Launcher */ + action = gtk_action_group_get_action (desktop_view->details->desktop_action_group, + NEMO_ACTION_NEW_LAUNCHER_DESKTOP); + gtk_action_set_visible (action, + TRUE); + /* Empty Trash */ include_empty_trash = trash_link_is_selection (view); action = gtk_action_group_get_action (desktop_view->details->desktop_action_group, @@ -726,6 +750,13 @@ real_update_menus (NemoView *view) static const GtkActionEntry desktop_view_entries[] = { /* name, stock id */ + { "New Launcher Desktop", NULL, + /* label, accelerator */ + N_("Create L_auncher..."), NULL, + /* tooltip */ + N_("Create a new launcher"), + G_CALLBACK (action_new_launcher_callback) }, + /* name, stock id */ { "Change Background", NULL, /* label, accelerator */ N_("Change Desktop _Background"), NULL, diff --git a/src/nemo-directory-view-ui.xml b/src/nemo-directory-view-ui.xml index 30dc7e200..e477dd8c4 100644 --- a/src/nemo-directory-view-ui.xml +++ b/src/nemo-directory-view-ui.xml @@ -98,6 +98,7 @@ + diff --git a/src/nemo-file-management-properties.c b/src/nemo-file-management-properties.c index cee0d0877..d1ae5f4ba 100644 --- a/src/nemo-file-management-properties.c +++ b/src/nemo-file-management-properties.c @@ -63,6 +63,15 @@ #define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET "hidden_files_checkbutton" #define NEMO_FILE_MANAGEMENT_PROPERTIES_TREE_VIEW_FOLDERS_WIDGET "treeview_folders_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_UP_ICON_TOOLBAR_WIDGET "show_up_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_RELOAD_ICON_TOOLBAR_WIDGET "show_reload_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_EDIT_ICON_TOOLBAR_WIDGET "show_edit_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_HOME_ICON_TOOLBAR_WIDGET "show_home_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_COMPUTER_ICON_TOOLBAR_WIDGET "show_computer_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SEARCH_ICON_TOOLBAR_WIDGET "show_search_icon_toolbar_checkbutton" +#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_LABEL_SEARCH_ICON_TOOLBAR_WIDGET "show_label_search_icon_toolbar_checkbutton" + + /* int enums */ #define NEMO_FILE_MANAGEMENT_PROPERTIES_THUMBNAIL_LIMIT_WIDGET "preview_image_size_combobox" @@ -721,6 +730,30 @@ nemo_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi 4); create_date_format_menu (builder); + + /* nemo patch */ + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_UP_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_UP_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_RELOAD_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_RELOAD_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_EDIT_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_EDIT_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_HOME_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_HOME_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_COMPUTER_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_COMPUTER_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SEARCH_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_SEARCH_ICON_TOOLBAR); + bind_builder_bool (builder, nemo_preferences, + NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_LABEL_SEARCH_ICON_TOOLBAR_WIDGET, + NEMO_PREFERENCES_SHOW_LABEL_SEARCH_ICON_TOOLBAR); + /* setup preferences */ bind_builder_bool (builder, nemo_icon_view_preferences, NEMO_FILE_MANAGEMENT_PROPERTIES_LABELS_BESIDE_ICONS_WIDGET, diff --git a/src/nemo-file-management-properties.ui b/src/nemo-file-management-properties.ui index ce058f43d..ef739264d 100644 --- a/src/nemo-file-management-properties.ui +++ b/src/nemo-file-management-properties.ui @@ -603,7 +603,7 @@ 1 - + False True @@ -1607,6 +1607,185 @@ False + + + True + False + 12 + vertical + 18 + + + True + False + vertical + 6 + + + True + False + 0 + <b>Options</b> + True + + + False + False + 0 + + + + + True + False + 12 + + + True + False + vertical + 6 + + + Show up icon + True + True + False + False + True + True + + + False + False + 0 + + + + + Show refresh icon + True + True + False + False + True + True + + + False + False + 1 + + + + + Show toggle button location bar/bar path + True + True + False + False + True + True + + + False + False + 2 + + + + + Show home icon + True + True + False + False + True + True + + + False + False + 3 + + + + + Show computer icon + True + True + False + False + True + True + + + False + False + 4 + + + + + Show search icon + True + True + False + False + True + True + + + False + False + 5 + + + + + Show label on search icon (need to restart nemo) + True + True + False + False + True + True + + + False + False + 6 + + + + + + + False + True + 1 + + + + + False + True + 5 + + + + + + + True + False + Toolbar + + + 2 + False + + False diff --git a/src/nemo-location-entry.c b/src/nemo-location-entry.c index 89973d289..167af19c5 100644 --- a/src/nemo-location-entry.c +++ b/src/nemo-location-entry.c @@ -385,12 +385,12 @@ nemo_location_entry_set_secondary_action (NemoLocationEntry *entry, case NEMO_LOCATION_ENTRY_ACTION_CLEAR: gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, - "edit-clear-symbolic"); + "edit-clear"); break; case NEMO_LOCATION_ENTRY_ACTION_GOTO: gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, - "go-next-symbolic"); + "go-next"); break; default: g_assert_not_reached (); diff --git a/src/nemo-navigation-action.c b/src/nemo-navigation-action.c index d97607b43..84b184948 100644 --- a/src/nemo-navigation-action.c +++ b/src/nemo-navigation-action.c @@ -149,6 +149,16 @@ show_menu (NemoNavigationAction *self, case NEMO_NAVIGATION_DIRECTION_BACK: fill_menu (window, menu, TRUE); break; + case NEMO_NAVIGATION_DIRECTION_UP: + return; + case NEMO_NAVIGATION_DIRECTION_RELOAD: + return; + case NEMO_NAVIGATION_DIRECTION_HOME: + return; + case NEMO_NAVIGATION_DIRECTION_COMPUTER: + return; + case NEMO_NAVIGATION_DIRECTION_EDIT: + return; default: g_assert_not_reached (); break; diff --git a/src/nemo-navigation-action.h b/src/nemo-navigation-action.h index db438ccc9..d0f4e2bb2 100644 --- a/src/nemo-navigation-action.h +++ b/src/nemo-navigation-action.h @@ -47,7 +47,13 @@ typedef struct NemoNavigationActionPrivate NemoNavigationActionPrivate; typedef enum { NEMO_NAVIGATION_DIRECTION_BACK, - NEMO_NAVIGATION_DIRECTION_FORWARD + NEMO_NAVIGATION_DIRECTION_FORWARD, + NEMO_NAVIGATION_DIRECTION_UP, + NEMO_NAVIGATION_DIRECTION_RELOAD, + NEMO_NAVIGATION_DIRECTION_HOME, + NEMO_NAVIGATION_DIRECTION_COMPUTER, + NEMO_NAVIGATION_DIRECTION_EDIT + } NemoNavigationDirection; struct _NemoNavigationAction diff --git a/src/nemo-notebook.c b/src/nemo-notebook.c index 8153660be..cb6ca3545 100644 --- a/src/nemo-notebook.c +++ b/src/nemo-notebook.c @@ -366,7 +366,7 @@ build_tab_label (NemoNotebook *nb, NemoWindowSlot *slot) gtk_widget_set_name (close_button, "nemo-tab-close-button"); - image = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_MENU); gtk_widget_set_tooltip_text (close_button, _("Close tab")); g_signal_connect_object (close_button, "clicked", G_CALLBACK (close_button_clicked_cb), slot, 0); diff --git a/src/nemo-pathbar.c b/src/nemo-pathbar.c index 949fd3836..a1758ca12 100644 --- a/src/nemo-pathbar.c +++ b/src/nemo-pathbar.c @@ -51,6 +51,7 @@ typedef enum { HOME_BUTTON, DESKTOP_BUTTON, MOUNT_BUTTON, + XDG_BUTTON, DEFAULT_LOCATION_BUTTON, } ButtonType; @@ -79,6 +80,8 @@ struct _ButtonData /* custom icon */ GdkPixbuf *custom_icon; + char *xdg_icon; + /* flag to indicate its the base folder in the URI */ gboolean is_base_dir; @@ -92,6 +95,7 @@ struct _ButtonData G_DEFINE_TYPE (NemoPathBar, nemo_path_bar, GTK_TYPE_CONTAINER); +static GFile* get_xdg_dir (GUserDirectory dir); static void nemo_path_bar_scroll_up (NemoPathBar *path_bar); static void nemo_path_bar_scroll_down (NemoPathBar *path_bar); static void nemo_path_bar_stop_scrolling (NemoPathBar *path_bar); @@ -256,6 +260,25 @@ nemo_path_bar_slider_drag_leave (GtkWidget *widget, } } +/** + * Utility function. Return a GFile for the "special directory" if it exists, or NULL + * Ripped from nemo-file.c (nemo_file_is_user_special_directory) and slightly modified + */ +static GFile* +get_xdg_dir (GUserDirectory dir) { + + const gchar *special_dir; + + special_dir = g_get_user_special_dir (dir); + + if (special_dir) { + return g_file_new_for_path (special_dir); + } else { + return NULL; + } + +} + static void nemo_path_bar_init (NemoPathBar *path_bar) { @@ -274,6 +297,14 @@ nemo_path_bar_init (NemoPathBar *path_bar) g_free (p); path_bar->home_path = g_file_new_for_path (g_get_home_dir ()); path_bar->root_path = g_file_new_for_path ("/"); + path_bar->xdg_documents_path = get_xdg_dir (G_USER_DIRECTORY_DOCUMENTS); + path_bar->xdg_download_path = get_xdg_dir (G_USER_DIRECTORY_DOWNLOAD); + path_bar->xdg_music_path = get_xdg_dir (G_USER_DIRECTORY_MUSIC); + path_bar->xdg_pictures_path = get_xdg_dir (G_USER_DIRECTORY_PICTURES); + path_bar->xdg_public_path = get_xdg_dir (G_USER_DIRECTORY_PUBLIC_SHARE); + path_bar->xdg_templates_path = get_xdg_dir (G_USER_DIRECTORY_TEMPLATES); + path_bar->xdg_videos_path = get_xdg_dir (G_USER_DIRECTORY_VIDEOS); + desktop_is_home = g_file_equal (path_bar->home_path, path_bar->desktop_path); g_signal_connect_swapped (nemo_preferences, "changed::" NEMO_PREFERENCES_DESKTOP_IS_HOME_DIR, @@ -336,6 +367,13 @@ nemo_path_bar_finalize (GObject *object) g_clear_object (&path_bar->root_path); g_clear_object (&path_bar->home_path); g_clear_object (&path_bar->desktop_path); + g_clear_object (&path_bar->xdg_documents_path); + g_clear_object (&path_bar->xdg_download_path); + g_clear_object (&path_bar->xdg_music_path); + g_clear_object (&path_bar->xdg_pictures_path); + g_clear_object (&path_bar->xdg_public_path); + g_clear_object (&path_bar->xdg_templates_path); + g_clear_object (&path_bar->xdg_videos_path); g_signal_handlers_disconnect_by_func (nemo_trash_monitor_get (), trash_state_changed_cb, path_bar); @@ -1231,14 +1269,15 @@ get_type_icon_info (ButtonData *button_data) case DESKTOP_BUTTON: return nemo_icon_info_lookup_from_name (NEMO_ICON_DESKTOP, NEMO_PATH_BAR_ICON_SIZE); - + case XDG_BUTTON: + return nemo_icon_info_lookup_from_name (button_data->xdg_icon, + NEMO_PATH_BAR_ICON_SIZE); case NORMAL_BUTTON: if (button_data->is_base_dir) { return nemo_file_get_icon (button_data->file, NEMO_PATH_BAR_ICON_SIZE, NEMO_FILE_ICON_FLAGS_NONE); } - default: return NULL; } @@ -1254,6 +1293,9 @@ button_data_free (ButtonData *button_data) if (button_data->custom_icon) { g_object_unref (button_data->custom_icon); } + if (button_data->type == XDG_BUTTON) { + g_free (button_data->xdg_icon); + } if (button_data->file != NULL) { g_signal_handler_disconnect (button_data->file, button_data->file_changed_signal_id); @@ -1269,8 +1311,13 @@ get_dir_name (ButtonData *button_data) { if (button_data->type == DESKTOP_BUTTON) { return _("Desktop"); + /* + } + * originally this would look like /home/Home/Desktop in the pathbar. + * I can see the logic, when you're only staying in $HOME, i.e. Home/Desktop + * but when you've come from a directory further up it just looks wrong. * } else if (button_data->type == HOME_BUTTON) { - return _("Home"); + return _("Home");*/ } else { return button_data->dir_name; } @@ -1460,6 +1507,27 @@ setup_button_type (ButtonData *button_data, } else { button_data->type = NORMAL_BUTTON; } + } else if (path_bar->xdg_documents_path != NULL && g_file_equal (location, path_bar->xdg_documents_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_DOCUMENTS); + } else if (path_bar->xdg_download_path != NULL && g_file_equal (location, path_bar->xdg_download_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_DOWNLOAD); + } else if (path_bar->xdg_music_path != NULL && g_file_equal (location, path_bar->xdg_music_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_MUSIC); + } else if (path_bar->xdg_pictures_path != NULL && g_file_equal (location, path_bar->xdg_pictures_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_PICTURES); + } else if (path_bar->xdg_templates_path != NULL && g_file_equal (location, path_bar->xdg_templates_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_TEMPLATES); + } else if (path_bar->xdg_videos_path != NULL && g_file_equal (location, path_bar->xdg_videos_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_VIDEOS); + } else if (path_bar->xdg_public_path != NULL && g_file_equal (location, path_bar->xdg_public_path)) { + button_data->type = XDG_BUTTON; + button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_PUBLIC_SHARE); } else if (setup_file_path_mounted_mount (location, button_data)) { /* already setup */ } else { diff --git a/src/nemo-pathbar.h b/src/nemo-pathbar.h index c9e055b03..de32c8269 100644 --- a/src/nemo-pathbar.h +++ b/src/nemo-pathbar.h @@ -45,6 +45,15 @@ struct _NemoPathBar GFile *home_path; GFile *desktop_path; + /** XDG Dirs */ + GFile *xdg_documents_path; + GFile *xdg_download_path; + GFile *xdg_music_path; + GFile *xdg_pictures_path; + GFile *xdg_public_path; + GFile *xdg_templates_path; + GFile *xdg_videos_path; + GFile *current_path; gpointer current_button_data; diff --git a/src/nemo-places-sidebar.c b/src/nemo-places-sidebar.c index d9a30ee2d..b8eb1fffe 100644 --- a/src/nemo-places-sidebar.c +++ b/src/nemo-places-sidebar.c @@ -222,7 +222,7 @@ get_eject_icon (NemoPlacesSidebar *sidebar, icon_theme = gtk_icon_theme_get_default (); icon_size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU); - icon = g_themed_icon_new_with_default_fallbacks ("media-eject-symbolic"); + icon = g_themed_icon_new_with_default_fallbacks ("media-eject"); icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0); style = gtk_widget_get_style_context (GTK_WIDGET (sidebar)); diff --git a/src/nemo-progress-ui-handler.c b/src/nemo-progress-ui-handler.c index 3481911a3..84223ea31 100644 --- a/src/nemo-progress-ui-handler.c +++ b/src/nemo-progress-ui-handler.c @@ -130,7 +130,7 @@ progress_ui_handler_ensure_status_icon (NemoProgressUIHandler *self) return; } - icon = g_themed_icon_new_with_default_fallbacks ("system-file-manager-symbolic"); + icon = g_themed_icon_new_with_default_fallbacks ("system-file-manager"); status_icon = gtk_status_icon_new_from_gicon (icon); g_signal_connect (status_icon, "activate", (GCallback) status_icon_activate_cb, diff --git a/src/nemo-search-bar.c b/src/nemo-search-bar.c index 25e018970..c11c8fcc8 100644 --- a/src/nemo-search-bar.c +++ b/src/nemo-search-bar.c @@ -163,7 +163,7 @@ nemo_search_bar_init (NemoSearchBar *bar) bar->details->entry = gtk_entry_new (); gtk_entry_set_icon_from_icon_name (GTK_ENTRY (bar->details->entry), GTK_ENTRY_ICON_SECONDARY, - "edit-find-symbolic"); + "edit-find"); gtk_container_add (GTK_CONTAINER (align), bar->details->entry); g_signal_connect (bar->details->entry, "activate", diff --git a/src/nemo-toolbar-ui.xml b/src/nemo-toolbar-ui.xml index 42c88e7cc..577e41f6b 100644 --- a/src/nemo-toolbar-ui.xml +++ b/src/nemo-toolbar-ui.xml @@ -2,6 +2,14 @@ + + + + + + + + - \ No newline at end of file + diff --git a/src/nemo-toolbar.c b/src/nemo-toolbar.c index 06b2c8138..85fb73f3b 100644 --- a/src/nemo-toolbar.c +++ b/src/nemo-toolbar.c @@ -64,6 +64,10 @@ G_DEFINE_TYPE (NemoToolbar, nemo_toolbar, GTK_TYPE_BOX); static void toolbar_update_appearance (NemoToolbar *self) { + GtkAction *action; + GtkWidget *widgetitem; + gboolean icon_toolbar; + gboolean show_location_entry; show_location_entry = self->priv->show_location_entry || @@ -79,6 +83,37 @@ toolbar_update_appearance (NemoToolbar *self) gtk_widget_set_visible (self->priv->search_bar, self->priv->show_search_bar); + + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Up"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_UP_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Reload"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_RELOAD_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Edit"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_EDIT_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Home"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_HOME_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Computer"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_COMPUTER_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} + + widgetitem = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Search"); + icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_SEARCH_ICON_TOOLBAR); + if ( icon_toolbar == FALSE ) { gtk_widget_hide (widgetitem); } + else {gtk_widget_show (widgetitem);} } static void @@ -89,6 +124,8 @@ nemo_toolbar_constructed (GObject *obj) GtkWidget *vbox, *toolbar, *search; GtkStyleContext *context; + GtkWidget *sep_space; + G_OBJECT_CLASS (nemo_toolbar_parent_class)->constructed (obj); gtk_style_context_set_junction_sides (gtk_widget_get_style_context (GTK_WIDGET (self)), @@ -101,11 +138,16 @@ nemo_toolbar_constructed (GObject *obj) toolbar = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar"); self->priv->toolbar = toolbar; - gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_SMALL_TOOLBAR); + /** Remove this, should be up to the user what the icon size is. + gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_SMALL_TOOLBAR); */ context = gtk_widget_get_style_context (toolbar); gtk_style_context_add_class (context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR); + sep_space = gtk_ui_manager_get_widget(self->priv->ui_manager, "/Toolbar/BeforeSearch"); + gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (sep_space), FALSE); + gtk_tool_item_set_expand (GTK_SEPARATOR_TOOL_ITEM (sep_space), TRUE); + search = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Search"); gtk_style_context_add_class (gtk_widget_get_style_context (search), GTK_STYLE_CLASS_RAISED); gtk_widget_set_name (search, "nemo-search-button"); @@ -127,7 +169,8 @@ nemo_toolbar_constructed (GObject *obj) item = gtk_tool_item_new (); gtk_tool_item_set_expand (item, TRUE); gtk_container_add (GTK_CONTAINER (item), vbox); - gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 0); + /* append to the end of the toolbar so navigation buttons are at the beginning */ + gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 8); gtk_widget_show (GTK_WIDGET (item)); /* search bar */ @@ -138,7 +181,31 @@ nemo_toolbar_constructed (GObject *obj) "changed::" NEMO_PREFERENCES_SHOW_LOCATION_ENTRY, G_CALLBACK (toolbar_update_appearance), self); + /* nemo patch */ + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_UP_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_EDIT_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_RELOAD_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_HOME_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_COMPUTER_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_SEARCH_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + g_signal_connect_swapped (nemo_preferences, + "changed::" NEMO_PREFERENCES_SHOW_LABEL_SEARCH_ICON_TOOLBAR, + G_CALLBACK (toolbar_update_appearance), self); + toolbar_update_appearance (self); + } static void @@ -282,6 +349,12 @@ nemo_toolbar_get_search_bar (NemoToolbar *self) return self->priv->search_bar; } +GtkWidget * +nemo_toolbar_get_show_location_entry (NemoToolbar *self) +{ + return self->priv->show_location_entry; +} + void nemo_toolbar_set_show_main_bar (NemoToolbar *self, gboolean show_main_bar) diff --git a/src/nemo-toolbar.h b/src/nemo-toolbar.h index 9d3799c1b..7aaa7fbb8 100644 --- a/src/nemo-toolbar.h +++ b/src/nemo-toolbar.h @@ -64,6 +64,7 @@ GType nemo_toolbar_get_type (void); GtkWidget *nemo_toolbar_new (GtkActionGroup *action_group); +GtkWidget *nemo_toolbar_get_show_location_entry (NemoToolbar *self); GtkWidget *nemo_toolbar_get_path_bar (NemoToolbar *self); GtkWidget *nemo_toolbar_get_location_bar (NemoToolbar *self); GtkWidget *nemo_toolbar_get_search_bar (NemoToolbar *self); diff --git a/src/nemo-tree-sidebar.c b/src/nemo-tree-sidebar.c index 8fed86d3c..6fe94c30c 100644 --- a/src/nemo-tree-sidebar.c +++ b/src/nemo-tree-sidebar.c @@ -1333,7 +1333,12 @@ create_tree (FMTreeView *view) (view->details->child_model, "row_loaded", G_CALLBACK (row_loaded_callback), view, G_CONNECT_AFTER); - home_uri = nemo_get_home_directory_uri (); +#ifdef NOT_YET_USABLE /* Do we really want this? */ + icon = g_themed_icon_new (NEMO_ICON_COMPUTER); + fm_tree_model_add_root_uri (view->details->child_model, "computer:///", _("Computer"), icon, NULL); + g_object_unref (icon); +#endif + home_uri = nemo_get_home_directory_uri (); icon = g_themed_icon_new (NEMO_ICON_HOME); fm_tree_model_add_root_uri (view->details->child_model, home_uri, _("Home"), icon, NULL); g_object_unref (icon); @@ -1343,7 +1348,7 @@ create_tree (FMTreeView *view) g_object_unref (icon); #ifdef NOT_YET_USABLE /* Do we really want this? */ icon = g_themed_icon_new (NEMO_ICON_NETWORK); - fm_tree_model_add_root_uri (view->details->child_model, "network:///", _("Network Neighbourhood"), icon, NULL); + fm_tree_model_add_root_uri (view->details->child_model, "network:///", _("Network"), icon, NULL); g_object_unref (icon); #endif diff --git a/src/nemo-view.c b/src/nemo-view.c index 1852f7733..a496acf89 100644 --- a/src/nemo-view.c +++ b/src/nemo-view.c @@ -2034,6 +2034,29 @@ action_new_empty_file_callback (GtkAction *action, nemo_view_new_file (NEMO_VIEW (callback_data), NULL, NULL); } +static void +action_new_launcher_callback (GtkAction *action, + gpointer callback_data) +{ + char *parent_uri; + NemoView *view; + GtkWindow *window; + + g_assert (NEMO_IS_VIEW (callback_data)); + + view = NEMO_VIEW (callback_data); + + parent_uri = nemo_view_get_backing_uri (view); + + window = nemo_view_get_containing_window (view); + nemo_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (view)), + "gnome-desktop-item-edit", + FALSE, + "--create-new", parent_uri, NULL); + + g_free (parent_uri); +} + static void action_properties_callback (GtkAction *action, gpointer callback_data) @@ -6964,6 +6987,10 @@ static const GtkActionEntry directory_view_entries[] = { /* label, accelerator */ N_("_Empty Document"), NULL, /* tooltip */ N_("Create a new empty document inside this folder"), G_CALLBACK (action_new_empty_file_callback) }, + /* name, stock id */ { "New Launcher", NULL, + /* label, accelerator */ N_("Create L_auncher..."), NULL, + /* tooltip */ N_("Create a new launcher"), + G_CALLBACK (action_new_launcher_callback) }, /* name, stock id */ { "Open", NULL, /* label, accelerator */ N_("_Open"), "o", /* tooltip */ N_("Open the selected item in this window"), diff --git a/src/nemo-window-menus.c b/src/nemo-window-menus.c index 826b4aef3..20b80a478 100644 --- a/src/nemo-window-menus.c +++ b/src/nemo-window-menus.c @@ -337,7 +337,7 @@ action_about_nemo_callback (GtkAction *action, "your computer and online."), "license", license_trans, "wrap-license", TRUE, - "logo-icon-name", "nemo", + "logo-icon-name", "system-file-manager", NULL); g_free (license_trans); @@ -1019,7 +1019,7 @@ static const GtkToggleActionEntry main_toggle_entries[] = { /* tooltip */ N_("Change the visibility of this window's statusbar"), NULL, /* is_active */ TRUE }, - /* name, stock id */ { "Search", "edit-find-symbolic", + /* name, stock id */ { "Search", "edit-find", /* label, accelerator */ N_("_Search for Files..."), "f", /* tooltip */ N_("Search documents and folders by name"), NULL, @@ -1048,6 +1048,8 @@ static const GtkRadioActionEntry main_radio_entries[] = { GtkActionGroup * nemo_window_create_toolbar_action_group (NemoWindow *window) { + gboolean show_label_search_icon_toolbar; + NemoNavigationState *navigation_state; GtkActionGroup *action_group; GtkAction *action; @@ -1087,16 +1089,92 @@ nemo_window_create_toolbar_action_group (NemoWindow *window) g_object_unref (action); - action = GTK_ACTION - (gtk_toggle_action_new (NEMO_ACTION_SEARCH, - _("Search"), - _("Search documents and folders by name"), - NULL)); - gtk_action_group_add_action (action_group, action); - gtk_action_set_icon_name (GTK_ACTION (action), "edit-find-symbolic"); - gtk_action_set_is_important (GTK_ACTION (action), TRUE); - - g_object_unref (action); + /** + * Nemo 2.30/2.32 type actions + */ + action = g_object_new (NEMO_TYPE_NAVIGATION_ACTION, + "name", NEMO_ACTION_UP, + "label", _("_Up"), + "stock_id", GTK_STOCK_GO_UP, + "tooltip", _("Go to parent folder"), + "arrow-tooltip", _("Forward history"), + "window", window, + "direction", NEMO_NAVIGATION_DIRECTION_UP, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (action_up_callback), window); + gtk_action_group_add_action (action_group, action); + + g_object_unref (action); + + action = g_object_new (NEMO_TYPE_NAVIGATION_ACTION, + "name", NEMO_ACTION_RELOAD, + "label", _("_Reload"), + "stock_id", GTK_STOCK_REFRESH, + "tooltip", _("Reload the current location"), + "window", window, + "direction", NEMO_NAVIGATION_DIRECTION_RELOAD, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (action_reload_callback), window); + gtk_action_group_add_action (action_group, action); + + g_object_unref (action); + + action = g_object_new (NEMO_TYPE_NAVIGATION_ACTION, + "name", NEMO_ACTION_HOME, + "label", _("_Home"), + "stock_id", GTK_STOCK_HOME, + "tooltip", _("Go to home directory"), + "window", window, + "direction", NEMO_NAVIGATION_DIRECTION_HOME, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (action_home_callback), window); + gtk_action_group_add_action (action_group, action); + + g_object_unref (action); + + action = g_object_new (NEMO_TYPE_NAVIGATION_ACTION, + "name", NEMO_ACTION_COMPUTER, + "label", _("_Computer"), + "stock_id", GTK_STOCK_HARDDISK, + "tooltip", _("Go to Computer"), + "window", window, + "direction", NEMO_NAVIGATION_DIRECTION_COMPUTER, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (action_go_to_computer_callback), window); + gtk_action_group_add_action (action_group, action); + + g_object_unref (action); + + action = g_object_new (NEMO_TYPE_NAVIGATION_ACTION, + "name", NEMO_ACTION_EDIT, + "label", _("Location"), + "stock_id", GTK_STOCK_EDIT, + "tooltip", _("Toggle Location bar / Path bar"), + "window", window, + "direction", NEMO_NAVIGATION_DIRECTION_EDIT, + NULL); + g_signal_connect (action, "activate", + G_CALLBACK (action_go_to_location_callback), window); + gtk_action_group_add_action (action_group, action); + + g_object_unref (action); + + action = GTK_ACTION (gtk_toggle_action_new (NEMO_ACTION_SEARCH, + _("Search"),_("Search documents and folders by name"), + NULL)); + + gtk_action_group_add_action (action_group, action); + gtk_action_set_icon_name (GTK_ACTION (action), "edit-find"); + + + show_label_search_icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_LABEL_SEARCH_ICON_TOOLBAR); + gtk_action_set_is_important (GTK_ACTION (action), show_label_search_icon_toolbar); + + g_object_unref (action); navigation_state = nemo_window_get_navigation_state (window); nemo_navigation_state_add_group (navigation_state, action_group); @@ -1154,7 +1232,7 @@ nemo_window_initialize_actions (NemoWindow *window) { GtkActionGroup *action_group; const gchar *nav_state_actions[] = { - NEMO_ACTION_BACK, NEMO_ACTION_FORWARD, + NEMO_ACTION_BACK, NEMO_ACTION_FORWARD, NEMO_ACTION_UP, NEMO_ACTION_RELOAD, NEMO_ACTION_COMPUTER, NEMO_ACTION_HOME, NEMO_ACTION_EDIT, NEMO_ACTION_SEARCH, NULL }; @@ -1208,6 +1286,9 @@ nemo_window_initialize_menus (NemoWindow *window) action = gtk_action_group_get_action (action_group, NEMO_ACTION_HOME); g_object_set (action, "short_label", _("_Home"), NULL); + action = gtk_action_group_get_action (action_group, NEMO_ACTION_EDIT); + g_object_set (action, "short_label", _("_Location"), NULL); + action = gtk_action_group_get_action (action_group, NEMO_ACTION_SHOW_HIDDEN_FILES); g_signal_handlers_block_by_func (action, action_show_hidden_files_callback, window); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), diff --git a/src/nemo-window-pane.c b/src/nemo-window-pane.c index 9c37e5fc5..38415a46d 100644 --- a/src/nemo-window-pane.c +++ b/src/nemo-window-pane.c @@ -45,6 +45,9 @@ #define DEBUG_FLAG NEMO_DEBUG_WINDOW #include +// For: NEMO_IS_DESKTOP_WINDOW +#include "nemo-desktop-window.h" + enum { PROP_WINDOW = 1, NUM_PROPERTIES @@ -746,9 +749,10 @@ nemo_window_pane_constructed (GObject *obj) g_signal_connect (pane->action_group, "pre-activate", G_CALLBACK (toolbar_action_group_activated_callback), pane); - gtk_box_pack_start (GTK_BOX (pane), + /* Pack to windows hbox (under the menu */ + gtk_box_pack_start (GTK_BOX (window->details->toolbar_holder), pane->tool_bar, - FALSE, FALSE, 0); + TRUE, TRUE, 0); /* start as non-active */ nemo_window_pane_set_active (pane, FALSE); @@ -828,6 +832,13 @@ nemo_window_pane_constructed (GObject *obj) */ gtk_widget_set_size_request (GTK_WIDGET (pane), 60, 60); + /* + * If we're on the desktop we need to make sure the toolbar can never show + */ + if (NEMO_IS_DESKTOP_WINDOW(window)) { + gtk_widget_hide (GTK_WIDGET (window->details->toolbar_holder)); + } + /* we can unref the size group now */ g_object_unref (header_size_group); } @@ -1048,10 +1059,17 @@ nemo_window_pane_grab_focus (NemoWindowPane *pane) void nemo_window_pane_ensure_location_bar (NemoWindowPane *pane) { + gboolean fl_active; remember_focus_widget (pane); nemo_toolbar_set_show_main_bar (NEMO_TOOLBAR (pane->tool_bar), TRUE); - nemo_toolbar_set_show_location_entry (NEMO_TOOLBAR (pane->tool_bar), TRUE); + + fl_active = nemo_toolbar_get_show_location_entry (NEMO_TOOLBAR (pane->tool_bar)); + if (fl_active) { + nemo_toolbar_set_show_location_entry (NEMO_TOOLBAR (pane->tool_bar), FALSE); + } else { + nemo_toolbar_set_show_location_entry (NEMO_TOOLBAR (pane->tool_bar), TRUE); + } if (!g_settings_get_boolean (nemo_window_state, NEMO_WINDOW_STATE_START_WITH_TOOLBAR)) { diff --git a/src/nemo-window-private.h b/src/nemo-window-private.h index 416da11c2..ffcfee5ca 100644 --- a/src/nemo-window-private.h +++ b/src/nemo-window-private.h @@ -90,6 +90,9 @@ struct NemoWindowDetails /* Toolbar */ GtkWidget *toolbar; + /* Toolbar holder */ + GtkWidget *toolbar_holder; + guint extensions_toolbar_merge_id; GtkActionGroup *extensions_toolbar_action_group; diff --git a/src/nemo-window.c b/src/nemo-window.c index 50a06e896..1ef3449fc 100644 --- a/src/nemo-window.c +++ b/src/nemo-window.c @@ -535,6 +535,7 @@ nemo_window_constructed (GObject *self) GtkWidget *statusbar; GtkWidget *hpaned; GtkWidget *vbox; + GtkWidget *toolbar_holder; NemoWindowPane *pane; NemoWindowSlot *slot; NemoApplication *application; @@ -564,6 +565,12 @@ nemo_window_constructed (GObject *self) gtk_widget_show (menu); gtk_container_add (GTK_CONTAINER (grid), menu); + /* Set up the toolbar place holder */ + toolbar_holder = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_container_add (GTK_CONTAINER (grid), toolbar_holder); + gtk_widget_show (toolbar_holder); + window->details->toolbar_holder = toolbar_holder; + /* Register to menu provider extension signal managing menu updates */ g_signal_connect_object (nemo_signaller_get_current (), "popup_menu_changed", G_CALLBACK (nemo_window_load_extension_menus), window, G_CONNECT_SWAPPED); @@ -837,6 +844,10 @@ nemo_window_close_pane (NemoWindow *window, window->details->active_pane = NULL; } + /* Required really. Destroying the NemoWindowPane still leaves behind the toolbar. + * This kills it off. Do it before we call gtk_widget_destroy for safety. */ + gtk_container_remove (GTK_CONTAINER (window->details->toolbar_holder), GTK_WIDGET (pane->tool_bar)); + window->details->panes = g_list_remove (window->details->panes, pane); gtk_widget_destroy (GTK_WIDGET (pane)); @@ -888,7 +899,6 @@ void nemo_window_set_active_slot (NemoWindow *window, NemoWindowSlot *new_slot) { NemoWindowSlot *old_slot; - g_assert (NEMO_IS_WINDOW (window)); DEBUG ("Setting new slot %p as active", new_slot); @@ -911,7 +921,7 @@ nemo_window_set_active_slot (NemoWindow *window, NemoWindowSlot *new_slot) if (old_slot->content_view != NULL) { nemo_window_disconnect_content_view (window, old_slot->content_view); } - + gtk_widget_hide (GTK_WIDGET (old_slot->pane->tool_bar)); /* inform slot & view */ g_signal_emit_by_name (old_slot, "inactive"); } @@ -935,6 +945,14 @@ nemo_window_set_active_slot (NemoWindow *window, NemoWindowSlot *new_slot) nemo_window_connect_content_view (window, new_slot->content_view); } + // Show active toolbar + gboolean show_toolbar; + show_toolbar = g_settings_get_boolean (nemo_window_state, NEMO_WINDOW_STATE_START_WITH_TOOLBAR); + + if ( show_toolbar) { + gtk_widget_show (GTK_WIDGET (new_slot->pane->tool_bar)); + } + /* inform slot & view */ g_signal_emit_by_name (new_slot, "active"); } @@ -1775,6 +1793,9 @@ create_extra_pane (NemoWindow *window) gtk_paned_pack2 (paned, GTK_WIDGET (pane), TRUE, FALSE); } + /* Ensure the toolbar doesn't pop itself into existence (double toolbars suck.) */ + gtk_widget_hide (pane->tool_bar); + /* slot */ slot = nemo_window_pane_open_slot (NEMO_WINDOW_PANE (pane), NEMO_WINDOW_OPEN_SLOT_APPEND); @@ -2055,6 +2076,7 @@ nemo_window_split_view_on (NemoWindow *window) void nemo_window_split_view_off (NemoWindow *window) { + gboolean show_label_search_icon_toolbar; NemoWindowPane *pane, *active_pane; GList *l, *next; @@ -2074,7 +2096,9 @@ nemo_window_split_view_off (NemoWindow *window) active_pane->action_group); nemo_window_update_show_hide_menu_items (window); - window_set_search_action_text (window, TRUE); + + show_label_search_icon_toolbar = g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_LABEL_SEARCH_ICON_TOOLBAR); + window_set_search_action_text (window, show_label_search_icon_toolbar); } gboolean