aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Willcox <jwillcox@gnome.org>2003-02-07 06:32:01 +0800
committerJames Willcox <jwillcox@src.gnome.org>2003-02-07 06:32:01 +0800
commit1d8988f4d183bc8481a1ed6d10ca8d0d976266bd (patch)
treee4850771f04f625d7f9f973bb1e2186c60277609
parentcf749bea95aaede12db0475b9205f79fdc227765 (diff)
downloadgsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar.gz
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar.bz2
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar.lz
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar.xz
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.tar.zst
gsoc2013-epiphany-1d8988f4d183bc8481a1ed6d10ca8d0d976266bd.zip
Make the bookmarks editor remember the last selected keyword, and make
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.
-rw-r--r--ChangeLog13
-rw-r--r--TODO2
-rw-r--r--data/epiphany.schemas.in9
-rw-r--r--lib/ephy-prefs.h1
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c58
-rw-r--r--src/bookmarks/ephy-node-view.c6
-rw-r--r--src/ephy-main.c2
7 files changed, 89 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b37d0770..5d12c9632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
diff --git a/TODO b/TODO
index aa5bd608f..15614a0e8 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,6 @@ To do:
- make popups less annoying
- embed dialogs crashes when the window has been closed
-- save bookmarks dialog state (current keyword)
- show when bookmarks has updated content
- temporary bookmarks, maybe an expire checkbox in new bookmark dialog ? (I could be on crack here, would be nice to find a good solution though)
@@ -30,3 +29,4 @@ Done:
* create print preview toolbar only when necessary
* titles in history for hosts too
* history shows empty hosts sometimes !?
+* save bookmarks dialog state (current keyword)
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index c7a17edfa..c19b400f4 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -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>
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index 3c0562a1f..9f396be8c 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -39,6 +39,7 @@ G_BEGIN_DECLS
#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"
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 9cfe42dea..22d6452a4 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -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 @@ ephy_bookmarks_editor_class_init (EphyBookmarksEditorClass *klass)
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 @@ ephy_bookmarks_editor_class_init (EphyBookmarksEditorClass *klass)
}
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 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
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);
@@ -472,6 +514,22 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
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 *
diff --git a/src/bookmarks/ephy-node-view.c b/src/bookmarks/ephy-node-view.c
index 8b9927fb7..102cefb9c 100644
--- a/src/bookmarks/ephy-node-view.c
+++ b/src/bookmarks/ephy-node-view.c
@@ -520,6 +520,7 @@ ephy_node_view_select_node (EphyNodeView *view,
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 @@ ephy_node_view_select_node (EphyNodeView *view,
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
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 46fac6e6a..96509fb00 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -265,6 +265,8 @@ ephy_main_start (gpointer data)
CORBA_exception_free (&corba_env);
+ gdk_notify_startup_complete ();
+
return FALSE;
}