aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Harvey <peter.a.harvey@gmail.com>2006-01-28 06:14:44 +0800
committerPeter Anthony Harvey <paharvey@src.gnome.org>2006-01-28 06:14:44 +0800
commit233920bda728e2fce61a75887ef59b35fc5d6d33 (patch)
tree73cef92c31d71ee79b882b050a1c7a259577a711 /src
parent81d60265f6dc7b29d716328c5171546cc24e5f58 (diff)
downloadgsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.gz
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.bz2
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.lz
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.xz
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.tar.zst
gsoc2013-epiphany-233920bda728e2fce61a75887ef59b35fc5d6d33.zip
src/bookmarks/ephy-bookmark-properties.c src/bookmarks/ephy-bookmarks-ui.c
2006-01-22 Peter Harvey <peter.a.harvey@gmail.com> * src/bookmarks/ephy-bookmark-properties.c * src/bookmarks/ephy-bookmarks-ui.c * src/bookmarks/ephy-bookmarks-ui.h * src/bookmarks/ephy-bookmarks.c * src/bookmarks/ephy-bookmarks.h * src/ephy-history-window.c * src/popup-commands.c * src/window-commands.c Simplified the bookmark properties dialog and removed the 'duplicate bookmark' warning dialog (now have warning in the bookmark properties dialog itself). * src/bookmarks/ephy-topics-palette.c Added a header which switches topic palette mode.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmark-properties.c139
-rw-r--r--src/bookmarks/ephy-bookmarks-ui.c122
-rw-r--r--src/bookmarks/ephy-bookmarks-ui.h3
-rw-r--r--src/bookmarks/ephy-bookmarks.c41
-rw-r--r--src/bookmarks/ephy-bookmarks.h3
-rw-r--r--src/bookmarks/ephy-topics-palette.c49
-rw-r--r--src/ephy-history-window.c2
-rw-r--r--src/popup-commands.c2
-rw-r--r--src/window-commands.c3
9 files changed, 201 insertions, 163 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c
index d46146234..c5f274fbb 100644
--- a/src/bookmarks/ephy-bookmark-properties.c
+++ b/src/bookmarks/ephy-bookmark-properties.c
@@ -58,6 +58,9 @@ struct _EphyBookmarkPropertiesPrivate
EphyNode *bookmark;
EphyTopicsPalette *palette;
gboolean creating;
+
+ EphyNode *duplicate;
+ GtkWidget *warning;
};
enum
@@ -76,6 +79,57 @@ enum
static GObjectClass *parent_class;
static void
+node_added_cb (EphyNode *bookmarks,
+ EphyNode *bookmark,
+ EphyBookmarkProperties *properties)
+{
+ EphyBookmarkPropertiesPrivate *priv = properties->priv;
+
+ if (priv->duplicate == NULL)
+ {
+ priv->duplicate = ephy_bookmarks_find_duplicate
+ (priv->bookmarks, priv->bookmark);
+ g_object_set (priv->warning, "visible",
+ priv->duplicate != NULL, NULL);
+ }
+}
+
+static void
+node_changed_cb (EphyNode *bookmarks,
+ EphyNode *bookmark,
+ guint property,
+ EphyBookmarkProperties *properties)
+{
+ EphyBookmarkPropertiesPrivate *priv = properties->priv;
+
+ if (priv->duplicate == bookmark || priv->bookmark == bookmark ||
+ priv->duplicate == NULL)
+ {
+ priv->duplicate = ephy_bookmarks_find_duplicate
+ (priv->bookmarks, priv->bookmark);
+ g_object_set (priv->warning, "visible",
+ priv->duplicate != NULL, NULL);
+ }
+}
+
+static void
+node_removed_cb (EphyNode *bookmarks,
+ EphyNode *bookmark,
+ guint index,
+ EphyBookmarkProperties *properties)
+{
+ EphyBookmarkPropertiesPrivate *priv = properties->priv;
+
+ if (priv->duplicate == bookmark)
+ {
+ priv->duplicate = ephy_bookmarks_find_duplicate
+ (priv->bookmarks, priv->bookmark);
+ g_object_set (priv->warning, "visible",
+ priv->duplicate != NULL, NULL);
+ }
+}
+
+static void
node_destroy_cb (EphyNode *bookmark,
GtkWidget *dialog)
{
@@ -106,14 +160,27 @@ ephy_bookmark_properties_set_bookmark (EphyBookmarkProperties *properties,
G_OBJECT (properties));
}
+
static void
-bookmark_properties_close_cb (GtkDialog *dialog,
- gpointer data)
+show_duplicate_cb (GtkButton *button,
+ EphyBookmarkProperties *properties)
+{
+ EphyBookmarkPropertiesPrivate *priv = properties->priv;
+ EphyNode *dup = ephy_bookmarks_find_duplicate (priv->bookmarks, priv->bookmark);
+
+ g_return_if_fail (dup != NULL);
+
+ ephy_bookmarks_ui_show_bookmark (dup);
+}
+
+static void
+bookmark_properties_destroy_cb (GtkDialog *dialog,
+ gpointer data)
{
EphyBookmarkProperties *properties = EPHY_BOOKMARK_PROPERTIES (dialog);
EphyBookmarkPropertiesPrivate *priv = properties->priv;
- if (priv->creating)
+ if (priv->creating && priv->bookmark != NULL)
{
ephy_node_unref (priv->bookmark);
priv->bookmark = NULL;
@@ -139,8 +206,10 @@ bookmark_properties_response_cb (GtkDialog *dialog,
ephy_bookmarks_ui_add_topic (GTK_WIDGET (dialog),
priv->bookmark);
return;
- case GTK_RESPONSE_CANCEL:
- ephy_node_unref (priv->bookmark);
+ case GTK_RESPONSE_ACCEPT:
+ /* On destruction of the dialog, if priv->creating==TRUE,
+ * we will unref any bookmark we have, so we set it
+ * to NULL here to 'protect' it from unreffing. */
priv->bookmark = NULL;
break;
default:
@@ -229,7 +298,6 @@ ephy_bookmark_properties_constructor (GType type,
GtkWidget *scrolled_window;
GtkWindow *window;
GtkDialog *dialog;
- GtkComboBox *cbox;
const char *tmp;
object = parent_class->constructor (type, n_construct_properties,
@@ -248,8 +316,8 @@ ephy_bookmark_properties_constructor (GType type,
g_signal_connect (properties, "response",
G_CALLBACK (bookmark_properties_response_cb), properties);
- g_signal_connect (properties, "close",
- G_CALLBACK (bookmark_properties_close_cb), properties);
+ g_signal_connect (properties, "destroy",
+ G_CALLBACK (bookmark_properties_destroy_cb), properties);
ephy_state_add_window (widget,
"bookmark_properties",
@@ -292,27 +360,26 @@ ephy_bookmark_properties_constructor (GType type,
G_CALLBACK (location_entry_changed_cb), properties);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_show (entry);
- label = gtk_label_new_with_mnemonic (_("_Address:"));
+ label = gtk_label_new_with_mnemonic (_("A_ddress:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
gtk_widget_show (label);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
- cbox = GTK_COMBO_BOX (gtk_combo_box_new_text ());
- gtk_widget_show (GTK_WIDGET (cbox));
- gtk_combo_box_append_text (cbox, _("All"));
- gtk_combo_box_append_text (cbox, _("Subtopics"));
- label = gtk_label_new_with_mnemonic(_("T_opics:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (cbox));
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (cbox), 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
+ widget = gtk_image_new_from_stock (GTK_STOCK_INFO, GTK_ICON_SIZE_BUTTON);
+ priv->warning = gtk_button_new_with_mnemonic (_("_Show bookmark with same address"));
+ gtk_button_set_image (GTK_BUTTON (priv->warning), widget);
+ g_signal_connect (priv->warning, "clicked",
+ G_CALLBACK(show_duplicate_cb), properties);
+ gtk_widget_show (priv->warning);
+ gtk_table_set_row_spacing (GTK_TABLE (table), 1, 0);
+ gtk_table_attach (GTK_TABLE (table), priv->warning, 1, 2, 2, 3, GTK_FILL, 0, 0, 3);
+ priv->duplicate = ephy_bookmarks_find_duplicate (priv->bookmarks, priv->bookmark);
+ g_object_set (priv->warning, "visible", priv->duplicate != NULL, NULL);
palette = ephy_topics_palette_new (priv->bookmarks, priv->bookmark);
priv->palette = EPHY_TOPICS_PALETTE (palette);
-
scrolled_window = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"hadjustment", NULL,
"vadjustment", NULL,
@@ -322,11 +389,11 @@ ephy_bookmark_properties_constructor (GType type,
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), palette);
gtk_widget_show (palette);
-
- g_signal_connect_object (cbox, "changed",
- G_CALLBACK (combo_changed_cb), palette,
- G_CONNECT_AFTER);
-
+ label = gtk_label_new_with_mnemonic(_("T_opics:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), palette);
+ gtk_widget_show (label);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0, 6);
gtk_table_attach (GTK_TABLE (table), scrolled_window, 1, 2, 3, 4,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
gtk_widget_show (scrolled_window);
@@ -346,9 +413,9 @@ ephy_bookmark_properties_constructor (GType type,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (dialog,
- GTK_STOCK_OK,
- GTK_RESPONSE_OK);
- gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
+ GTK_STOCK_ADD,
+ GTK_RESPONSE_ACCEPT);
+ gtk_dialog_set_default_response (dialog, GTK_RESPONSE_ACCEPT);
}
else
{
@@ -358,8 +425,6 @@ ephy_bookmark_properties_constructor (GType type,
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CLOSE);
}
- gtk_combo_box_set_active (cbox, 1);
-
return object;
}
@@ -371,11 +436,25 @@ ephy_bookmark_properties_set_property (GObject *object,
{
EphyBookmarkProperties *properties = EPHY_BOOKMARK_PROPERTIES (object);
EphyBookmarkPropertiesPrivate *priv = properties->priv;
+ EphyNode *bookmarks;
switch (prop_id)
{
case PROP_BOOKMARKS:
priv->bookmarks = g_value_get_object (value);
+ bookmarks = ephy_bookmarks_get_bookmarks (priv->bookmarks);
+ ephy_node_signal_connect_object (bookmarks,
+ EPHY_NODE_CHILD_ADDED,
+ (EphyNodeCallback) node_added_cb,
+ object);
+ ephy_node_signal_connect_object (bookmarks,
+ EPHY_NODE_CHILD_REMOVED,
+ (EphyNodeCallback) node_removed_cb,
+ object);
+ ephy_node_signal_connect_object (bookmarks,
+ EPHY_NODE_CHILD_CHANGED,
+ (EphyNodeCallback) node_changed_cb,
+ object);
break;
case PROP_BOOKMARK:
ephy_bookmark_properties_set_bookmark
diff --git a/src/bookmarks/ephy-bookmarks-ui.c b/src/bookmarks/ephy-bookmarks-ui.c
index 0449606b8..63f6d9df1 100644
--- a/src/bookmarks/ephy-bookmarks-ui.c
+++ b/src/bookmarks/ephy-bookmarks-ui.c
@@ -418,9 +418,9 @@ properties_dialog_destroy_cb (EphyBookmarkProperties *dialog,
ephy_bookmark_properties_get_node (dialog));
}
-static void
-add_bookmark (const char *location,
- const char *title)
+void
+ephy_bookmarks_ui_add_bookmark (const char *location,
+ const char *title)
{
EphyBookmarks *bookmarks;
EphyNode *bookmark;
@@ -445,113 +445,8 @@ add_bookmark (const char *location,
gtk_get_current_event_time ());
}
-static void
-duplicate_bookmark_response_cb (GtkWidget *dialog,
- int response,
- EphyNode *node)
-{
- if (response == RESPONSE_SHOW_PROPERTIES)
- {
- ephy_bookmarks_ui_show_bookmark (node);
- }
- else if (response == RESPONSE_NEW_BOOKMARK)
- {
- const char *location;
- const char *title;
-
- location = g_object_get_data (G_OBJECT (dialog), "location");
- title = g_object_get_data (G_OBJECT (dialog), "title");
-
- add_bookmark (location, title);
- }
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-dialog_node_destroy_cb (EphyNode *node,
- GtkWidget *dialog)
-{
- gtk_widget_destroy (dialog);
-}
-
-void
-ephy_bookmarks_ui_add_bookmark (GtkWidget *parent,
- const char *location,
- const char *title)
-{
- EphyBookmarks *bookmarks;
- EphyNode *bookmark;
-
- bookmarks = ephy_shell_get_bookmarks (ephy_shell);
- bookmark = location ? ephy_bookmarks_find_bookmark (bookmarks, location) : NULL;
-
- if (bookmark != NULL)
- {
- GtkWidget *button, *dialog;
-
- dialog = gtk_message_dialog_new
- (GTK_WINDOW (parent),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO, GTK_BUTTONS_NONE,
- _("Bookmark exists"));
-
- gtk_message_dialog_format_secondary_text
- (GTK_MESSAGE_DIALOG (dialog),
- _("You already have a bookmark titled ā€œ%sā€ for this page."),
- ephy_node_get_property_string (bookmark, EPHY_NODE_BMK_PROP_TITLE));
-
- if (parent != NULL)
- {
- gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parent)),
- GTK_WINDOW (dialog));
- }
-
- button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_Create New"),
- RESPONSE_NEW_BOOKMARK);
- gtk_button_set_image (GTK_BUTTON (button),
- gtk_image_new_from_stock (STOCK_BOOKMARK,
- GTK_ICON_SIZE_BUTTON));
-
- button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_View Properties"),
- RESPONSE_SHOW_PROPERTIES);
- gtk_button_set_image (GTK_BUTTON (button),
- gtk_image_new_from_stock (GTK_STOCK_PROPERTIES,
- GTK_ICON_SIZE_BUTTON));
-
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_OK,
- GTK_RESPONSE_OK);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
-
- gtk_window_set_title (GTK_WINDOW (dialog), _("Bookmark Exists"));
- gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
-
- g_object_set_data_full (G_OBJECT (dialog), "location",
- g_strdup (location), g_free);
- g_object_set_data_full (G_OBJECT (dialog), "title",
- g_strdup (title), g_free);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (duplicate_bookmark_response_cb), bookmark);
-
- ephy_node_signal_connect_object (bookmark, EPHY_NODE_DESTROY,
- (EphyNodeCallback) dialog_node_destroy_cb,
- G_OBJECT (dialog));
-
- gtk_window_present_with_time (GTK_WINDOW (dialog),
- gtk_get_current_event_time ());
- }
- else
- {
- add_bookmark (location, title);
- }
-}
-
static EphyNode *
-ephy_bookmarks_ui_find_topic (const char *name)
+find_topic (const char *name)
{
EphyBookmarks *bookmarks;
GPtrArray *children;
@@ -579,6 +474,13 @@ ephy_bookmarks_ui_find_topic (const char *name)
}
static void
+dialog_node_destroy_cb (EphyNode *node,
+ GtkWidget *dialog)
+{
+ gtk_widget_destroy (dialog);
+}
+
+static void
add_topic_changed_cb (GtkEntry *entry,
GtkDialog *dialog)
{
@@ -610,7 +512,7 @@ add_topic_response_cb (GtkWidget *dialog,
name = gtk_entry_get_text (entry);
g_return_if_fail (name != NULL && name[0] != '\0');
- topic = ephy_bookmarks_ui_find_topic (name);
+ topic = find_topic (name);
if (topic != NULL)
{
GtkWidget *message;
diff --git a/src/bookmarks/ephy-bookmarks-ui.h b/src/bookmarks/ephy-bookmarks-ui.h
index 419a98400..71361eae8 100644
--- a/src/bookmarks/ephy-bookmarks-ui.h
+++ b/src/bookmarks/ephy-bookmarks-ui.h
@@ -32,8 +32,7 @@ void ephy_bookmarks_ui_detach_window (EphyWindow *window);
void ephy_bookmarks_ui_attach_toolbar_model (EggToolbarsModel *model);
void ephy_bookmarks_ui_detach_toolbar_model (EggToolbarsModel *model);
-void ephy_bookmarks_ui_add_bookmark (GtkWidget *parent,
- const char *location,
+void ephy_bookmarks_ui_add_bookmark (const char *location,
const char *title);
void ephy_bookmarks_ui_add_topic (GtkWidget *parent,
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 0aa4ef175..7770265f7 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -1186,6 +1186,47 @@ ephy_bookmarks_find_bookmark (EphyBookmarks *eb,
return NULL;
}
+EphyNode *
+ephy_bookmarks_find_duplicate (EphyBookmarks *eb,
+ EphyNode *bookmark)
+{
+ GPtrArray *children;
+ const char *url;
+ int i;
+
+ g_return_val_if_fail (EPHY_IS_BOOKMARKS (eb), NULL);
+ g_return_val_if_fail (eb->priv->bookmarks != NULL, NULL);
+ g_return_val_if_fail (bookmark != NULL, NULL);
+
+ url = ephy_node_get_property_string
+ (bookmark, EPHY_NODE_BMK_PROP_LOCATION);
+
+ g_return_val_if_fail (url != NULL, NULL);
+
+ children = ephy_node_get_children (eb->priv->bookmarks);
+ for (i = 0; i < children->len; i++)
+ {
+ EphyNode *kid;
+ const char *location;
+
+ kid = g_ptr_array_index (children, i);
+ if (kid == bookmark)
+ {
+ continue;
+ }
+
+ location = ephy_node_get_property_string
+ (kid, EPHY_NODE_BMK_PROP_LOCATION);
+
+ if (location != NULL && strcmp (url, location) == 0)
+ {
+ return kid;
+ }
+ }
+
+ return NULL;
+}
+
void
ephy_bookmarks_set_icon (EphyBookmarks *eb,
const char *url,
diff --git a/src/bookmarks/ephy-bookmarks.h b/src/bookmarks/ephy-bookmarks.h
index 6eefbbc6a..f5874678e 100644
--- a/src/bookmarks/ephy-bookmarks.h
+++ b/src/bookmarks/ephy-bookmarks.h
@@ -88,6 +88,9 @@ EphyNode *ephy_bookmarks_add (EphyBookmarks *eb,
EphyNode* ephy_bookmarks_find_bookmark (EphyBookmarks *eb,
const char *url);
+EphyNode* ephy_bookmarks_find_duplicate (EphyBookmarks *eb,
+ EphyNode *bookmark);
+
void ephy_bookmarks_set_icon (EphyBookmarks *eb,
const char *url,
const char *icon);
diff --git a/src/bookmarks/ephy-topics-palette.c b/src/bookmarks/ephy-topics-palette.c
index 93f032093..ee650b0a1 100644
--- a/src/bookmarks/ephy-topics-palette.c
+++ b/src/bookmarks/ephy-topics-palette.c
@@ -41,6 +41,7 @@ struct _EphyTopicsPalettePrivate
EphyBookmarks *bookmarks;
EphyNode *bookmark;
GtkListStore *store;
+ GtkTreeViewColumn *column;
int mode;
};
@@ -65,9 +66,9 @@ enum
enum
{
- MODE_ALL,
- MODE_TOPLEVEL,
- MODE_COMMUNITY
+ MODE_GROUPED,
+ MODE_LIST,
+ MODES
};
static GObjectClass *parent_class = NULL;
@@ -184,8 +185,10 @@ update_list (EphyTopicsPalette *palette)
valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (palette->priv->store), &iter);
first = TRUE;
- if (palette->priv->mode == MODE_ALL)
+ if (palette->priv->mode == MODE_LIST)
{
+ gtk_tree_view_column_set_title (palette->priv->column, _("By title"));
+
/* Allocate and fill the suggestions array. */
node = ephy_bookmarks_get_keywords (palette->priv->bookmarks);
children = ephy_node_get_children (node);
@@ -205,10 +208,12 @@ update_list (EphyTopicsPalette *palette)
append_topics (palette, &iter, &valid, &first, NULL, _("No topics"), topics);
g_ptr_array_free (topics, TRUE);
}
- else if (palette->priv->mode == MODE_TOPLEVEL)
+ else if (palette->priv->mode == MODE_GROUPED)
{
GPtrArray *suggested, *selected;
+ gtk_tree_view_column_set_title (palette->priv->column, _("By relation"));
+
/* Allocate and fill the bookmarks array. */
node = ephy_bookmarks_get_bookmarks (palette->priv->bookmarks);
children = ephy_node_get_children (node);
@@ -346,6 +351,14 @@ ephy_topics_palette_set_property (GObject *object,
}
static void
+column_clicked (GtkTreeViewColumn *column,
+ EphyTopicsPalette *palette)
+{
+ palette->priv->mode = (palette->priv->mode+1)%MODES;
+ update_list_idle (palette);
+}
+
+static void
cell_edited (GtkCellRendererText *renderer,
const char *path_str,
const char *new_text,
@@ -422,7 +435,6 @@ ephy_topics_palette_constructor (GType type,
EphyTopicsPalette *palette;
EphyTopicsPalettePrivate *priv;
GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
object = parent_class->constructor (type, n_construct_properties,
construct_params);
@@ -434,23 +446,26 @@ ephy_topics_palette_constructor (GType type,
gtk_tree_view_set_model (GTK_TREE_VIEW (object), GTK_TREE_MODEL (priv->store));
g_object_unref (priv->store);
- column = gtk_tree_view_column_new ();
+ priv->column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_clickable (priv->column, TRUE);
+ g_signal_connect (priv->column, "clicked", G_CALLBACK (column_clicked), palette);
renderer = gtk_cell_renderer_toggle_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_add_attribute (column, renderer, "active", COLUMN_SELECTED);
- gtk_tree_view_column_add_attribute (column, renderer, "visible", COLUMN_SELECTABLE);
+ gtk_tree_view_column_pack_start (priv->column, renderer, FALSE);
+ gtk_tree_view_column_add_attribute (priv->column, renderer, "active", COLUMN_SELECTED);
+ gtk_tree_view_column_add_attribute (priv->column, renderer, "visible", COLUMN_SELECTABLE);
g_signal_connect (renderer, "toggled", G_CALLBACK (toggled), palette);
renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, renderer, "text", COLUMN_TITLE);
- gtk_tree_view_column_add_attribute (column, renderer, "weight", COLUMN_WEIGHT);
+ gtk_tree_view_column_pack_start (priv->column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute (priv->column, renderer, "text", COLUMN_TITLE);
+ gtk_tree_view_column_add_attribute (priv->column, renderer, "weight", COLUMN_WEIGHT);
g_signal_connect (renderer, "edited", G_CALLBACK (cell_edited), palette);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (object), column);
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (object), FALSE);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (object), priv->column);
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (object), TRUE);
+ gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (object), TRUE);
+
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (object), is_separator, NULL, NULL);
gtk_tree_view_set_enable_search (GTK_TREE_VIEW (object), TRUE);
gtk_tree_view_set_search_column (GTK_TREE_VIEW (object), COLUMN_TITLE);
@@ -516,7 +531,7 @@ ephy_topics_palette_class_init (EphyTopicsPaletteClass *klass)
g_param_spec_int ("mode",
"Mode",
"Mode",
- 0, 2, 1, G_PARAM_WRITABLE));
+ 0, MODES-1, 0, G_PARAM_WRITABLE));
g_type_class_add_private (object_class, sizeof(EphyTopicsPalettePrivate));
}
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 482015a7b..1dea398c6 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -489,7 +489,7 @@ cmd_bookmark_link (GtkAction *action,
location = ephy_node_get_property_string (node, EPHY_NODE_PAGE_PROP_LOCATION);
title = ephy_node_get_property_string (node, EPHY_NODE_PAGE_PROP_TITLE);
- ephy_bookmarks_ui_add_bookmark (GTK_WIDGET (editor), location, title);
+ ephy_bookmarks_ui_add_bookmark (location, title);
}
g_list_free (selection);
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 107304f83..03494ac2b 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -127,7 +127,7 @@ popup_cmd_bookmark_link (GtkAction *action,
location = rel;
}
- ephy_bookmarks_ui_add_bookmark (GTK_WIDGET (window), location, title);
+ ephy_bookmarks_ui_add_bookmark (location, title);
}
static void
diff --git a/src/window-commands.c b/src/window-commands.c
index 226d1e78a..fffcedfe1 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -240,8 +240,7 @@ window_cmd_file_bookmark_page (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_bookmarks_ui_add_bookmark (GTK_WIDGET (window),
- ephy_tab_get_address (tab),
+ ephy_bookmarks_ui_add_bookmark (ephy_tab_get_address (tab),
ephy_tab_get_title (tab));
}