Commit c4002e6e authored by John Sullivan's avatar John Sullivan

Fixed bugs, mostly related to editable text fields.

	* README: Made the contents of this file slightly helpful.

	* data/mime/nautilus.keys: Added an obscure MIME type that
	someone reported running into.

	* libnautilus-extensions/nautilus-entry.h,
	* libnautilus-extensions/nautilus-entry.c: New files. Define a
	subclass of GtkEntry (one-line text editing field) that fixes
	bugs and adds convenience functions.
	(nautilus_entry_key_press): Override key_press handler to treat
	the keypad Enter key the same as the other Enter key (in GtkEntry
	it inserts a "/r" into the text).
	(nautilus_entry_select_all): Select all text, and move the text
	cursor position to the end.
	(nautilus_entry_select_all_at_idle): Same, but do it at the next
	idle opportunity. Useful since nautilus_entry_select_all won't
	work right if called in a key_press signal handler.
	* libnautilus-extensions/Makefile.am: Build these two new files.

	* src/file-manager/fm-properties-window.c:
	(name_field_activate): New function, updates file name and
	selects all text.
	(create_properties_window): Make name_field be a NautilusEntry.
	This fixes half of bug 433 (Enter keys don't work properly in
	properties window). Also attach to "activate" signal and update
	name change then. This fixes other half of bug 433. Also start
	with name field selected & focused. This fixes bug 432 (properties
	window should appear with name text selected).
	(name_field_update_to_match_file): Only update the displayed text
	if the new name coming in is different. This was needed to make
	select-all-on-activate work.
	(name_field_done_editing): Don't accept empty string as name;
	silently revert back to original name.

	* src/nautilus-bookmarks-window.c:
	(create_bookmarks_window): Change name & uri text fields to
	NautilusEntry; this causes keypad Enter key to behave like other
	Enter key. Also connect to focus_in and activate signals.
	(update_bookmark_from_text): New function, extracted from
	on_text_field_focus_out_event.
	(on_text_field_focus_out_event): Deselect all text after updating
	bookmark.
	(on_text_field_focus_in_event): New function, select all text.
	(name_or_uri_field_activate): New function, update bookmark and
	select all text.

	* src/nautilus-location-bar.c:
	(nautilus_location_bar_initialize): Use NautilusEntry instead of
	GtkEntry. This makes keypad Enter act like other Enter in uri-entry
	field.

	* src/ntl-window-msgs.c:
	(nautilus_window_end_location_change_callback): Make "Nautilus can't
	handle this type of file" message mention (human-readable version of)
	file type.
