Add navigation to the bookmarks editor and changed UI to be more inline

2003-04-23  Glynn Foster  <glynn.foster@sun.com>

	* src/nautilus-bookmarks-window.c:
	(nautilus_bookmarks_window_response_callback),
	(create_bookmarks_window), (go_to_selected_bookmark),
	(on_jump_button_clicked), (on_row_activated),
	(on_selection_changed), (repopulate):
	* src/nautilus-bookmarks-window.glade: Add navigation to the bookmarks
	editor and changed UI to be more inline with the Epiphany bookmarks
	dialog. Fixes bug #47180.
This commit is contained in:
Glynn Foster 2003-04-23 14:09:32 +00:00 committed by Glynn Foster
parent a389a2e0b1
commit e2543b16f0
3 changed files with 90 additions and 34 deletions

View file

@ -1,3 +1,14 @@
2003-04-23 Glynn Foster <glynn.foster@sun.com>
* src/nautilus-bookmarks-window.c:
(nautilus_bookmarks_window_response_callback),
(create_bookmarks_window), (go_to_selected_bookmark),
(on_jump_button_clicked), (on_row_activated),
(on_selection_changed), (repopulate):
* src/nautilus-bookmarks-window.glade: Add navigation to the bookmarks
editor and changed UI to be more inline with the Epiphany bookmarks
dialog. Fixes bug #47180.
2003-04-23 Alexander Larsson <alexl@redhat.com>
* src/file-manager/fm-desktop-icon-view.c (volume_ops_callback):

View file

@ -27,6 +27,7 @@
#include <config.h>
#include "nautilus-bookmarks-window.h"
#include "nautilus-window.h"
#include <libnautilus/nautilus-undo.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <eel/eel-gtk-extensions.h>
@ -53,12 +54,13 @@ static int selection_changed_id = 0;
static GtkWidget *name_field = NULL;
static int name_field_changed_signal_id;
static GtkWidget *remove_button = NULL;
static GtkWidget *jump_button = NULL;
static gboolean text_changed = FALSE;
static GtkWidget *uri_field = NULL;
static int uri_field_changed_signal_id;
static int row_changed_signal_id;
static int row_deleted_signal_id;
static int row_activated_signal_id;
/* forward declarations */
static guint get_selected_row (void);
@ -71,6 +73,8 @@ static void on_name_field_changed (GtkEditable
gpointer user_data);
static void on_remove_button_clicked (GtkButton *button,
gpointer user_data);
static void on_jump_button_clicked (GtkButton *button,
gpointer user_data);
static void on_row_changed (GtkListStore *store,
GtkTreePath *path,
GtkTreeIter *iter,
@ -78,6 +82,10 @@ static void on_row_changed (GtkListStore *store,
static void on_row_deleted (GtkListStore *store,
GtkTreePath *path,
gpointer user_data);
static void on_row_activated (GtkTreeView *view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data);
static void on_selection_changed (GtkTreeSelection *treeselection,
gpointer user_data);
@ -145,8 +153,9 @@ nautilus_bookmarks_window_response_callback (GtkDialog *dialog,
gtk_widget_show (err_dialog);
g_error_free (error);
}
} else
} else if (response_id == GTK_RESPONSE_CLOSE) {
gtk_widget_hide (GTK_WIDGET (dialog));
}
}
static GtkListStore *
@ -221,6 +230,7 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
"bookmarks_dialog", &window,
"bookmark_tree_view", &bookmark_list_widget,
"bookmark_delete_button", &remove_button,
"bookmark_jump_button", &jump_button,
NULL);
if (!gui) {
return NULL;
@ -293,7 +303,9 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
row_deleted_signal_id =
g_signal_connect (bookmark_list_store, "row_deleted",
G_CALLBACK (on_row_deleted), NULL);
row_activated_signal_id =
g_signal_connect (bookmark_list_widget, "row_activated",
G_CALLBACK (on_row_activated), undo_manager_source);
selection_changed_id =
g_signal_connect (bookmark_selection, "changed",
G_CALLBACK (on_selection_changed), NULL);
@ -326,6 +338,8 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
G_CALLBACK (name_or_uri_field_activate), NULL);
g_signal_connect (remove_button, "clicked",
G_CALLBACK (on_remove_button_clicked), NULL);
g_signal_connect (jump_button, "clicked",
G_CALLBACK (on_jump_button_clicked), undo_manager_source);
/* Register to find out about icon theme changes */
g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
@ -466,6 +480,27 @@ on_name_field_changed (GtkEditable *editable,
text_changed = TRUE;
}
static void
go_to_selected_bookmark (NautilusWindow *window)
{
NautilusBookmark *selected;
char *uri = NULL;
selected = get_selected_bookmark ();
if (selected) {
uri = nautilus_bookmark_get_uri (selected);
nautilus_window_go_to (window, uri);
g_free (uri);
}
}
static void
on_jump_button_clicked (GtkButton *button,
gpointer user_data)
{
go_to_selected_bookmark (NAUTILUS_WINDOW (user_data));
}
static void
on_remove_button_clicked (GtkButton *button,
@ -553,6 +588,15 @@ on_row_changed (GtkListStore *store,
}
}
static void
on_row_activated (GtkTreeView *view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data)
{
go_to_selected_bookmark (NAUTILUS_WINDOW (user_data));
}
static void
on_row_deleted (GtkListStore *store,
GtkTreePath *path,
@ -587,6 +631,7 @@ on_selection_changed (GtkTreeSelection *treeselection,
/* Set the sensitivity of widgets that require a selection */
gtk_widget_set_sensitive (remove_button, selected != NULL);
gtk_widget_set_sensitive (jump_button, selected != NULL);
gtk_widget_set_sensitive (name_field, selected != NULL);
gtk_widget_set_sensitive (uri_field, selected != NULL);
@ -738,9 +783,13 @@ repopulate (void)
selection_changed_id);
g_signal_handler_block (bookmark_list_store,
row_deleted_signal_id);
g_signal_handler_block (bookmark_list_store,
row_activated_signal_id);
gtk_list_store_clear (store);
g_signal_handler_unblock (bookmark_selection,
row_activated_signal_id);
g_signal_handler_unblock (bookmark_list_store,
row_deleted_signal_id);
g_signal_handler_unblock (bookmark_selection,

View file

@ -14,17 +14,14 @@
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="border_width">2</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">10</property>
<child>
<widget class="GtkButton" id="helpbutton1">
@ -39,7 +36,31 @@
</child>
<child>
<widget class="GtkButton" id="closebutton1">
<widget class="GtkButton" id="bookmark_jump_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-jump-to</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-10</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="bookmark_delete_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-2</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -230,32 +251,7 @@
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="bookmark_delete_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-delete</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
<placeholder/>
</child>
<child>