aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--data/epiphany.schemas.in15
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c63
3 files changed, 83 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2cbf85c51..944fe0cf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-09-22 Marco Pesenti Gritti <marco@gnome.org>
+
+ * data/epiphany.schemas.in:
+ * src/bookmarks/ephy-bookmarks-editor.c: (set_columns_visibility),
+ (cmd_view_columns), (get_details_value),
+ (ephy_bookmarks_editor_construct):
+
+ Complete view menu impl. There is a gtk bug that make it behave funnily
+ and the schemas does not work correctly (though I cant see any problem
+ with, maybe it's something borked here ...)
+
2003-09-21 Christian Persch <chpe@cvs.gnome.org>
* data/default-prefs.js:
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index 446e651c9..556476d22 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -34,6 +34,21 @@
reaching the end of the page.</long>
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/epiphany/dialogs/bookmarks_view_details</key>
+ <applyto>/apps/epiphany/dialogs/bookmarks_view_details</applyto>
+ <owner>epiphany</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <default>[title]</default>
+ <locale name="C">
+ <short>The bookmark informations shown in the editor view</short>
+ <long>
+ The bookmark informations shown in the editor view. Valid values
+ in the list are "address" and "title".
+ </long>
+ </locale>
+ </schema>
<schema>
<key>/schemas/apps/epiphany/dialogs/preferences_font_language</key>
<applyto>/apps/epiphany/dialogs/preferences_font_language</applyto>
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 685c762ff..609152fdd 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -58,6 +58,7 @@
#include "ephy-search-entry.h"
#include "ephy-toolbars-model.h"
#include "ephy-favicon-cache.h"
+#include "eel-gconf-extensions.h"
static GtkTargetEntry topic_drag_dest_types [] =
{
@@ -125,6 +126,8 @@ static void cmd_help_contents (GtkAction *action,
#define EPHY_BOOKMARKS_EDITOR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_BOOKMARKS_EDITOR, EphyBookmarksEditorPrivate))
+#define CONF_BOOKMARKS_VIEW_DETAILS "/apps/epiphany/dialogs/bookmarks_view_details"
+
struct EphyBookmarksEditorPrivate
{
EphyBookmarks *bookmarks;
@@ -674,27 +677,47 @@ cmd_help_contents (GtkAction *action,
}
static void
+set_columns_visibility (EphyBookmarksEditor *editor, int value)
+{
+ switch (value)
+ {
+ case VIEW_TITLE:
+ gtk_tree_view_column_set_visible (editor->priv->title_col, TRUE);
+ gtk_tree_view_column_set_visible (editor->priv->address_col, FALSE);
+ break;
+ case VIEW_TITLE_AND_ADDRESS:
+ gtk_tree_view_column_set_visible (editor->priv->title_col, TRUE);
+ gtk_tree_view_column_set_visible (editor->priv->address_col, TRUE);
+ break;
+ }
+}
+
+static void
cmd_view_columns (GtkAction *action,
GtkRadioAction *current,
EphyBookmarksEditor *editor)
{
int value;
+ GSList *svalues = NULL;
g_return_if_fail (EPHY_IS_BOOKMARKS_EDITOR (editor));
value = gtk_radio_action_get_current_value (current);
+ set_columns_visibility (editor, value);
switch (value)
{
case VIEW_TITLE:
- gtk_tree_view_column_set_visible (editor->priv->title_col, TRUE);
- gtk_tree_view_column_set_visible (editor->priv->address_col, FALSE);
+ svalues = g_slist_append (svalues, (gpointer)"title");
break;
case VIEW_TITLE_AND_ADDRESS:
- gtk_tree_view_column_set_visible (editor->priv->title_col, TRUE);
- gtk_tree_view_column_set_visible (editor->priv->address_col, TRUE);
+ svalues = g_slist_append (svalues, (gpointer)"title");
+ svalues = g_slist_append (svalues, (gpointer)"address");
break;
}
+
+ eel_gconf_set_string_list (CONF_BOOKMARKS_VIEW_DETAILS, svalues);
+ g_slist_free (svalues);
}
GType
@@ -1231,6 +1254,30 @@ provide_keyword_uri (EphyNode *node, GValue *value, gpointer data)
g_free (uri);
}
+static int
+get_details_value (EphyBookmarksEditor *editor)
+{
+ int value;
+ GSList *svalues;
+
+ svalues = eel_gconf_get_string_list (CONF_BOOKMARKS_VIEW_DETAILS);
+
+ if (svalues &&
+ g_slist_find_custom (svalues, "title", (GCompareFunc)strcmp) &&
+ g_slist_find_custom (svalues, "address", (GCompareFunc)strcmp))
+ {
+ value = VIEW_TITLE_AND_ADDRESS;
+ }
+ else
+ {
+ value = VIEW_TITLE;
+ }
+
+ g_slist_free (svalues);
+
+ return value;
+}
+
static void
ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
{
@@ -1242,7 +1289,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
GdkPixbuf *icon;
- int col_id;
+ int col_id, details_value;
gtk_window_set_title (GTK_WINDOW (editor), _("Bookmarks"));
@@ -1269,10 +1316,12 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_bookmark_popup_toggle_entries,
ephy_bookmark_popup_n_toggle_entries,
editor);
+
+ details_value = get_details_value (editor);
gtk_action_group_add_radio_actions (action_group,
ephy_bookmark_radio_entries,
ephy_bookmark_n_radio_entries,
- VIEW_TITLE,
+ details_value,
G_CALLBACK (cmd_view_columns),
editor);
gtk_ui_manager_insert_action_group (ui_merge,
@@ -1425,6 +1474,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_state_add_paned (GTK_WIDGET (hpaned),
"bookmarks_paned",
130);
+
+ set_columns_visibility (editor, details_value);
}
void