aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-09-22 07:09:50 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-09-22 07:09:50 +0800
commit661bd212a252211db4238c3a8b3fdc7fd23a4dd1 (patch)
tree3e1fc728f53a45b23223206721013d6c3b101004 /src
parent8444016d4d3f2f969b44b2e3738ce6a4d1721f46 (diff)
downloadgsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar.gz
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar.bz2
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar.lz
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar.xz
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.tar.zst
gsoc2013-epiphany-661bd212a252211db4238c3a8b3fdc7fd23a4dd1.zip
Complete view menu impl. There is a gtk bug that make it behave funnily
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 ...)
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c63
1 files changed, 57 insertions, 6 deletions
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