diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/nautilus-information-panel.c | 15 | ||||
-rw-r--r-- | src/nautilus-link-set-window.c | 267 | ||||
-rw-r--r-- | src/nautilus-link-set-window.h | 40 | ||||
-rw-r--r-- | src/nautilus-navigation-window-menus.c | 3 | ||||
-rw-r--r-- | src/nautilus-navigation-window.c | 38 | ||||
-rw-r--r-- | src/nautilus-object-window.c | 38 | ||||
-rw-r--r-- | src/nautilus-preferences-dialog.c | 18 | ||||
-rw-r--r-- | src/nautilus-sidebar.c | 15 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 38 | ||||
-rw-r--r-- | src/nautilus-window-menus.c | 3 | ||||
-rw-r--r-- | src/nautilus-window.c | 38 |
12 files changed, 69 insertions, 447 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index eb074b047..ca0ad5cf4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,6 @@ bin_PROGRAMS=nautilus INCLUDES =\ -I$(top_srcdir) \ - -I$(top_srcdir)/cut-n-paste-code/widgets/e-paned \ -I$(top_srcdir)/cut-n-paste-code/widgets/gimphwrapbox \ $(NAUTILUS_SRC_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ @@ -50,7 +49,6 @@ nautilus_SOURCES = \ nautilus-component-adapter-factory.c \ nautilus-desktop-window.c \ nautilus-first-time-druid.c \ - nautilus-link-set-window.c \ nautilus-location-bar.c \ nautilus-main.c \ nautilus-navigation-bar.c \ @@ -86,7 +84,6 @@ nautilus_SOURCES = \ nautilus-component-adapter-factory.h \ nautilus-desktop-window.h \ nautilus-first-time-druid.h \ - nautilus-link-set-window.h \ nautilus-location-bar.h \ nautilus-main.h \ nautilus-navigation-bar.h \ diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index 3f2a3a4fb..0a188ddc7 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -30,7 +30,6 @@ #include <config.h> #include "nautilus-sidebar.h" -#include "nautilus-link-set-window.h" #include "nautilus-sidebar-tabs.h" #include "nautilus-sidebar-title.h" @@ -1282,23 +1281,13 @@ command_button_callback (GtkWidget *button, char *id_str) /* interpret commands for buttons specified by metadata. Handle some built-in ones explicitly, or fork a shell to handle general ones */ -/* for now, we only handle a few built in commands */ +/* for now, we don't have any of these */ static void metadata_button_callback (GtkWidget *button, const char *command_str) { - GtkWindow *window; NautilusSidebar *sidebar; - char *path; - + sidebar = NAUTILUS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (button))); - if (strcmp (command_str, "#linksets") == 0) { - window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar))); - path = gnome_vfs_get_local_path_from_uri (sidebar->details->uri); - if (path != NULL) { - nautilus_link_set_toggle_configure_window (path, window); - g_free (path); - } - } } static void diff --git a/src/nautilus-link-set-window.c b/src/nautilus-link-set-window.c deleted file mode 100644 index cfae507dd..000000000 --- a/src/nautilus-link-set-window.c +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* - * Nautilus - * - * Copyright (C) 2000 Eazel, Inc. - * - * Nautilus is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Andy Hertzfeld <andy@eazel.com> - */ - -/* nautilus-link-set-window.c: window of checkboxes for configuring link sets - */ - -#include <config.h> -#include "nautilus-link-set-window.h" - -#include "nautilus-window.h" -#include <eel/eel-glib-extensions.h> -#include <eel/eel-string.h> -#include <eel/eel-xml-extensions.h> -#include <libxml/parser.h> -#include <libxml/xmlmemory.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtksignal.h> -#include <gtk/gtktable.h> -#include <gtk/gtktogglebutton.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkwindow.h> -#include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-uidefs.h> -#include <libgnomevfs/gnome-vfs.h> -#include <libnautilus-private/nautilus-file.h> -#include <libnautilus-private/nautilus-global-preferences.h> -#include <libnautilus-private/nautilus-link-set.h> -#include <libnautilus-private/nautilus-link.h> -#include <libnautilus-private/nautilus-metadata.h> -#include <stdlib.h> - -/* global to hold the currently allocated link set window, if any */ - -static GtkWindow *link_set_window = NULL; - -/* handle the check box toggling */ -static void -link_set_check_box_toggled (GtkToggleButton *button, GtkWindow *window_to_update) -{ - char *path, *name; - - path = g_object_get_data (G_OBJECT (button), "nautilus_directory_path"); - name = g_object_get_data (G_OBJECT (button), "nautilus_link_set_name"); - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) - nautilus_link_set_install(path, name); - else - nautilus_link_set_remove(path, name); - - /* tell the associated window to reload in order to display the new links (or lack thereof) */ - nautilus_window_reload (NAUTILUS_WINDOW(window_to_update)); -} - -/* utility to make a link set checkbox that installs and removes it's corresponding - link set when toggled */ - -static void -make_link_set_check_box(const char *directory_path, GtkWidget *checkbox_table, - int index, char *name, GtkWindow *window) -{ - GtkWidget *checkbox, *label; - - /* add a checkbox and a label */ - - checkbox = gtk_check_button_new (); - gtk_widget_show (checkbox); - - label = gtk_label_new (name); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_widget_show(label); - - gtk_container_add (GTK_CONTAINER (checkbox), label); - gtk_widget_show(checkbox); - - /* Set initial state of checkbox. */ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), nautilus_link_set_is_installed(directory_path, name)); - - /* Attach the parameters and a signal handler. */ - g_object_set_data_full (G_OBJECT (checkbox), - "nautilus_directory_path", - g_strdup (directory_path), - g_free); - - g_object_set_data_full (G_OBJECT (checkbox), - "nautilus_link_set_name", - g_strdup(name), - g_free); - - g_signal_connect (G_OBJECT (checkbox), - "toggled", - G_CALLBACK (link_set_check_box_toggled), - window); - - - /* attach the checkbox to the table */ - if (index % 2) { - gtk_table_attach_defaults (GTK_TABLE (checkbox_table), checkbox, - 0, 1, - index >> 1, (index >> 1) + 1); - } else { - gtk_table_attach_defaults (GTK_TABLE (checkbox_table), checkbox, - 1, 2, - index >> 1, (index >> 1) + 1); - } -} - -/* utility routine to return a list of link set names by iterating the link set directory */ -static GList * -get_link_set_names (void) -{ - GnomeVFSResult result; - GnomeVFSFileInfo *current_file_info; - GList *list, *node; - char *link_set_uri, *link_set_name, *dot_pos; - GList *link_set_list; - - /* get a uri to the link set directory */ - link_set_uri = gnome_vfs_get_uri_from_local_path (NAUTILUS_DATADIR "/linksets"); - - /* get the directory info */ - result = gnome_vfs_directory_list_load (&list, link_set_uri, - GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result != GNOME_VFS_OK) { - g_free (link_set_uri); - return NULL; - } - - link_set_list = NULL; - - /* FIXME bugzilla.gnome.org 45049: The names should really come from the names inside the files. */ - /* build the list by iterating through the directory info */ - for (node = list; node != NULL; node = node->next) { - current_file_info = node->data; - link_set_name = g_strdup (current_file_info->name); - - /* strip file type suffix */ - dot_pos = strrchr (link_set_name, '.'); - if (dot_pos != NULL) { - *dot_pos = '\0'; - } - - link_set_list = g_list_prepend (link_set_list, link_set_name); - } - - gnome_vfs_file_info_list_free (list); - g_free (link_set_uri); - - return eel_g_str_list_alphabetize (link_set_list); -} - -/* create a window used to configure the link sets in the passed in directory */ -GtkWindow * -nautilus_link_set_configure_window (const char *directory_path, GtkWindow *window_to_update) -{ - char *temp_str; - int link_set_count, index; - GtkWindow *window; - GtkWidget *vbox, *label; - GtkWidget *checkbox_table, *scrolled_window; - GList *link_set_names, *current_link_set; - - /* Create the window. */ - window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - gtk_container_set_border_width (GTK_CONTAINER (window), GNOME_PAD); - gtk_widget_set_usize(GTK_WIDGET(window), 280, 120); - - /* set the window title */ - gtk_window_set_title (window, _("Link sets")); - gtk_window_set_wmclass (window, "link_sets", "Nautilus"); - - /* fetch the link set names */ - link_set_names = get_link_set_names (); - link_set_count = g_list_length (link_set_names); - - /* allocate a vbox to hold the contents of the window */ - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(window), vbox); - gtk_widget_show(vbox); - - /* add a descriptive label */ - label = gtk_label_new(_("Add or remove sets of links by clicking on the checkboxes below.")); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 4); - gtk_widget_show(label); - - /* allocate a table to hold the link set checkboxes */ - checkbox_table = gtk_table_new ((link_set_count + 1) / 2, 2, TRUE); - gtk_widget_show (checkbox_table); - gtk_container_set_border_width (GTK_CONTAINER (checkbox_table), GNOME_PAD); - - scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_NEVER, - GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), - checkbox_table); - gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); - gtk_widget_show (scrolled_window); - - /* iterate the directory to add a checkbox for each linkset found */ - index = 0; - for (current_link_set = link_set_names; current_link_set != NULL; - current_link_set = current_link_set->next) { - temp_str = (char *) current_link_set->data; - if ((temp_str[0] != '.') && (temp_str[0] != '\0')) - make_link_set_check_box(directory_path, checkbox_table, - index++, temp_str, window_to_update); - } - - eel_g_list_free_deep (link_set_names); - - /* show the window */ - gtk_window_set_position(window, GTK_WIN_POS_CENTER); - gtk_widget_show(GTK_WIDGET(window)); - return window; -} - -/* callback to clear the window global when the window is deleted */ -static gboolean -delete_window_callback (GtkWidget *widget, - GdkEvent *event, - gpointer user_data) -{ - link_set_window = NULL; - return FALSE; -} - -/* toggle the visiblity of the link set window */ -GtkWindow * -nautilus_link_set_toggle_configure_window (const char *directory_path, GtkWindow *window_to_update) -{ - if (link_set_window != NULL) { - gtk_widget_destroy (GTK_WIDGET (link_set_window)); - link_set_window = NULL; - } else { - link_set_window = nautilus_link_set_configure_window (directory_path, - window_to_update); - - g_signal_connect (G_OBJECT (link_set_window), "delete_event", - G_CALLBACK (delete_window_callback), NULL); - } - - return link_set_window; -} diff --git a/src/nautilus-link-set-window.h b/src/nautilus-link-set-window.h deleted file mode 100644 index e33ea13a3..000000000 --- a/src/nautilus-link-set-window.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* - * Nautilus - * - * Copyright (C) 2000 Eazel, Inc. - * - * Nautilus is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Andy Hertzfeld <andy@eazel.com> - */ - -/* nautilus-link-set-window.h: window for configuring link sets - */ - -#ifndef NAUTILUS_LINK_SET_WINDOW_H -#define NAUTILUS_LINK_SET_WINDOW_H - -#include <glib.h> -#include <libnautilus-private/nautilus-link-set.h> -#include <gtk/gtkwindow.h> - -GtkWindow *nautilus_link_set_configure_window (const char *directory_path, - GtkWindow *window); -GtkWindow *nautilus_link_set_toggle_configure_window (const char *directory_path, - GtkWindow *window_to_update); - -#endif /* NAUTILUS_LINK_SET_H */ diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c index 652ab9a05..38667db89 100644 --- a/src/nautilus-navigation-window-menus.c +++ b/src/nautilus-navigation-window-menus.c @@ -350,6 +350,7 @@ forget_history_if_yes (GtkDialog *dialog, int response, gpointer callback_data) if (response == GTK_RESPONSE_YES) { nautilus_forget_history (); } + gtk_object_destroy (GTK_OBJECT (dialog)); } static void @@ -791,6 +792,8 @@ remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callb uri = callback_data; nautilus_bookmark_list_delete_items_with_uri (get_bookmark_list (), uri); } + + gtk_object_destroy (GTK_OBJECT (dialog)); } static void diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 86d47defa..766af2ce5 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -601,7 +601,6 @@ nautilus_window_constructed (NautilusWindow *window) GtkWidget *view_as_menu_vbox; int sidebar_width; BonoboControl *location_bar_wrapper; - EPaned *panel; CORBA_Environment ev; Bonobo_PropertyBag property_bag; @@ -683,12 +682,11 @@ nautilus_window_constructed (NautilusWindow *window) set_initial_window_geometry (window); window->content_hbox = nautilus_horizontal_splitter_new (); - panel = E_PANED (window->content_hbox); /* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */ /* FIXME bugzilla.gnome.org 41245: No reality check on the value? */ sidebar_width = eel_preferences_get_integer (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH); - e_paned_set_position (E_PANED (window->content_hbox), sidebar_width); + gtk_paned_set_position (GTK_PANED (window->content_hbox), sidebar_width); } gtk_widget_show (window->content_hbox); bonobo_window_set_contents (BONOBO_WINDOW (window), window->content_hbox); @@ -703,9 +701,9 @@ nautilus_window_constructed (NautilusWindow *window) gtk_widget_show (GTK_WIDGET (window->sidebar)); g_signal_connect (G_OBJECT (window->sidebar), "location_changed", G_CALLBACK (go_to_callback), window); - e_paned_pack1 (E_PANED (window->content_hbox), - GTK_WIDGET (window->sidebar), - FALSE, TRUE); + gtk_paned_pack1 (GTK_PANED (window->content_hbox), + GTK_WIDGET (window->sidebar), + FALSE, TRUE); #if 0 bonobo_ui_engine_add_sync (bonobo_window_get_ui_engine (BONOBO_WINDOW (window)), sidebar_sync); @@ -1930,13 +1928,13 @@ nautilus_window_set_content_view_widget (NautilusWindow *window, * We should use inheritance instead of these special cases * for the desktop window. */ - if (!E_IS_PANED (window->content_hbox)) { + if (!GTK_IS_PANED (window->content_hbox)) { gtk_container_add (GTK_CONTAINER (window->content_hbox), GTK_WIDGET (new_view)); } else { - e_paned_pack2 (E_PANED (window->content_hbox), - GTK_WIDGET (new_view), - TRUE, TRUE); + gtk_paned_pack2 (GTK_PANED (window->content_hbox), + GTK_WIDGET (new_view), + TRUE, TRUE); } } @@ -2071,28 +2069,19 @@ nautilus_window_hide_sidebar (NautilusWindow *window) if (window->sidebar == NULL) { return; } - gtk_widget_hide (GTK_WIDGET (window->sidebar)); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), 0); - } + nautilus_horizontal_splitter_collapse + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } void nautilus_window_show_sidebar (NautilusWindow *window) { - GtkWidget *widget; - if (window->sidebar == NULL) { return; } - widget = GTK_WIDGET (window->sidebar); - gtk_widget_show (widget); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), widget->allocation.width); - /* Make sure sidebar is not in collapsed form also */ - nautilus_horizontal_splitter_expand (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); - } + nautilus_horizontal_splitter_expand + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } @@ -2101,7 +2090,8 @@ nautilus_window_sidebar_showing (NautilusWindow *window) { g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), FALSE); - return window->sidebar != NULL && GTK_WIDGET_VISIBLE (window->sidebar); + return GTK_IS_PANED (window->content_hbox) + && gtk_paned_get_position (GTK_PANED (window->content_hbox)) != 0; } void diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 86d47defa..766af2ce5 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -601,7 +601,6 @@ nautilus_window_constructed (NautilusWindow *window) GtkWidget *view_as_menu_vbox; int sidebar_width; BonoboControl *location_bar_wrapper; - EPaned *panel; CORBA_Environment ev; Bonobo_PropertyBag property_bag; @@ -683,12 +682,11 @@ nautilus_window_constructed (NautilusWindow *window) set_initial_window_geometry (window); window->content_hbox = nautilus_horizontal_splitter_new (); - panel = E_PANED (window->content_hbox); /* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */ /* FIXME bugzilla.gnome.org 41245: No reality check on the value? */ sidebar_width = eel_preferences_get_integer (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH); - e_paned_set_position (E_PANED (window->content_hbox), sidebar_width); + gtk_paned_set_position (GTK_PANED (window->content_hbox), sidebar_width); } gtk_widget_show (window->content_hbox); bonobo_window_set_contents (BONOBO_WINDOW (window), window->content_hbox); @@ -703,9 +701,9 @@ nautilus_window_constructed (NautilusWindow *window) gtk_widget_show (GTK_WIDGET (window->sidebar)); g_signal_connect (G_OBJECT (window->sidebar), "location_changed", G_CALLBACK (go_to_callback), window); - e_paned_pack1 (E_PANED (window->content_hbox), - GTK_WIDGET (window->sidebar), - FALSE, TRUE); + gtk_paned_pack1 (GTK_PANED (window->content_hbox), + GTK_WIDGET (window->sidebar), + FALSE, TRUE); #if 0 bonobo_ui_engine_add_sync (bonobo_window_get_ui_engine (BONOBO_WINDOW (window)), sidebar_sync); @@ -1930,13 +1928,13 @@ nautilus_window_set_content_view_widget (NautilusWindow *window, * We should use inheritance instead of these special cases * for the desktop window. */ - if (!E_IS_PANED (window->content_hbox)) { + if (!GTK_IS_PANED (window->content_hbox)) { gtk_container_add (GTK_CONTAINER (window->content_hbox), GTK_WIDGET (new_view)); } else { - e_paned_pack2 (E_PANED (window->content_hbox), - GTK_WIDGET (new_view), - TRUE, TRUE); + gtk_paned_pack2 (GTK_PANED (window->content_hbox), + GTK_WIDGET (new_view), + TRUE, TRUE); } } @@ -2071,28 +2069,19 @@ nautilus_window_hide_sidebar (NautilusWindow *window) if (window->sidebar == NULL) { return; } - gtk_widget_hide (GTK_WIDGET (window->sidebar)); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), 0); - } + nautilus_horizontal_splitter_collapse + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } void nautilus_window_show_sidebar (NautilusWindow *window) { - GtkWidget *widget; - if (window->sidebar == NULL) { return; } - widget = GTK_WIDGET (window->sidebar); - gtk_widget_show (widget); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), widget->allocation.width); - /* Make sure sidebar is not in collapsed form also */ - nautilus_horizontal_splitter_expand (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); - } + nautilus_horizontal_splitter_expand + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } @@ -2101,7 +2090,8 @@ nautilus_window_sidebar_showing (NautilusWindow *window) { g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), FALSE); - return window->sidebar != NULL && GTK_WIDGET_VISIBLE (window->sidebar); + return GTK_IS_PANED (window->content_hbox) + && gtk_paned_get_position (GTK_PANED (window->content_hbox)) != 0; } void diff --git a/src/nautilus-preferences-dialog.c b/src/nautilus-preferences-dialog.c index c1cc22048..069d7cdb7 100644 --- a/src/nautilus-preferences-dialog.c +++ b/src/nautilus-preferences-dialog.c @@ -430,14 +430,6 @@ dialog_button_response_callback (GtkDialog *dialog, gtk_widget_hide (GTK_WIDGET (dialog)); } -static gboolean -dialog_close_callback (GtkWidget *dialog, - gpointer user_data) -{ - gtk_widget_hide (dialog); - return TRUE; -} - static GtkWidget * preferences_dialog_create (void) { @@ -449,14 +441,10 @@ preferences_dialog_create (void) gtk_window_set_wmclass (GTK_WINDOW (dialog), "nautilus_preferences", "Nautilus"); g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (dialog_button_response_callback), - dialog); + "response", + G_CALLBACK (dialog_button_response_callback), + dialog); - g_signal_connect (G_OBJECT (dialog), - "close", - G_CALLBACK (dialog_close_callback), - NULL); return dialog; } diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index 3f2a3a4fb..0a188ddc7 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -30,7 +30,6 @@ #include <config.h> #include "nautilus-sidebar.h" -#include "nautilus-link-set-window.h" #include "nautilus-sidebar-tabs.h" #include "nautilus-sidebar-title.h" @@ -1282,23 +1281,13 @@ command_button_callback (GtkWidget *button, char *id_str) /* interpret commands for buttons specified by metadata. Handle some built-in ones explicitly, or fork a shell to handle general ones */ -/* for now, we only handle a few built in commands */ +/* for now, we don't have any of these */ static void metadata_button_callback (GtkWidget *button, const char *command_str) { - GtkWindow *window; NautilusSidebar *sidebar; - char *path; - + sidebar = NAUTILUS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (button))); - if (strcmp (command_str, "#linksets") == 0) { - window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar))); - path = gnome_vfs_get_local_path_from_uri (sidebar->details->uri); - if (path != NULL) { - nautilus_link_set_toggle_configure_window (path, window); - g_free (path); - } - } } static void diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 86d47defa..766af2ce5 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -601,7 +601,6 @@ nautilus_window_constructed (NautilusWindow *window) GtkWidget *view_as_menu_vbox; int sidebar_width; BonoboControl *location_bar_wrapper; - EPaned *panel; CORBA_Environment ev; Bonobo_PropertyBag property_bag; @@ -683,12 +682,11 @@ nautilus_window_constructed (NautilusWindow *window) set_initial_window_geometry (window); window->content_hbox = nautilus_horizontal_splitter_new (); - panel = E_PANED (window->content_hbox); /* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */ /* FIXME bugzilla.gnome.org 41245: No reality check on the value? */ sidebar_width = eel_preferences_get_integer (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH); - e_paned_set_position (E_PANED (window->content_hbox), sidebar_width); + gtk_paned_set_position (GTK_PANED (window->content_hbox), sidebar_width); } gtk_widget_show (window->content_hbox); bonobo_window_set_contents (BONOBO_WINDOW (window), window->content_hbox); @@ -703,9 +701,9 @@ nautilus_window_constructed (NautilusWindow *window) gtk_widget_show (GTK_WIDGET (window->sidebar)); g_signal_connect (G_OBJECT (window->sidebar), "location_changed", G_CALLBACK (go_to_callback), window); - e_paned_pack1 (E_PANED (window->content_hbox), - GTK_WIDGET (window->sidebar), - FALSE, TRUE); + gtk_paned_pack1 (GTK_PANED (window->content_hbox), + GTK_WIDGET (window->sidebar), + FALSE, TRUE); #if 0 bonobo_ui_engine_add_sync (bonobo_window_get_ui_engine (BONOBO_WINDOW (window)), sidebar_sync); @@ -1930,13 +1928,13 @@ nautilus_window_set_content_view_widget (NautilusWindow *window, * We should use inheritance instead of these special cases * for the desktop window. */ - if (!E_IS_PANED (window->content_hbox)) { + if (!GTK_IS_PANED (window->content_hbox)) { gtk_container_add (GTK_CONTAINER (window->content_hbox), GTK_WIDGET (new_view)); } else { - e_paned_pack2 (E_PANED (window->content_hbox), - GTK_WIDGET (new_view), - TRUE, TRUE); + gtk_paned_pack2 (GTK_PANED (window->content_hbox), + GTK_WIDGET (new_view), + TRUE, TRUE); } } @@ -2071,28 +2069,19 @@ nautilus_window_hide_sidebar (NautilusWindow *window) if (window->sidebar == NULL) { return; } - gtk_widget_hide (GTK_WIDGET (window->sidebar)); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), 0); - } + nautilus_horizontal_splitter_collapse + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } void nautilus_window_show_sidebar (NautilusWindow *window) { - GtkWidget *widget; - if (window->sidebar == NULL) { return; } - widget = GTK_WIDGET (window->sidebar); - gtk_widget_show (widget); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), widget->allocation.width); - /* Make sure sidebar is not in collapsed form also */ - nautilus_horizontal_splitter_expand (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); - } + nautilus_horizontal_splitter_expand + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } @@ -2101,7 +2090,8 @@ nautilus_window_sidebar_showing (NautilusWindow *window) { g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), FALSE); - return window->sidebar != NULL && GTK_WIDGET_VISIBLE (window->sidebar); + return GTK_IS_PANED (window->content_hbox) + && gtk_paned_get_position (GTK_PANED (window->content_hbox)) != 0; } void diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index 652ab9a05..38667db89 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -350,6 +350,7 @@ forget_history_if_yes (GtkDialog *dialog, int response, gpointer callback_data) if (response == GTK_RESPONSE_YES) { nautilus_forget_history (); } + gtk_object_destroy (GTK_OBJECT (dialog)); } static void @@ -791,6 +792,8 @@ remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callb uri = callback_data; nautilus_bookmark_list_delete_items_with_uri (get_bookmark_list (), uri); } + + gtk_object_destroy (GTK_OBJECT (dialog)); } static void diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 86d47defa..766af2ce5 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -601,7 +601,6 @@ nautilus_window_constructed (NautilusWindow *window) GtkWidget *view_as_menu_vbox; int sidebar_width; BonoboControl *location_bar_wrapper; - EPaned *panel; CORBA_Environment ev; Bonobo_PropertyBag property_bag; @@ -683,12 +682,11 @@ nautilus_window_constructed (NautilusWindow *window) set_initial_window_geometry (window); window->content_hbox = nautilus_horizontal_splitter_new (); - panel = E_PANED (window->content_hbox); /* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */ /* FIXME bugzilla.gnome.org 41245: No reality check on the value? */ sidebar_width = eel_preferences_get_integer (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH); - e_paned_set_position (E_PANED (window->content_hbox), sidebar_width); + gtk_paned_set_position (GTK_PANED (window->content_hbox), sidebar_width); } gtk_widget_show (window->content_hbox); bonobo_window_set_contents (BONOBO_WINDOW (window), window->content_hbox); @@ -703,9 +701,9 @@ nautilus_window_constructed (NautilusWindow *window) gtk_widget_show (GTK_WIDGET (window->sidebar)); g_signal_connect (G_OBJECT (window->sidebar), "location_changed", G_CALLBACK (go_to_callback), window); - e_paned_pack1 (E_PANED (window->content_hbox), - GTK_WIDGET (window->sidebar), - FALSE, TRUE); + gtk_paned_pack1 (GTK_PANED (window->content_hbox), + GTK_WIDGET (window->sidebar), + FALSE, TRUE); #if 0 bonobo_ui_engine_add_sync (bonobo_window_get_ui_engine (BONOBO_WINDOW (window)), sidebar_sync); @@ -1930,13 +1928,13 @@ nautilus_window_set_content_view_widget (NautilusWindow *window, * We should use inheritance instead of these special cases * for the desktop window. */ - if (!E_IS_PANED (window->content_hbox)) { + if (!GTK_IS_PANED (window->content_hbox)) { gtk_container_add (GTK_CONTAINER (window->content_hbox), GTK_WIDGET (new_view)); } else { - e_paned_pack2 (E_PANED (window->content_hbox), - GTK_WIDGET (new_view), - TRUE, TRUE); + gtk_paned_pack2 (GTK_PANED (window->content_hbox), + GTK_WIDGET (new_view), + TRUE, TRUE); } } @@ -2071,28 +2069,19 @@ nautilus_window_hide_sidebar (NautilusWindow *window) if (window->sidebar == NULL) { return; } - gtk_widget_hide (GTK_WIDGET (window->sidebar)); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), 0); - } + nautilus_horizontal_splitter_collapse + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } void nautilus_window_show_sidebar (NautilusWindow *window) { - GtkWidget *widget; - if (window->sidebar == NULL) { return; } - widget = GTK_WIDGET (window->sidebar); - gtk_widget_show (widget); - if (window->content_hbox != NULL) { - e_paned_set_position (E_PANED (window->content_hbox), widget->allocation.width); - /* Make sure sidebar is not in collapsed form also */ - nautilus_horizontal_splitter_expand (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); - } + nautilus_horizontal_splitter_expand + (NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox)); nautilus_window_update_show_hide_menu_items (window); } @@ -2101,7 +2090,8 @@ nautilus_window_sidebar_showing (NautilusWindow *window) { g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), FALSE); - return window->sidebar != NULL && GTK_WIDGET_VISIBLE (window->sidebar); + return GTK_IS_PANED (window->content_hbox) + && gtk_paned_get_position (GTK_PANED (window->content_hbox)) != 0; } void |