[Epiphany] bookmarks dialog
- From: James Willcox <jwillcox cs indiana edu>
- To: epiphany mozdev org
- Subject: [Epiphany] bookmarks dialog
- Date: 06 Feb 2003 15:58:15 -0500
Hi,
Attached is a patch to make the bookmarks dialog remember the last
selected keyword (and select that keyword when the dialog pops up).
Also included is a temporary fix for startup-notification hanging when
using an existing instance. I say temporary, because Havoc thinks we
need to do something with libstartup-notification instead...
Thanks,
James
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/epiphany/ChangeLog,v
retrieving revision 1.75
diff -u -r1.75 ChangeLog
--- ChangeLog 6 Feb 2003 14:58:29 -0000 1.75
+++ ChangeLog 6 Feb 2003 20:52:28 -0000
@@ -1,3 +1,16 @@
+2003-02-06 James Willcox <jwillcox@gnome.org>
+
+ * data/epiphany.schemas.in:
+ * lib/ephy-prefs.h:
+ * src/bookmarks/ephy-bookmarks-editor.c:
+ (ephy_bookmarks_editor_class_init),
+ (ephy_bookmarks_editor_dispose), (ephy_bookmarks_editor_construct):
+ * src/bookmarks/ephy-node-view.c: (ephy_node_view_select_node):
+ * src/ephy-main.c: (ephy_main_start):
+
+ Make the bookmarks editor remember the last selected keyword, and
+ make startup-notification not hang when using the existing instance.
+
2003-02-06 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/widgets/ephy-spinner.c: (ephy_spinner_expose),
Index: TODO
===================================================================
RCS file: /cvs/gnome/epiphany/TODO,v
retrieving revision 1.13
diff -u -r1.13 TODO
--- TODO 31 Jan 2003 12:42:21 -0000 1.13
+++ TODO 6 Feb 2003 20:52:28 -0000
@@ -3,7 +3,6 @@
- implement phoenix like popup blocking / make popups less annoying
- loading feedback on tabs
- embed dialogs crashes when the window has been closed
-- save bookmarks dialog state (current keyword)
- show bookmarks updated content
- temporary bookmarks, maybe an expire checkbox in new bookmark dialog ?
@@ -31,3 +30,4 @@
* create print preview toolbar only when necessary
* titles in history for hosts too
* history shows empty hosts sometimes !?
+* save bookmarks dialog state (current keyword)
Index: data/epiphany.schemas.in
===================================================================
RCS file: /cvs/gnome/epiphany/data/epiphany.schemas.in,v
retrieving revision 1.3
diff -u -r1.3 epiphany.schemas.in
--- data/epiphany.schemas.in 5 Jan 2003 13:51:36 -0000 1.3
+++ data/epiphany.schemas.in 6 Feb 2003 20:52:28 -0000
@@ -633,6 +633,15 @@
<locale name="C">
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/epiphany/interface/bookmark_keyword_selected_node</key>
+ <applyto>/apps/epiphany/interface/bookmark_keyword_selected_node</applyto>
+ <owner>epiphany</owner>
+ <type>string</type>
+ <default>0</default>
+ <locale name="C">
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
Index: lib/ephy-prefs.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-prefs.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ephy-prefs.h
--- lib/ephy-prefs.h 30 Dec 2002 19:27:03 -0000 1.1.1.1
+++ lib/ephy-prefs.h 6 Feb 2003 20:52:28 -0000
@@ -39,6 +39,7 @@
#define CONF_WINDOWS_SHOW_STATUSBAR "/apps/epiphany/interface/show_statusbar"
#define CONF_TOOLBAR_SETUP "/apps/epiphany/interface/toolbar_setup"
#define CONF_TOOLBAR_SPINNER_THEME "/apps/epiphany/interface/spinner_theme"
+#define CONF_BOOKMARKS_SELECTED_NODE "/apps/epiphany/interface/bookmark_keyword_selected_node"
/* Downloader */
#define CONF_DOWNLOADING_SHOW_DETAILS "/apps/epiphany/downloader/show_details"
Index: src/ephy-main.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-main.c,v
retrieving revision 1.3
diff -u -r1.3 ephy-main.c
--- src/ephy-main.c 9 Jan 2003 19:40:18 -0000 1.3
+++ src/ephy-main.c 6 Feb 2003 20:52:28 -0000
@@ -265,6 +265,8 @@
CORBA_exception_free (&corba_env);
+ gdk_notify_startup_complete ();
+
return FALSE;
}
Index: src/bookmarks/ephy-bookmarks-editor.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks-editor.c,v
retrieving revision 1.5
diff -u -r1.5 ephy-bookmarks-editor.c
--- src/bookmarks/ephy-bookmarks-editor.c 4 Feb 2003 20:11:17 -0000 1.5
+++ src/bookmarks/ephy-bookmarks-editor.c 6 Feb 2003 20:52:28 -0000
@@ -31,10 +31,13 @@
#include "ephy-window.h"
#include "ephy-keywords-entry.h"
#include "ephy-dnd.h"
+#include "ephy-prefs.h"
+#include "eel-gconf-extensions.h"
static void ephy_bookmarks_editor_class_init (EphyBookmarksEditorClass *klass);
static void ephy_bookmarks_editor_init (EphyBookmarksEditor *editor);
static void ephy_bookmarks_editor_finalize (GObject *object);
+static void ephy_bookmarks_editor_dispose (GObject *object);
static void ephy_bookmarks_editor_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -104,6 +107,7 @@
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = ephy_bookmarks_editor_finalize;
+ object_class->dispose = ephy_bookmarks_editor_dispose;
object_class->set_property = ephy_bookmarks_editor_set_property;
object_class->get_property = ephy_bookmarks_editor_get_property;
@@ -118,6 +122,41 @@
}
static void
+ephy_bookmarks_editor_dispose (GObject *object)
+{
+ EphyBookmarksEditor *editor;
+ long selected_id;
+ char *selected_id_str;
+ GList *selection;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (EPHY_IS_BOOKMARKS_EDITOR (object));
+
+ editor = EPHY_BOOKMARKS_EDITOR (object);
+
+ g_return_if_fail (editor->priv != NULL);
+
+ if (editor->priv->key_view != NULL)
+ {
+ selection = ephy_node_view_get_selection (editor->priv->key_view);
+ selected_id = ephy_node_get_id (EPHY_NODE (selection->data));
+ if (selected_id > 0)
+ {
+ selected_id_str = g_strdup_printf ("%ld", selected_id);
+ eel_gconf_set_string (CONF_BOOKMARKS_SELECTED_NODE,
+ selected_id_str);
+ g_free (selected_id_str);
+ }
+
+ g_list_free (selection);
+
+ editor->priv->key_view = NULL;
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
ephy_bookmarks_editor_finalize (GObject *object)
{
EphyBookmarksEditor *editor;
@@ -398,6 +437,9 @@
GtkWidget *hbox, *vbox;
EphyNodeView *bm_view, *key_view;
EphyNode *node;
+ long selected_id;
+ EphyNode *selected_node;
+ char *selected_id_str;
gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (editor), 6);
@@ -429,6 +471,8 @@
G_CALLBACK (keyword_node_selected_cb),
editor);
+
+
vbox = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (hbox),
vbox, TRUE, TRUE, 0);
@@ -472,6 +516,22 @@
gtk_dialog_set_default_response (GTK_DIALOG (editor), GTK_RESPONSE_CLOSE);
gtk_window_set_title (GTK_WINDOW (editor), _("Bookmarks"));
+
+ selected_id_str = eel_gconf_get_string (CONF_BOOKMARKS_SELECTED_NODE);
+ selected_id = g_ascii_strtoull (selected_id_str, NULL, 10);
+ if (selected_id <= 0)
+ {
+ g_free (selected_id_str);
+ return;
+ }
+
+ selected_node = ephy_node_get_from_id (selected_id);
+ if (selected_node != NULL)
+ {
+ ephy_node_view_select_node (key_view, selected_node);
+ }
+
+ g_free (selected_id_str);
}
GtkWidget *
Index: src/bookmarks/ephy-node-view.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-node-view.c,v
retrieving revision 1.2
diff -u -r1.2 ephy-node-view.c
--- src/bookmarks/ephy-node-view.c 13 Jan 2003 12:29:55 -0000 1.2
+++ src/bookmarks/ephy-node-view.c 6 Feb 2003 20:52:28 -0000
@@ -520,6 +520,7 @@
GValue val = { 0, };
gboolean visible;
GtkTreeSelection *selection;
+ GtkTreePath *path;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view->priv->treeview));
@@ -538,7 +539,10 @@
gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (view->priv->sortmodel),
&iter, &iter2);
- gtk_tree_selection_select_iter (selection, &iter);
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->priv->sortmodel), &iter);
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view->priv->treeview),
+ path, NULL, FALSE);
+ gtk_tree_path_free (path);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]