1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
6
* Copyright (C) 1999, 2000 Eazel, Inc.
8
* Nautilus is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License as
10
* published by the Free Software Foundation; either version 2 of the
11
* License, or (at your option) any later version.
13
* Nautilus is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
* Authors: John Sullivan <sullivan@eazel.com>
25
/* nautilus-bookmarks-window.c - implementation of bookmark-editing window.
29
#include "nautilus-bookmarks-window.h"
30
#include "nautilus-window.h"
32
#include <libnautilus-private/nautilus-entry.h>
33
#include <libnautilus-private/nautilus-global-preferences.h>
35
#include <eel/eel-gtk-extensions.h>
36
#include <eel/eel-gnome-extensions.h>
39
#include <gdk/gdkkeysyms.h>
40
#include <glib/gi18n.h>
42
/* Static variables to keep track of window state. If there were
43
* more than one bookmark-editing window, these would be struct or
46
static int bookmark_list_changed_signal_id;
47
static NautilusBookmarkList *bookmarks = NULL;
48
static GtkTreeView *bookmark_list_widget = NULL; /* awkward name to distinguish from NautilusBookmarkList */
49
static GtkListStore *bookmark_list_store = NULL;
50
static GtkListStore *bookmark_empty_list_store = NULL;
51
static GtkTreeSelection *bookmark_selection = NULL;
52
static int selection_changed_id = 0;
53
static GtkWidget *name_field = NULL;
54
static int name_field_changed_signal_id;
55
static GtkWidget *remove_button = NULL;
56
static GtkWidget *jump_button = NULL;
57
static gboolean text_changed = FALSE;
58
static gboolean name_text_changed = FALSE;
59
static GtkWidget *uri_field = NULL;
60
static int uri_field_changed_signal_id;
61
static int row_changed_signal_id;
62
static int row_deleted_signal_id;
63
static int row_activated_signal_id;
64
static int button_pressed_signal_id;
65
static int key_pressed_signal_id;
67
/* We store a pointer to the bookmark in a column so when an item is moved
68
with DnD we know which item it is. However we have to be careful to keep
69
this in sync with the actual bookmark. Note that
70
nautilus_bookmark_list_insert_item() makes a copy of the bookmark, so we
71
have to fetch the new copy and update our pointer. */
72
#define BOOKMARK_LIST_COLUMN_ICON 0
73
#define BOOKMARK_LIST_COLUMN_NAME 1
74
#define BOOKMARK_LIST_COLUMN_BOOKMARK 2
75
#define BOOKMARK_LIST_COLUMN_STYLE 3
76
#define BOOKMARK_LIST_COLUMN_COUNT 4
78
/* Larger size initially; user can stretch or shrink (but not shrink below min) */
79
#define BOOKMARKS_WINDOW_INITIAL_WIDTH 500
80
#define BOOKMARKS_WINDOW_INITIAL_HEIGHT 200
83
get_selection_exists (void)
85
return gtk_tree_selection_get_selected (bookmark_selection, NULL, NULL);
89
get_selected_row (void)
96
g_assert (get_selection_exists());
98
model = GTK_TREE_MODEL (bookmark_list_store);
99
gtk_tree_selection_get_selected (bookmark_selection,
103
path = gtk_tree_model_get_path (model, &iter);
104
indices = gtk_tree_path_get_indices (path);
106
gtk_tree_path_free (path);
110
static NautilusBookmark *
111
get_selected_bookmark (void)
113
g_return_val_if_fail(NAUTILUS_IS_BOOKMARK_LIST(bookmarks), NULL);
115
if (!get_selection_exists())
118
if (nautilus_bookmark_list_length (bookmarks) < 1)
121
return nautilus_bookmark_list_item_at(bookmarks, get_selected_row ());
125
nautilus_bookmarks_window_response_cb (GtkDialog *dialog,
127
gpointer callback_data)
129
if (response_id == GTK_RESPONSE_HELP) {
130
GError *error = NULL;
132
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
133
"help:gnome-help/nautilus-bookmarks-edit",
134
gtk_get_current_event_time (), &error);
137
GtkWidget *err_dialog;
138
err_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
139
GTK_DIALOG_DESTROY_WITH_PARENT,
142
_("There was an error displaying help: \n%s"),
145
g_signal_connect (G_OBJECT (err_dialog),
146
"response", G_CALLBACK (gtk_widget_destroy),
148
gtk_window_set_resizable (GTK_WINDOW (err_dialog), FALSE);
149
gtk_widget_show (err_dialog);
150
g_error_free (error);
152
} else if (response_id == GTK_RESPONSE_CLOSE) {
153
gtk_widget_destroy (GTK_WIDGET (dialog));
158
nautilus_bookmarks_window_key_press_event_cb (GtkWindow *window,
162
if (event->state & GDK_CONTROL_MASK && event->keyval == GDK_KEY_w) {
163
gtk_widget_destroy (GTK_WIDGET (window));
170
static GtkListStore *
171
create_bookmark_store (void)
173
return gtk_list_store_new (BOOKMARK_LIST_COLUMN_COUNT,
181
setup_empty_list (void)
185
bookmark_empty_list_store = create_bookmark_store ();
186
gtk_list_store_append (bookmark_empty_list_store, &iter);
188
gtk_list_store_set (bookmark_empty_list_store, &iter,
189
BOOKMARK_LIST_COLUMN_NAME, _("No bookmarks defined"),
190
BOOKMARK_LIST_COLUMN_STYLE, PANGO_STYLE_ITALIC,
195
on_selection_changed (GtkTreeSelection *treeselection,
198
NautilusBookmark *selected;
199
const char *name = NULL;
200
char *entry_text = NULL;
203
g_assert (GTK_IS_ENTRY (name_field));
204
g_assert (GTK_IS_ENTRY (uri_field));
206
selected = get_selected_bookmark ();
209
name = nautilus_bookmark_get_name (selected);
210
location = nautilus_bookmark_get_location (selected);
211
entry_text = g_file_get_parse_name (location);
213
g_object_unref (location);
216
/* Set the sensitivity of widgets that require a selection */
217
gtk_widget_set_sensitive (remove_button, selected != NULL);
218
gtk_widget_set_sensitive (jump_button, selected != NULL);
219
gtk_widget_set_sensitive (name_field, selected != NULL);
220
gtk_widget_set_sensitive (uri_field, selected != NULL);
222
g_signal_handler_block (name_field, name_field_changed_signal_id);
223
nautilus_entry_set_text (NAUTILUS_ENTRY (name_field),
225
g_signal_handler_unblock (name_field, name_field_changed_signal_id);
227
g_signal_handler_block (uri_field, uri_field_changed_signal_id);
228
nautilus_entry_set_text (NAUTILUS_ENTRY (uri_field),
229
entry_text ? entry_text : "");
230
g_signal_handler_unblock (uri_field, uri_field_changed_signal_id);
232
text_changed = FALSE;
233
name_text_changed = FALSE;
239
bookmarks_set_empty (gboolean empty)
244
gtk_tree_view_set_model (bookmark_list_widget,
245
GTK_TREE_MODEL (bookmark_empty_list_store));
246
gtk_widget_set_sensitive (GTK_WIDGET (bookmark_list_widget), FALSE);
248
gtk_tree_view_set_model (bookmark_list_widget,
249
GTK_TREE_MODEL (bookmark_list_store));
250
gtk_widget_set_sensitive (GTK_WIDGET (bookmark_list_widget), TRUE);
252
if (nautilus_bookmark_list_length (bookmarks) > 0 &&
253
!get_selection_exists ()) {
254
gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (bookmark_list_store),
256
gtk_tree_selection_select_iter (bookmark_selection, &iter);
260
on_selection_changed (bookmark_selection, NULL);
266
NautilusBookmark *selected;
269
GtkTreeRowReference *reference;
272
g_assert (GTK_IS_TREE_VIEW (bookmark_list_widget));
273
g_assert (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
275
store = GTK_LIST_STORE (bookmark_list_store);
277
selected = get_selected_bookmark ();
279
g_signal_handler_block (bookmark_selection,
280
selection_changed_id);
281
g_signal_handler_block (bookmark_list_store,
282
row_deleted_signal_id);
283
g_signal_handler_block (bookmark_list_widget,
284
row_activated_signal_id);
285
g_signal_handler_block (bookmark_list_widget,
286
key_pressed_signal_id);
287
g_signal_handler_block (bookmark_list_widget,
288
button_pressed_signal_id);
290
gtk_list_store_clear (store);
292
g_signal_handler_unblock (bookmark_list_widget,
293
row_activated_signal_id);
294
g_signal_handler_unblock (bookmark_list_widget,
295
key_pressed_signal_id);
296
g_signal_handler_unblock (bookmark_list_widget,
297
button_pressed_signal_id);
298
g_signal_handler_unblock (bookmark_list_store,
299
row_deleted_signal_id);
300
g_signal_handler_unblock (bookmark_selection,
301
selection_changed_id);
303
/* Fill the list in with the bookmark names. */
304
g_signal_handler_block (store, row_changed_signal_id);
308
for (index = 0; index < nautilus_bookmark_list_length (bookmarks); ++index) {
309
NautilusBookmark *bookmark;
310
const char *bookmark_name;
311
GIcon *bookmark_icon;
314
bookmark = nautilus_bookmark_list_item_at (bookmarks, index);
315
bookmark_name = nautilus_bookmark_get_name (bookmark);
316
bookmark_icon = nautilus_bookmark_get_icon (bookmark);
318
gtk_list_store_append (store, &iter);
319
gtk_list_store_set (store, &iter,
320
BOOKMARK_LIST_COLUMN_ICON, bookmark_icon,
321
BOOKMARK_LIST_COLUMN_NAME, bookmark_name,
322
BOOKMARK_LIST_COLUMN_BOOKMARK, bookmark,
323
BOOKMARK_LIST_COLUMN_STYLE, PANGO_STYLE_NORMAL,
326
if (bookmark == selected) {
327
/* save old selection */
330
path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &iter);
331
reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path);
332
gtk_tree_path_free (path);
335
g_object_unref (bookmark_icon);
338
g_signal_handler_unblock (store, row_changed_signal_id);
340
if (reference != NULL) {
341
/* restore old selection */
343
/* bookmarks_set_empty() will call the selection change handler,
344
* so we block it here in case of selection change.
346
g_signal_handler_block (bookmark_selection, selection_changed_id);
348
g_assert (index != 0);
349
g_assert (gtk_tree_row_reference_valid (reference));
351
path = gtk_tree_row_reference_get_path (reference);
352
gtk_tree_selection_select_path (bookmark_selection, path);
353
gtk_tree_row_reference_free (reference);
354
gtk_tree_path_free (path);
356
g_signal_handler_unblock (bookmark_selection, selection_changed_id);
359
bookmarks_set_empty (index == 0);
363
on_bookmark_list_changed (NautilusBookmarkList *bookmarks, gpointer data)
365
g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
367
/* maybe add logic here or in repopulate to save/restore selection */
372
on_name_field_changed (GtkEditable *editable,
376
g_return_if_fail(GTK_IS_TREE_VIEW(bookmark_list_widget));
377
g_return_if_fail(GTK_IS_ENTRY(name_field));
379
if (!get_selection_exists())
382
/* Update text displayed in list instantly. Also remember that
383
* user has changed text so we update real bookmark later.
385
gtk_tree_selection_get_selected (bookmark_selection,
389
gtk_list_store_set (bookmark_list_store,
390
&iter, BOOKMARK_LIST_COLUMN_NAME,
391
gtk_entry_get_text (GTK_ENTRY (name_field)),
394
name_text_changed = TRUE;
398
open_selected_bookmark (NautilusWindow *window)
400
NautilusBookmark *selected;
403
selected = get_selected_bookmark ();
409
location = nautilus_bookmark_get_location (selected);
410
if (location == NULL) {
414
nautilus_window_go_to (window, location);
416
g_object_unref (location);
420
on_jump_button_clicked (GtkButton *button,
423
open_selected_bookmark (user_data);
427
bookmarks_delete_bookmark (void)
431
gint *indices, row, rows;
433
g_assert (GTK_IS_TREE_VIEW (bookmark_list_widget));
435
if (!gtk_tree_selection_get_selected (bookmark_selection, NULL, &iter))
438
/* Remove the selected item from the list store. on_row_deleted() will
439
remove it from the bookmark list. */
440
path = gtk_tree_model_get_path (GTK_TREE_MODEL (bookmark_list_store),
442
indices = gtk_tree_path_get_indices (path);
444
gtk_tree_path_free (path);
446
gtk_list_store_remove (bookmark_list_store, &iter);
448
/* Try to select the same row, or the last one in the list. */
449
rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (bookmark_list_store), NULL);
454
bookmarks_set_empty (TRUE);
456
gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (bookmark_list_store),
458
gtk_tree_selection_select_iter (bookmark_selection, &iter);
463
on_remove_button_clicked (GtkButton *button,
466
bookmarks_delete_bookmark ();
470
/* This is a bit of a kludge to get DnD to work. We check if the row in the
471
GtkListStore matches the one in the bookmark list. If it doesn't, we assume
472
the bookmark has just been dragged here and we insert it into the bookmark
475
on_row_changed (GtkListStore *store,
480
NautilusBookmark *bookmark = NULL, *bookmark_in_list;
482
gboolean insert_bookmark = TRUE;
484
store = bookmark_list_store;
486
indices = gtk_tree_path_get_indices (path);
488
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
489
BOOKMARK_LIST_COLUMN_BOOKMARK, &bookmark,
492
/* If the bookmark in the list doesn't match the changed one, it must
493
have been dragged here, so we insert it into the list. */
494
if (row < (gint) nautilus_bookmark_list_length (bookmarks)) {
495
bookmark_in_list = nautilus_bookmark_list_item_at (bookmarks,
497
if (bookmark_in_list == bookmark)
498
insert_bookmark = FALSE;
501
if (insert_bookmark) {
502
g_signal_handler_block (bookmarks,
503
bookmark_list_changed_signal_id);
504
nautilus_bookmark_list_insert_item (bookmarks, bookmark, row);
505
g_signal_handler_unblock (bookmarks,
506
bookmark_list_changed_signal_id);
508
/* The bookmark will be copied when inserted into the list, so
509
we have to update the pointer in the list store. */
510
bookmark = nautilus_bookmark_list_item_at (bookmarks, row);
511
g_signal_handler_block (store, row_changed_signal_id);
512
gtk_list_store_set (store, iter,
513
BOOKMARK_LIST_COLUMN_BOOKMARK, bookmark,
515
g_signal_handler_unblock (store, row_changed_signal_id);
520
update_bookmark_from_text (void)
522
NautilusBookmark *bookmark, *bookmark_in_list;
529
g_assert (GTK_IS_ENTRY (name_field));
530
g_assert (GTK_IS_ENTRY (uri_field));
533
gtk_entry_get_text_length (GTK_ENTRY (uri_field)) == 0) {
537
location = g_file_parse_name
538
(gtk_entry_get_text (GTK_ENTRY (uri_field)));
540
bookmark = nautilus_bookmark_new (location,
541
name_text_changed ? gtk_entry_get_text (GTK_ENTRY (name_field)) : NULL,
544
g_object_unref (location);
546
selected_row = get_selected_row ();
548
/* turn off list updating 'cuz otherwise the list-reordering code runs
549
* after repopulate(), thus reordering the correctly-ordered list.
551
g_signal_handler_block (bookmarks,
552
bookmark_list_changed_signal_id);
553
nautilus_bookmark_list_delete_item_at (bookmarks, selected_row);
554
nautilus_bookmark_list_insert_item (bookmarks, bookmark, selected_row);
555
g_signal_handler_unblock (bookmarks,
556
bookmark_list_changed_signal_id);
557
g_object_unref (bookmark);
559
/* We also have to update the bookmark pointer in the list
561
gtk_tree_selection_get_selected (bookmark_selection,
563
g_signal_handler_block (bookmark_list_store,
564
row_changed_signal_id);
566
bookmark_in_list = nautilus_bookmark_list_item_at (bookmarks,
569
name = nautilus_bookmark_get_name (bookmark_in_list);
570
icon = nautilus_bookmark_get_icon (bookmark_in_list);
572
gtk_list_store_set (bookmark_list_store, &iter,
573
BOOKMARK_LIST_COLUMN_BOOKMARK, bookmark_in_list,
574
BOOKMARK_LIST_COLUMN_NAME, name,
575
BOOKMARK_LIST_COLUMN_ICON, icon,
577
g_signal_handler_unblock (bookmark_list_store,
578
row_changed_signal_id);
580
g_object_unref (icon);
583
/* The update_bookmark_from_text() calls in the
584
* on_button_pressed() and on_key_pressed() handlers
585
* of the tree view are a hack.
587
* The purpose is to track selection changes to the view
588
* and write the text fields back before the selection
591
* Note that the focus-out event of the text entries is emitted
592
* after the selection changed, else this would not not be neccessary.
596
on_button_pressed (GtkTreeView *view,
597
GdkEventButton *event,
600
update_bookmark_from_text ();
606
on_key_pressed (GtkTreeView *view,
610
if (event->keyval == GDK_KEY_Delete || event->keyval == GDK_KEY_KP_Delete) {
611
bookmarks_delete_bookmark ();
615
update_bookmark_from_text ();
621
on_row_activated (GtkTreeView *view,
623
GtkTreeViewColumn *column,
626
open_selected_bookmark (user_data);
630
on_row_deleted (GtkListStore *store,
636
indices = gtk_tree_path_get_indices (path);
639
g_signal_handler_block (bookmarks, bookmark_list_changed_signal_id);
640
nautilus_bookmark_list_delete_item_at (bookmarks, row);
641
g_signal_handler_unblock (bookmarks, bookmark_list_changed_signal_id);
645
on_text_field_focus_out_event (GtkWidget *widget,
646
GdkEventFocus *event,
649
g_assert (NAUTILUS_IS_ENTRY (widget));
651
update_bookmark_from_text ();
656
name_or_uri_field_activate (NautilusEntry *entry)
658
g_assert (NAUTILUS_IS_ENTRY (entry));
660
update_bookmark_from_text ();
661
nautilus_entry_select_all_at_idle (entry);
665
on_uri_field_changed (GtkEditable *editable,
668
/* Remember that user has changed text so we
669
* update real bookmark later.
675
* nautilus_bookmarks_window_new:
677
* Create a new bookmark-editing window.
678
* @list: The NautilusBookmarkList that this window will edit.
680
* Return value: A pointer to the new window.
683
nautilus_bookmarks_window_new (NautilusWindow *parent_window,
684
NautilusBookmarkList *list)
687
GtkTreeViewColumn *col;
688
GtkCellRenderer *rend;
693
builder = gtk_builder_new ();
694
if (!gtk_builder_add_from_resource (builder,
695
"/org/gnome/nautilus/nautilus-bookmarks-window.ui",
700
window = GTK_WINDOW (gtk_builder_get_object (builder, "bookmarks_dialog"));
702
gtk_window_set_wmclass (window, "bookmarks", "Nautilus");
703
gtk_window_set_default_size (window,
704
BOOKMARKS_WINDOW_INITIAL_WIDTH,
705
BOOKMARKS_WINDOW_INITIAL_HEIGHT);
706
gtk_window_set_application (window,
707
gtk_window_get_application (GTK_WINDOW (parent_window)));
708
gtk_window_set_destroy_with_parent (window, TRUE);
710
g_signal_connect (window, "key-press-event",
711
G_CALLBACK (nautilus_bookmarks_window_key_press_event_cb), NULL);
712
g_signal_connect (window, "response",
713
G_CALLBACK (nautilus_bookmarks_window_response_cb), NULL);
715
bookmark_list_widget = GTK_TREE_VIEW (gtk_builder_get_object (builder, "bookmark_tree_view"));
716
remove_button = GTK_WIDGET (gtk_builder_get_object (builder, "bookmark_delete_button"));
717
jump_button = GTK_WIDGET (gtk_builder_get_object (builder, "bookmark_jump_button"));
719
rend = gtk_cell_renderer_pixbuf_new ();
721
"follow-state", TRUE,
723
col = gtk_tree_view_column_new_with_attributes ("Icon",
726
BOOKMARK_LIST_COLUMN_ICON,
728
gtk_tree_view_append_column (bookmark_list_widget,
729
GTK_TREE_VIEW_COLUMN (col));
730
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (col),
731
NAUTILUS_ICON_SIZE_SMALLER);
733
rend = gtk_cell_renderer_text_new ();
735
"ellipsize", PANGO_ELLIPSIZE_END,
736
"ellipsize-set", TRUE,
739
col = gtk_tree_view_column_new_with_attributes ("Icon",
742
BOOKMARK_LIST_COLUMN_NAME,
744
BOOKMARK_LIST_COLUMN_STYLE,
746
gtk_tree_view_append_column (bookmark_list_widget,
747
GTK_TREE_VIEW_COLUMN (col));
749
bookmark_list_store = create_bookmark_store ();
751
gtk_tree_view_set_model (bookmark_list_widget,
752
GTK_TREE_MODEL (bookmark_empty_list_store));
755
GTK_TREE_SELECTION (gtk_tree_view_get_selection (bookmark_list_widget));
757
name_field = nautilus_entry_new ();
759
gtk_widget_show (name_field);
760
gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (builder, "bookmark_name_placeholder")),
761
name_field, TRUE, TRUE, 0);
763
gtk_label_set_mnemonic_widget (
764
GTK_LABEL (gtk_builder_get_object (builder, "bookmark_name_label")),
767
uri_field = nautilus_entry_new ();
768
gtk_widget_show (uri_field);
769
gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (builder, "bookmark_location_placeholder")),
770
uri_field, TRUE, TRUE, 0);
772
gtk_label_set_mnemonic_widget (
773
GTK_LABEL (gtk_builder_get_object (builder, "bookmark_location_label")),
776
bookmark_list_changed_signal_id =
777
g_signal_connect (bookmarks, "changed",
778
G_CALLBACK (on_bookmark_list_changed), NULL);
779
row_changed_signal_id =
780
g_signal_connect (bookmark_list_store, "row_changed",
781
G_CALLBACK (on_row_changed), NULL);
782
row_deleted_signal_id =
783
g_signal_connect (bookmark_list_store, "row_deleted",
784
G_CALLBACK (on_row_deleted), NULL);
785
row_activated_signal_id =
786
g_signal_connect (bookmark_list_widget, "row_activated",
787
G_CALLBACK (on_row_activated), parent_window);
788
button_pressed_signal_id =
789
g_signal_connect (bookmark_list_widget, "button_press_event",
790
G_CALLBACK (on_button_pressed), NULL);
791
key_pressed_signal_id =
792
g_signal_connect (bookmark_list_widget, "key_press_event",
793
G_CALLBACK (on_key_pressed), NULL);
794
selection_changed_id =
795
g_signal_connect (bookmark_selection, "changed",
796
G_CALLBACK (on_selection_changed), NULL);
798
name_field_changed_signal_id =
799
g_signal_connect (name_field, "changed",
800
G_CALLBACK (on_name_field_changed), NULL);
802
g_signal_connect (name_field, "focus_out_event",
803
G_CALLBACK (on_text_field_focus_out_event), NULL);
804
g_signal_connect (name_field, "activate",
805
G_CALLBACK (name_or_uri_field_activate), NULL);
807
uri_field_changed_signal_id =
808
g_signal_connect (uri_field, "changed",
809
G_CALLBACK (on_uri_field_changed), NULL);
811
g_signal_connect (uri_field, "focus_out_event",
812
G_CALLBACK (on_text_field_focus_out_event), NULL);
813
g_signal_connect (uri_field, "activate",
814
G_CALLBACK (name_or_uri_field_activate), NULL);
815
g_signal_connect (remove_button, "clicked",
816
G_CALLBACK (on_remove_button_clicked), NULL);
817
g_signal_connect (jump_button, "clicked",
818
G_CALLBACK (on_jump_button_clicked), parent_window);
820
gtk_tree_selection_set_mode (bookmark_selection, GTK_SELECTION_BROWSE);
822
/* Fill in list widget with bookmarks, must be after signals are wired up. */
825
g_object_unref (builder);
827
return GTK_WINDOW (window);