parent eab6fb37
2000-04-18 John Sullivan <sullivan@eazel.com>
Fixed bugs, mostly related to editable text fields.
* README: Made the contents of this file slightly helpful.
* data/mime/nautilus.keys: Added an obscure MIME type that
someone reported running into.
* libnautilus-extensions/nautilus-entry.h,
* libnautilus-extensions/nautilus-entry.c: New files. Define a
subclass of GtkEntry (one-line text editing field) that fixes
bugs and adds convenience functions.
(nautilus_entry_key_press): Override key_press handler to treat
the keypad Enter key the same as the other Enter key (in GtkEntry
it inserts a "/r" into the text).
(nautilus_entry_select_all): Select all text, and move the text
cursor position to the end.
(nautilus_entry_select_all_at_idle): Same, but do it at the next
idle opportunity. Useful since nautilus_entry_select_all won't
work right if called in a key_press signal handler.
* libnautilus-extensions/Makefile.am: Build these two new files.
* src/file-manager/fm-properties-window.c:
(name_field_activate): New function, updates file name and
selects all text.
(create_properties_window): Make name_field be a NautilusEntry.
This fixes half of bug 433 (Enter keys don't work properly in
properties window). Also attach to "activate" signal and update
name change then. This fixes other half of bug 433. Also start
with name field selected & focused. This fixes bug 432 (properties
window should appear with name text selected).
(name_field_update_to_match_file): Only update the displayed text
if the new name coming in is different. This was needed to make
select-all-on-activate work.
(name_field_done_editing): Don't accept empty string as name;
silently revert back to original name.
* src/nautilus-bookmarks-window.c:
(create_bookmarks_window): Change name & uri text fields to
NautilusEntry; this causes keypad Enter key to behave like other
Enter key. Also connect to focus_in and activate signals.
(update_bookmark_from_text): New function, extracted from
on_text_field_focus_out_event.
(on_text_field_focus_out_event): Deselect all text after updating
bookmark.
(on_text_field_focus_in_event): New function, select all text.
(name_or_uri_field_activate): New function, update bookmark and
select all text.
* src/nautilus-location-bar.c:
(nautilus_location_bar_initialize): Use NautilusEntry instead of
GtkEntry. This makes keypad Enter act like other Enter in uri-entry
field.
* src/ntl-window-msgs.c:
(nautilus_window_end_location_change_callback): Make "Nautilus can't
handle this type of file" message mention (human-readable version of)
file type.
2000-04-17 Andy Hertzfeld <andy@eazel.com>
fixed bug involving making thumbnails for directories where we don't
......
This is not a good place to look for functionality.
-- Elliot
Nautilus is still in its early stages. You can learn more about it at http://nautilus.eazel.com.
\ No newline at end of file
......@@ -41,6 +41,9 @@ application/rtf
application/x-applix-spreadsheet
[en_US]description=Applix spreadsheet
application/x-arj
[en_US]description=arj archive
application/x-backup
[en_US]description=backup document
......
......@@ -36,6 +36,7 @@ libnautilus_extensionsinclude_HEADERS= \
nautilus-debug.h \
nautilus-directory-background.h \
nautilus-directory.h \
nautilus-entry.h \
nautilus-file-attributes.h \
nautilus-file-utilities.h \
nautilus-file.h \
......@@ -70,6 +71,7 @@ libnautilus_extensions_la_SOURCES = \
nautilus-default-file-icon.h \
nautilus-directory-background.c \
nautilus-directory.c \
nautilus-entry.c \
nautilus-file-utilities.c \
nautilus-file.c \
nautilus-gdk-extensions.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include "nautilus-entry.h"
#include "nautilus-gtk-macros.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwidget.h>
static void nautilus_entry_initialize (NautilusEntry *entry);
static void nautilus_entry_initialize_class (NautilusEntryClass *class);
static gint nautilus_entry_key_press (GtkWidget *widget,
GdkEventKey *event);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusEntry, nautilus_entry, GTK_TYPE_ENTRY)
static void
nautilus_entry_initialize_class (NautilusEntryClass *class)
{
GtkWidgetClass *widget_class;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->key_press_event = nautilus_entry_key_press;
}
static void
nautilus_entry_initialize (NautilusEntry *entry)
{
/* Nothing to do here yet. */
}
GtkWidget*
nautilus_entry_new (void)
{
return GTK_WIDGET (gtk_type_new (NAUTILUS_TYPE_ENTRY));
}
static gint
nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
{
g_assert (NAUTILUS_IS_ENTRY (widget));
if (!GTK_EDITABLE (widget)->editable) {
return FALSE;
}
/* Fix bug in GtkEntry where keypad Enter key inserts a
* character rather than activating like the other Enter key.
*/
switch (event->keyval) {
case GDK_KP_Enter:
gtk_widget_activate (widget);
return TRUE;
}
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, key_press_event, (widget, event));
}
/**
* nautilus_entry_select_all
*
* Select all text, leaving the text cursor position at the end.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
static gboolean
select_all_at_idle (NautilusEntry *entry)
{
nautilus_entry_select_all (entry);
return FALSE;
}
/**
* nautilus_entry_select_all_at_idle
*
* Select all text at the next idle, not immediately.
* This is useful when reacting to a key press, because
* changing the selection and the text cursor position doesn't
* work in a key_press signal handler.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all_at_idle (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
/* If the text cursor position changes in this routine
* then gtk_entry_key_press will unselect (and we want
* to move the text cursor position to the end).
*/
gtk_idle_add ((GtkFunction)select_all_at_idle, entry);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef NAUTILUS_ENTRY_H
#define NAUTILUS_ENTRY_H
#include <libgnome/gnome-defs.h>
#include <gtk/gtkentry.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_ENTRY \
(nautilus_entry_get_type ())
#define NAUTILUS_ENTRY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ENTRY, NautilusEntry))
#define NAUTILUS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ENTRY, NautilusEntryClass))
#define NAUTILUS_IS_ENTRY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ENTRY))
#define NAUTILUS_IS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ENTRY))
typedef struct NautilusEntry NautilusEntry;
typedef struct NautilusEntryClass NautilusEntryClass;
struct NautilusEntry {
GtkEntry parent;
};
struct NautilusEntryClass {
GtkEntryClass parent_class;
};
GtkType nautilus_entry_get_type (void);
GtkWidget* nautilus_entry_new (void);
void nautilus_entry_select_all (NautilusEntry *entry);
void nautilus_entry_select_all_at_idle (NautilusEntry *entry);
END_GNOME_DECLS
#endif /* NAUTILUS_ENTRY_H */
......@@ -36,6 +36,7 @@ libnautilus_extensionsinclude_HEADERS= \
nautilus-debug.h \
nautilus-directory-background.h \
nautilus-directory.h \
nautilus-entry.h \
nautilus-file-attributes.h \
nautilus-file-utilities.h \
nautilus-file.h \
......@@ -70,6 +71,7 @@ libnautilus_extensions_la_SOURCES = \
nautilus-default-file-icon.h \
nautilus-directory-background.c \
nautilus-directory.c \
nautilus-entry.c \
nautilus-file-utilities.c \
nautilus-file.c \
nautilus-gdk-extensions.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include "nautilus-entry.h"
#include "nautilus-gtk-macros.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwidget.h>
static void nautilus_entry_initialize (NautilusEntry *entry);
static void nautilus_entry_initialize_class (NautilusEntryClass *class);
static gint nautilus_entry_key_press (GtkWidget *widget,
GdkEventKey *event);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusEntry, nautilus_entry, GTK_TYPE_ENTRY)
static void
nautilus_entry_initialize_class (NautilusEntryClass *class)
{
GtkWidgetClass *widget_class;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->key_press_event = nautilus_entry_key_press;
}
static void
nautilus_entry_initialize (NautilusEntry *entry)
{
/* Nothing to do here yet. */
}
GtkWidget*
nautilus_entry_new (void)
{
return GTK_WIDGET (gtk_type_new (NAUTILUS_TYPE_ENTRY));
}
static gint
nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
{
g_assert (NAUTILUS_IS_ENTRY (widget));
if (!GTK_EDITABLE (widget)->editable) {
return FALSE;
}
/* Fix bug in GtkEntry where keypad Enter key inserts a
* character rather than activating like the other Enter key.
*/
switch (event->keyval) {
case GDK_KP_Enter:
gtk_widget_activate (widget);
return TRUE;
}
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, key_press_event, (widget, event));
}
/**
* nautilus_entry_select_all
*
* Select all text, leaving the text cursor position at the end.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
static gboolean
select_all_at_idle (NautilusEntry *entry)
{
nautilus_entry_select_all (entry);
return FALSE;
}
/**
* nautilus_entry_select_all_at_idle
*
* Select all text at the next idle, not immediately.
* This is useful when reacting to a key press, because
* changing the selection and the text cursor position doesn't
* work in a key_press signal handler.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all_at_idle (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
/* If the text cursor position changes in this routine
* then gtk_entry_key_press will unselect (and we want
* to move the text cursor position to the end).
*/
gtk_idle_add ((GtkFunction)select_all_at_idle, entry);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef NAUTILUS_ENTRY_H
#define NAUTILUS_ENTRY_H
#include <libgnome/gnome-defs.h>
#include <gtk/gtkentry.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_ENTRY \
(nautilus_entry_get_type ())
#define NAUTILUS_ENTRY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ENTRY, NautilusEntry))
#define NAUTILUS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ENTRY, NautilusEntryClass))
#define NAUTILUS_IS_ENTRY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ENTRY))
#define NAUTILUS_IS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ENTRY))
typedef struct NautilusEntry NautilusEntry;
typedef struct NautilusEntryClass NautilusEntryClass;
struct NautilusEntry {
GtkEntry parent;
};
struct NautilusEntryClass {
GtkEntryClass parent_class;
};
GtkType nautilus_entry_get_type (void);
GtkWidget* nautilus_entry_new (void);
void nautilus_entry_select_all (NautilusEntry *entry);
void nautilus_entry_select_all_at_idle (NautilusEntry *entry);
END_GNOME_DECLS
#endif /* NAUTILUS_ENTRY_H */
......@@ -44,7 +44,9 @@
#include <gtk/gtkvbox.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
#include <libnautilus-extensions/nautilus-entry.h>
#include <libnautilus-extensions/nautilus-string.h>
static GHashTable *windows;
......@@ -123,7 +125,7 @@ create_pixmap_widget_for_file (NautilusFile *file)
}
static gboolean
name_field_done_editing (GtkWidget *widget,
name_field_done_editing (NautilusEntry *name_field,
GdkEventFocus *event,
gpointer user_data)
{
......@@ -131,30 +133,40 @@ name_field_done_editing (GtkWidget *widget,
GnomeVFSResult rename_result;
const char *new_name;
char *original_name;
gboolean empty_name;
g_assert (GTK_IS_ENTRY (widget));
g_assert (NAUTILUS_IS_ENTRY (name_field));
file = gtk_object_get_data (GTK_OBJECT (widget), "nautilus_file");
file = gtk_object_get_data (GTK_OBJECT (name_field), "nautilus_file");
g_assert (NAUTILUS_IS_FILE (file));
if (nautilus_file_is_gone (file)) {
return FALSE;
}
new_name = gtk_entry_get_text (GTK_ENTRY (widget));
rename_result = nautilus_file_rename (file, new_name);
new_name = gtk_entry_get_text (GTK_ENTRY (name_field));
if (rename_result == GNOME_VFS_OK) {
return FALSE;
}
/* Special case: silently revert text if new text is empty. */
if (strlen (new_name) == 0) {
empty_name = TRUE;
} else {
rename_result = nautilus_file_rename (file, new_name);
if (rename_result == GNOME_VFS_OK) {
return FALSE;
}
}
/* Rename failed; restore old name, complain to user. */
original_name = nautilus_file_get_name (file);
gtk_entry_set_text (GTK_ENTRY (widget), original_name);
gtk_entry_set_text (GTK_ENTRY (name_field), original_name);
fm_report_error_renaming_file (original_name,
new_name,
rename_result);
if (!empty_name) {
fm_report_error_renaming_file (original_name,
new_name,
rename_result);
}
g_free (original_name);
......@@ -162,7 +174,18 @@ name_field_done_editing (GtkWidget *widget,
}
static void
name_field_update_to_match_file (GtkEntry *name_field)
name_field_activate (NautilusEntry *name_field)
{
g_assert (NAUTILUS_IS_ENTRY (name_field));
/* Accept changes. */
name_field_done_editing (name_field, NULL, NULL);
nautilus_entry_select_all_at_idle (name_field);
}
static void
name_field_update_to_match_file (NautilusEntry *name_field)
{
NautilusFile *file;
char *original_name, *current_name;
......@@ -171,7 +194,7 @@ name_field_update_to_match_file (GtkEntry *name_field)
if (file == NULL || nautilus_file_is_gone (file)) {
gtk_widget_set_sensitive (GTK_WIDGET (name_field), FALSE);
gtk_entry_set_text (name_field, "");
gtk_entry_set_text (GTK_ENTRY (name_field), "");
return;
}
......@@ -190,7 +213,13 @@ name_field_update_to_match_file (GtkEntry *name_field)
current_name,
g_free);
gtk_entry_set_text (name_field, current_name);
/* Only reset the text if it's different from what is
* currently showing. This causes minimal ripples (e.g.
* selection change).
*/
if (strcmp (gtk_entry_get_text (GTK_ENTRY (name_field)), current_name) != 0) {
gtk_entry_set_text (GTK_ENTRY (name_field), current_name);
}
} else {
g_free (original_name);
}
......@@ -336,7 +365,7 @@ create_properties_window (NautilusFile *file)
gtk_box_pack_start (GTK_BOX (icon_and_name_hbox), icon_pixmap_widget, FALSE, FALSE, 0);
/* Create the name field */
name_field = gtk_entry_new ();
name_field = nautilus_entry_new ();
gtk_widget_show (name_field);
gtk_box_pack_start (GTK_BOX (icon_and_name_hbox), name_field, TRUE, TRUE, 0);
......@@ -348,12 +377,20 @@ create_properties_window (NautilusFile *file)
(GtkDestroyNotify) nautilus_file_unref);
/* Update name field initially before hooking up changed signal. */
name_field_update_to_match_file (GTK_ENTRY (name_field));
name_field_update_to_match_file (NAUTILUS_ENTRY (name_field));
gtk_signal_connect (GTK_OBJECT (name_field), "focus_out_event",
GTK_SIGNAL_FUNC (name_field_done_editing),
NULL);
gtk_signal_connect (GTK_OBJECT (name_field), "activate",
GTK_SIGNAL_FUNC (name_field_activate),
NULL);
/* Start with name field selected. */
nautilus_entry_select_all (NAUTILUS_ENTRY (name_field));
gtk_widget_grab_focus (GTK_WIDGET (name_field));
/* React to name changes from elsewhere. */
gtk_signal_connect_object_while_alive (GTK_OBJECT (file),
"changed",
......
......@@ -23,6 +23,7 @@
*/
#include "nautilus-bookmarks-window.h"
#include <libnautilus-extensions/nautilus-entry.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
/* Static variables to keep track of window state. If there were
......@@ -44,6 +45,7 @@ static int uri_field_changed_signalID;
static const NautilusBookmark *get_selected_bookmark (void);
static guint get_selected_row (void);
static gboolean get_selection_exists (void);
static void name_or_uri_field_activate (NautilusEntry *entry);
static void nautilus_bookmarks_window_restore_geometry
(GtkWidget *window);
static void on_bookmark_list_changed (NautilusBookmarkList *,
......@@ -59,6 +61,9 @@ static void on_select_row (GtkCList *,
int column,
GdkEventButton *,
gpointer user_data);
static gboolean on_text_field_focus_in_event (GtkWidget *,
GdkEventFocus *,
gpointer user_data);
static gboolean on_text_field_focus_out_event (GtkWidget *,
GdkEventFocus *,
gpointer user_data);
......@@ -157,7 +162,7 @@ create_bookmarks_window(NautilusBookmarkList *list)
gtk_widget_show (name_label);
gtk_box_pack_start (GTK_BOX (vbox3), name_label, FALSE, FALSE, 0);
name_field = gtk_entry_new ();
name_field = nautilus_entry_new ();
gtk_widget_show (name_field);
gtk_box_pack_start (GTK_BOX (vbox3), name_field, FALSE, FALSE, 0);
......@@ -169,7 +174,7 @@ create_bookmarks_window(NautilusBookmarkList *list)
gtk_widget_show (url_label);
gtk_box_pack_start (GTK_BOX (vbox4), url_label, FALSE, FALSE, 0);
uri_field = gtk_entry_new ();
uri_field = nautilus_entry_new ();
gtk_widget_show (uri_field);
gtk_box_pack_start (GTK_BOX (vbox4), uri_field, FALSE, FALSE, 0);
......@@ -208,19 +213,35 @@ create_bookmarks_window(NautilusBookmarkList *list)
GTK_SIGNAL_FUNC (on_name_field_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (name_field), "focus_in_event",
GTK_SIGNAL_FUNC (on_text_field_focus_in_event),
NULL);
gtk_signal_connect (GTK_OBJECT (name_field), "focus_out_event",
GTK_SIGNAL_FUNC (on_text_field_focus_out_event),
NULL);
gtk_signal_connect (GTK_OBJECT (name_field), "activate",
GTK_SIGNAL_FUNC (name_or_uri_field_activate),
NULL);
uri_field_changed_signalID =
gtk_signal_connect (GTK_OBJECT (uri_field), "changed",
GTK_SIGNAL_FUNC (on_uri_field_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (uri_field), "focus_in_event",
GTK_SIGNAL_FUNC (on_text_field_focus_in_event),
NULL);
gtk_signal_connect (GTK_OBJECT (uri_field), "focus_out_event",
GTK_SIGNAL_FUNC (on_text_field_focus_out_event),
NULL);
gtk_signal_connect (GTK_OBJECT (uri_field), "activate",
GTK_SIGNAL_FUNC (name_or_uri_field_activate),
NULL);
gtk_signal_connect (GTK_OBJECT (remove_button), "clicked",
GTK_SIGNAL_FUNC (on_remove_button_clicked),
NULL);
......@@ -460,10 +481,8 @@ on_select_row (GtkCList *clist,
}
static gboolean
on_text_field_focus_out_event (GtkWidget *widget,