aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorPeter Harvey <pah06@uow.edu.au>2005-10-17 04:29:26 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-17 04:29:26 +0800
commitd21007362f8d0701d63e50fe6b219de067d95a87 (patch)
tree46326d5633d4f3c8504049476d0e72ae7ed0ca2c /src/bookmarks/ephy-bookmarks-editor.c
parent35b9deda1f37ac0cc81d926b5295983de6b55dcf (diff)
downloadgsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar.gz
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar.bz2
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar.lz
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar.xz
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.tar.zst
gsoc2013-epiphany-d21007362f8d0701d63e50fe6b219de067d95a87.zip
H18 patch, by Peter Harvey <pah06@uow.edu.au>.
2005-10-16 Peter Harvey <pah06@uow.edu.au> H18 patch, by Peter Harvey <pah06@uow.edu.au>. * data/ui/epiphany-bookmark-editor-ui.xml: * data/ui/epiphany-ui.xml: * lib/egg/egg-editable-toolbar.c: (get_dock_position), (get_toolbar_position), (get_toolbar_nth), (find_action), (drag_data_delete_cb), (drag_begin_cb), (drag_end_cb), (drag_data_get_cb), (move_item_cb), (set_dock_visible), (remove_item_cb), (remove_toolbar_cb), (toggle_visibility_cb), (egg_editable_toolbar_add_visibility_items), (egg_editable_toolbar_add_popup_items), (popup_context_menu_cb), (button_press_event_cb), (configure_item_sensitivity), (configure_item_cursor), (connect_widget_signals), (action_sensitive_cb), (create_item_from_action), (create_item_from_position), (toolbar_drag_data_received_cb), (toolbar_drag_drop_cb), (toolbar_drag_motion_cb), (toolbar_drag_leave_cb), (configure_drag_dest), (create_dock), (toolbar_changed_cb), (unparent_fixed), (update_fixed), (toolbar_added_cb), (toolbar_removed_cb), (item_added_cb), (item_removed_cb), (egg_editable_toolbar_construct), (egg_editable_toolbar_set_ui_manager), (egg_editable_toolbar_set_property), (egg_editable_toolbar_get_property), (egg_editable_toolbar_init), (egg_editable_toolbar_finalize), (egg_editable_toolbar_get_edit_mode), (egg_editable_toolbar_set_edit_mode), (egg_editable_toolbar_set_fixed): * lib/egg/egg-editable-toolbar.h: * lib/egg/egg-toolbar-editor.c: (compare_items), (item_added_or_removed_cb), (toolbar_removed_cb), (egg_toolbar_editor_set_model), (egg_toolbar_editor_finalize), (drag_begin_cb), (drag_end_cb), (drag_data_get_cb), (editor_create_item), (editor_create_item_from_name), (append_table), (update_editor_sheet), (egg_toolbar_editor_init): * lib/egg/egg-toolbar-editor.h: * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_to_xml), (egg_toolbars_model_save), (toolbar_node_new), (item_node_new), (item_node_free), (toolbar_node_free), (egg_toolbars_model_get_flags), (egg_toolbars_model_set_flags), (egg_toolbars_model_get_data), (egg_toolbars_model_get_name), (impl_add_item), (egg_toolbars_model_add_item), (egg_toolbars_model_add_toolbar), (parse_data_list), (parse_item_list), (parse_toolbars), (egg_toolbars_model_load), (egg_toolbars_model_class_init), (egg_toolbars_model_init), (egg_toolbars_model_finalize), (egg_toolbars_model_remove_toolbar), (egg_toolbars_model_remove_item), (egg_toolbars_model_move_item), (egg_toolbars_model_n_items), (egg_toolbars_model_item_nth), (egg_toolbars_model_n_toolbars), (egg_toolbars_model_toolbar_nth), (egg_toolbars_model_get_types), (egg_toolbars_model_set_types), (fill_avail_array), (egg_toolbars_model_get_avail), (egg_toolbars_model_get_n_avail), (egg_toolbars_model_set_n_avail): * lib/egg/egg-toolbars-model.h: * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmark-action-group.c: (smart_added_cb), (smart_removed_cb), (node_changed_cb), (node_added_cb), (node_removed_cb), (ephy_bookmark_group_new): * src/bookmarks/ephy-bookmark-action-group.h: * src/bookmarks/ephy-bookmark-action.c: (create_tool_item), (ephy_bookmark_action_sync_icon), (show_context_menu), (popup_menu_cb), (button_press_cb), (button_release_cb), (connect_proxy), (ephy_bookmark_action_updated), (ephy_bookmark_action_get_bookmark), (ephy_bookmark_action_set_bookmark), (ephy_bookmark_action_set_property), (ephy_bookmark_action_get_property), (ephy_bookmark_action_finalize), (ephy_bookmark_action_class_init), (ephy_bookmark_action_init), (ephy_bookmark_action_name), (ephy_bookmark_action_new): * src/bookmarks/ephy-bookmark-action.h: * src/bookmarks/ephy-bookmark-factory-action.c: (ephy_bookmark_factory_action_get_type), (activate_item_cb), (build_menu_for_topic), (build_menu), (remove_placeholder_cb), (activate_placeholder_cb), (clicked_placeholder_cb), (realize_placeholder_cb), (create_tool_item), (connect_proxy), (ephy_bookmark_factory_action_class_init), (ephy_bookmark_factory_action_new): * src/bookmarks/ephy-bookmark-factory-action.h: * src/bookmarks/ephy-bookmark-properties.c: (ephy_bookmark_properties_set_property), (ephy_bookmark_properties_get_property), (bookmark_properties_response_cb), (update_entry), (location_entry_changed_cb), (build_ui): * src/bookmarks/ephy-bookmarks-editor.c: (add_entry_monitor), (cmd_add_topic), (delete_topic_dialog_construct), (cmd_bookmarks_import), (ephy_bookmarks_editor_finalize), (ephy_bookmarks_editor_node_activated_cb), (ephy_bookmarks_editor_update_menu), (view_focus_cb), (add_focus_monitor), (remove_focus_monitor), (bookmarks_filter), (search_entry_search_cb), (ephy_bookmarks_editor_construct), (ephy_bookmarks_editor_set_parent), (ephy_bookmarks_editor_set_property), (ephy_bookmarks_editor_get_property), (ephy_bookmarks_editor_init): * src/bookmarks/ephy-bookmarks-menu.c: (append_bookmarks), (append_menu), (ephy_bookmarks_menu_build): * src/bookmarks/ephy-bookmarks-menu.h: * src/bookmarks/ephy-bookmarks-ui.c: (find_action), (activate_bookmarks_menu), (activate_favorites_menu), (erase_bookmarks_menu), (erase_favorites_menu), (tree_changed_cb), (node_added_cb), (node_changed_cb), (node_removed_cb), (ephy_bookmarks_ui_attach_window), (ephy_bookmarks_ui_detach_window), (toolbar_node_removed_cb), (topic_has_data), (topic_get_data), (topic_get_name), (bookmark_has_data), (bookmark_get_data), (bookmark_get_name), (bookmark_new_name), (ephy_bookmarks_ui_attach_toolbar_model), (ephy_bookmarks_ui_detach_toolbar_model): * src/bookmarks/ephy-bookmarks-ui.h: * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_get_type), (ephy_bookmarks_init_defaults), (ephy_bookmarks_class_init), (ephy_bookmarks_save_delayed), (add_to_favorites), (update_bookmark_keywords), (ephy_bookmarks_init), (ephy_bookmarks_finalize), (ephy_bookmarks_add), (ephy_bookmarks_set_address), (ephy_bookmarks_set_icon), (ephy_bookmarks_add_keyword), (ephy_bookmarks_show_bookmark_properties), (ephy_bookmarks_get_from_id), (ephy_bookmarks_compare_topics), (ephy_bookmarks_compare_topic_pointers), (ephy_bookmarks_compare_bookmarks), (ephy_bookmarks_compare_bookmark_pointers): * src/bookmarks/ephy-bookmarks.h: * src/bookmarks/ephy-bookmarksbar-model.c: * src/bookmarks/ephy-bookmarksbar-model.h: * src/bookmarks/ephy-bookmarksbar.c: * src/bookmarks/ephy-bookmarksbar.h: * src/bookmarks/ephy-favorites-menu.c: * src/bookmarks/ephy-favorites-menu.h: * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_add), (build_editing_table), (ephy_new_bookmark_construct), (ephy_new_bookmark_set_property), (ephy_new_bookmark_get_property): * src/bookmarks/ephy-nodes-cover.c: (ephy_nodes_count_covered), (ephy_nodes_remove_covered), (ephy_nodes_remove_not_covered), (ephy_nodes_get_covered), (ephy_nodes_covered), (ephy_nodes_get_covering): * src/bookmarks/ephy-nodes-cover.h: * src/bookmarks/ephy-open-tabs-action.c: (activate_cb), (node_added_cb), (node_removed_cb), (ephy_open_tabs_group_new), (ephy_open_tabs_action_name): * src/bookmarks/ephy-open-tabs-action.h: * src/bookmarks/ephy-related-action.c: (node_changed), (node_destroyed), (open_link), (iface_init), (ephy_related_action_get_type), (ephy_related_action_new): * src/bookmarks/ephy-related-action.h: * src/bookmarks/ephy-topic-action-group.c: (node_changed_cb), (node_added_cb), (node_removed_cb), (ephy_topic_group_new): * src/bookmarks/ephy-topic-action-group.h: * src/bookmarks/ephy-topic-action.c: (ephy_topic_action_get_type), (create_tool_item), (ephy_topic_action_sync_label), (get_popup), (erase_popup), (child_added_cb), (child_changed_cb), (child_removed_cb), (menu_destroy_cb), (menu_init_cb), (button_deactivate_cb), (button_toggled_cb), (button_release_cb), (button_press_cb), (connect_proxy), (ephy_topic_action_updated), (ephy_topic_action_get_topic), (ephy_topic_action_set_topic), (ephy_topic_action_set_property), (ephy_topic_action_get_property), (ephy_topic_action_class_init), (ephy_topic_action_init), (ephy_topic_action_name), (ephy_topic_action_new): * src/bookmarks/ephy-topic-action.h: * src/bookmarks/ephy-topic-factory-action.c: (ephy_topic_factory_action_get_type), (sort_topics), (activate_item_cb), (build_menu), (remove_placeholder_cb), (activate_placeholder_cb), (clicked_placeholder_cb), (realize_placeholder_cb), (create_tool_item), (connect_proxy), (ephy_topic_factory_action_class_init), (ephy_topic_factory_action_new): * src/bookmarks/ephy-topic-factory-action.h: * src/ephy-link-action.c: (ephy_link_action_group_get_type), (ephy_link_action_group_new): * src/ephy-link-action.h: * src/ephy-lockdown.c: (find_name), (find_action_group), (update_window): * src/ephy-notebook.c: (move_tab_to_another_notebook), (ephy_notebook_switch_page_cb), (ephy_notebook_init), (tab_label_style_set_cb), (build_tab_label), (ephy_notebook_add_tab): * src/ephy-shell.c: (ephy_shell_get_toolbars_model): * src/ephy-toolbar-editor.c: (ephy_toolbar_editor_constructor), (ephy_toolbar_editor_finalize), (ephy_toolbar_editor_set_property), (ephy_toolbar_editor_class_init): * src/ephy-toolbar.c: (ephy_toolbar_realize), (ephy_toolbar_unrealize), (ephy_toolbar_finalize): * src/ephy-toolbars-model.c: (update_flags), (ephy_toolbars_model_load): * src/ephy-window.c: (ephy_window_get_type), (get_chromes_visibility), (sync_chromes_visibility), (ephy_window_key_press_event), (tool_item_enter_cb), (tool_item_leave_cb), (tool_item_drag_begin_cb), (connect_tool_item), (disconnect_tool_item), (disconnect_proxy_cb), (connect_proxy_cb), (update_chromes_actions), (show_embed_popup), (tab_added_cb), (tab_removed_cb), (ephy_window_set_chrome), (ephy_window_dispose), (ephy_window_class_init), (ephy_window_init), (ephy_window_finalize), (ephy_window_remove_tab), (ephy_window_set_zoom), (sync_prefs_with_chrome), (ephy_window_view_toolbar_cb): * src/ephy-window.h: Revision history: h18, released 2005/09/23, for Epiphany 1.8.0 * Just an update for 1.8.0. h17, released 2005/08/30, for Epiphany 1.7.6 or CVS HEAD * Mostly just an update for 1.7.6. * Topic menus on the toolbar now open without releasing the mouse button. * Topic menus on the toolbar are now also hierarchical (see if you like it. h16, released 2005/08/25, for Epiphany 1.7.5 or CVS HEAD * Just an update for 1.7.5. Sorry, I've been busy. :) h15, released 2005/07/19, for Epiphany 1.7.2 or CVS HEAD * Code cleanup h14, released 2005/07/9, for Epiphany 1.7.1 or CVS HEAD * Improved helpful tip when adding a bookmark * Improved toolbar context menu * Toolbar visibility state is now saved * Separated bookmark/topic action groups into separate files * Topics in the overflow menu now behave as submenus * Now importing old bookmarksbar, and saving to new filename * Incremented toolbar file format version number to 1.1 * Fixed the 'sticky' statusbar help * Fixed a crashing bug (dnd then open a topic on the toolbar) h13, released 2005/05/12, for CVS HEAD * Added middle-mouse drag-drop for the editable toolbar. * Fixed some warnings at compile and run time. * Added brief help for the user when adding a new bookmark. * Cleaned up the editable toolbar code a little. h12, released 2005/05/10, for CVS HEAD * Added new editing facilities for the editable toolbar. h11, released 2005/04/29, for CVS HEAD * Fixed bug in statusbar information for toolbar items. * Added an all-new 'Related' toolbar widget which changes to show the most related topic whenever a bookmark is activated. h10, released 2005/04/15, for Epiphany 1.6.2 or CVS HEAD * Added statusbar information for all toolbar items. * Empty toolbars are now only deleted when exiting edit mode. * Fixed regression of middle-click for bookmarks on toolbar. * Fixed regression of ellipsized bookmark names in menus. h9, released 2005/04/12, for Epiphany 1.6.1 * Updated patch for 1.6.1. Long time no see. * Now using EphyLink objects everywhere. h7, released 2004/10/21, for Epiphany 1.4.4 * Updated patch for 1.4.4. * Fixed bugs causing crashes when bookmarks were added (thanks Reinout). * Added "Open in Tabs" back into bookmark menus where suitable. h6, released 2004/09/20, for Epiphany 1.4.0 * Updated patch for 1.4.0. * Removed the bookmarks bar. * Generate shared XML string for bookmarks menu. * Slightly improve performance of node-cover code. * Delay adding bookmarks menu until it is first used. * Fixed bug(?) in ephy-node. h4, released 2004/08/08, for Epiphany 1.3.4 * Updated patch due to changes to topics selector. * Removed 'Most Visited' from the min-cover calculations. * Fixed Epiphany 1.3.4 bug where topics in selector aren't sorted. * Updated patch due to other changes in Epiphany 1.3.4 source. h3, released 2004/07/12, for Epiphany 1.3.2 * Simple update for Epiphany 1.3.2 h3, released 2004/05/24, for Epiphany 1.2.5 * Moved duplicated functions into a seperate file. * Improved topic selector. * Bookmarks toolbar topic menus now have subdivisions. * Topic names in menu now change if modified in the bookmarks editor. h2, released 2004/05/23, for Epiphany 1.2.5 * Significantly cleaned up the code. * 'Most Visited' no longer appears as a submenu. * Subtopics are selected much more intelligently, giving a better approximation to a true minimum cover. * Topic selector now shows suggestions with arrows, not bold font. h1, released 2004/05/19, for Epiphany 1.2.5 * Initial release.
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c239
1 files changed, 67 insertions, 172 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 24dbeedac..7608823a6 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -62,10 +62,10 @@
#include "ephy-gui.h"
#include "ephy-stock-icons.h"
#include "ephy-search-entry.h"
-#include "ephy-bookmarksbar-model.h"
#include "ephy-favicon-cache.h"
#include "eel-gconf-extensions.h"
#include "ephy-debug.h"
+#include "egg-toolbars-model.h"
static GtkTargetEntry topic_drag_dest_types [] =
{
@@ -76,9 +76,9 @@ static int n_topic_drag_dest_types = G_N_ELEMENTS (topic_drag_dest_types);
static GtkTargetEntry bmk_drag_types [] =
{
- { EPHY_DND_URL_TYPE, 0, 0 },
- { EPHY_DND_URI_LIST_TYPE, 0, 1 },
- { EPHY_DND_TEXT_TYPE, 0, 2 }
+ { EPHY_DND_URL_TYPE, 0, 0 },
+ { EPHY_DND_URI_LIST_TYPE, 0, 1 },
+ { EPHY_DND_TEXT_TYPE, 0, 2 }
};
static int n_bmk_drag_types = G_N_ELEMENTS (bmk_drag_types);
@@ -93,9 +93,9 @@ 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,
- GParamSpec *pspec);
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void ephy_bookmarks_editor_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -106,10 +106,8 @@ static void cmd_open_bookmarks_in_tabs (GtkAction *action,
EphyBookmarksEditor *editor);
static void cmd_open_bookmarks_in_browser (GtkAction *action,
EphyBookmarksEditor *editor);
-static void cmd_show_in_bookmarks_bar (GtkAction *action,
- EphyBookmarksEditor *editor);
static void cmd_delete (GtkAction *action,
- EphyBookmarksEditor *editor);
+ EphyBookmarksEditor *editor);
static void cmd_bookmark_properties (GtkAction *action,
EphyBookmarksEditor *editor);
static void cmd_bookmarks_import (GtkAction *action,
@@ -151,7 +149,6 @@ struct _EphyBookmarksEditorPrivate
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
int priority_col;
- EphyBookmarksBarModel *tb_model;
GtkTreeViewColumn *title_col;
GtkTreeViewColumn *address_col;
@@ -225,15 +222,6 @@ static GtkActionEntry ephy_bookmark_popup_entries [] = {
};
static guint ephy_bookmark_popup_n_entries = G_N_ELEMENTS (ephy_bookmark_popup_entries);
-static GtkToggleActionEntry ephy_bookmark_popup_toggle_entries [] =
-{
- /* File Menu */
- { "ShowInBookmarksBar", NULL, N_("_Show in Bookmarks Bar"), NULL,
- N_("Show the selected bookmark or topic in the bookmarks bar"),
- G_CALLBACK (cmd_show_in_bookmarks_bar), FALSE }
-};
-static guint ephy_bookmark_popup_n_toggle_entries = G_N_ELEMENTS (ephy_bookmark_popup_toggle_entries);
-
enum
{
VIEW_TITLE,
@@ -260,14 +248,14 @@ entry_selection_changed_cb (GtkWidget *widget, GParamSpec *pspec, EphyBookmarksE
static void
add_entry_monitor (EphyBookmarksEditor *editor, GtkWidget *entry)
{
- g_signal_connect (G_OBJECT (entry),
- "notify::selection-bound",
- G_CALLBACK (entry_selection_changed_cb),
- editor);
- g_signal_connect (G_OBJECT (entry),
- "notify::cursor-position",
- G_CALLBACK (entry_selection_changed_cb),
- editor);
+ g_signal_connect (G_OBJECT (entry),
+ "notify::selection-bound",
+ G_CALLBACK (entry_selection_changed_cb),
+ editor);
+ g_signal_connect (G_OBJECT (entry),
+ "notify::cursor-position",
+ G_CALLBACK (entry_selection_changed_cb),
+ editor);
}
static void
@@ -288,7 +276,7 @@ cmd_add_topic (GtkAction *action,
EphyNode *node;
node = ephy_bookmarks_add_keyword (editor->priv->bookmarks,
- _("Type a topic"));
+ _("Type a topic"));
ephy_node_view_select_node (EPHY_NODE_VIEW (editor->priv->key_view), node);
ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view), TRUE);
add_text_renderer_monitor (editor);
@@ -334,65 +322,6 @@ get_target_window (EphyBookmarksEditor *editor)
}
static void
-toolbar_items_changed_cb (EggToolbarsModel *model,
- int toolbar_position,
- int position,
- EphyBookmarksEditor *editor)
-{
- ephy_bookmarks_editor_update_menu (editor);
-}
-
-static void
-cmd_show_in_bookmarks_bar (GtkAction *action,
- EphyBookmarksEditor *editor)
-{
- EphyNode *node;
- GList *selection;
- gboolean state, topic;
- guint id;
-
- if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)))
- {
- selection = ephy_node_view_get_selection
- (EPHY_NODE_VIEW (editor->priv->bm_view));
- topic = FALSE;
- }
- else if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->key_view)))
- {
- selection = ephy_node_view_get_selection
- (EPHY_NODE_VIEW (editor->priv->key_view));
- topic = TRUE;
- }
- else
- {
- return;
- }
-
- node = selection->data;
- id = ephy_node_get_id (node);
- state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-
- if (state)
- {
- ephy_bookmarksbar_model_add_bookmark
- (editor->priv->tb_model, topic, id);
- }
- else
- {
- g_signal_handlers_block_by_func
- (editor->priv->tb_model,
- G_CALLBACK (toolbar_items_changed_cb), editor);
- ephy_bookmarksbar_model_remove_bookmark
- (editor->priv->tb_model, id);
- g_signal_handlers_unblock_by_func
- (editor->priv->tb_model,
- G_CALLBACK (toolbar_items_changed_cb), editor);
- }
-
- g_list_free (selection);
-}
-
-static void
cmd_open_bookmarks_in_tabs (GtkAction *action,
EphyBookmarksEditor *editor)
{
@@ -478,7 +407,7 @@ delete_topic_dialog_construct (GtkWindow *parent,
gtk_window_group_add_window (GTK_WINDOW (parent)->group, GTK_WINDOW (dialog));
- return dialog;
+ return dialog;
}
static void
@@ -863,7 +792,7 @@ cmd_bookmarks_import (GtkAction *action,
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
- store = GTK_LIST_STORE (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING));
+ store = GTK_LIST_STORE (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING));
files = add_bookmarks_files (FIREFOX_BOOKMARKS_DIR_0, "bookmarks.html", 2);
files = g_slist_concat (add_bookmarks_files (FIREFOX_BOOKMARKS_DIR_1, "bookmarks.html", 2), files);
@@ -879,8 +808,8 @@ cmd_bookmarks_import (GtkAction *action,
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter, 0, _("File"), 1, NULL, -1);
- sortmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
- g_object_unref (store);
+ sortmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (store);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sortmodel), 0, GTK_SORT_ASCENDING);
@@ -1129,8 +1058,8 @@ ephy_bookmarks_editor_finalize (GObject *object)
if (editor->priv->window)
{
g_object_remove_weak_pointer
- (G_OBJECT(editor->priv->window),
- (gpointer *)&editor->priv->window);
+ (G_OBJECT(editor->priv->window),
+ (gpointer *)&editor->priv->window);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -1138,7 +1067,7 @@ ephy_bookmarks_editor_finalize (GObject *object)
static void
ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
- EphyNode *node,
+ EphyNode *node,
EphyBookmarksEditor *editor)
{
const char *location;
@@ -1161,8 +1090,8 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
gboolean key_selection, bmk_selection, single_bmk_selected;
gboolean key_normal = FALSE;
gboolean cut, copy, paste, select_all;
- gboolean can_show_in_bookmarks_bar, show_in_bookmarks_bar = FALSE;
gboolean mutable = TRUE;
+
GtkActionGroup *action_group;
GtkAction *action;
GList *selected;
@@ -1210,11 +1139,6 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
{
EphyNode *node = selected->data;
EphyNodePriority priority;
- guint id;
-
- id = ephy_node_get_id (node);
- show_in_bookmarks_bar = ephy_bookmarksbar_model_has_bookmark
- (editor->priv->tb_model, id);
priority = ephy_node_get_property_int
(node, EPHY_NODE_KEYWORD_PROP_PRIORITY);
@@ -1233,8 +1157,6 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
g_return_if_fail (node != NULL);
id = ephy_node_get_id (node);
- show_in_bookmarks_bar = ephy_bookmarksbar_model_has_bookmark
- (editor->priv->tb_model, id);
mutable = !ephy_node_get_property_boolean (node, EPHY_NODE_BMK_PROP_IMMUTABLE);
g_list_free (selected);
@@ -1263,8 +1185,6 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
delete = (bmk_focus && bmk_selection && mutable) ||
(key_selection && key_focus && key_normal);
properties = bmk_focus && single_bmk_selected && mutable;
- can_show_in_bookmarks_bar = (bmk_focus && single_bmk_selected && mutable) ||
- (key_selection && key_focus);
action_group = editor->priv->action_group;
action = gtk_action_group_get_action (action_group, "OpenInWindow");
@@ -1287,25 +1207,13 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
action = gtk_action_group_get_action (action_group, "Paste");
gtk_action_set_sensitive (action, paste);
action = gtk_action_group_get_action (action_group, "SelectAll");
- gtk_action_set_sensitive (action, select_all);
- action = gtk_action_group_get_action (action_group, "ShowInBookmarksBar");
- gtk_action_set_sensitive (action, can_show_in_bookmarks_bar);
-
- g_signal_handlers_block_by_func
- (G_OBJECT (GTK_TOGGLE_ACTION (action)),
- G_CALLBACK (cmd_show_in_bookmarks_bar),
- editor);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), show_in_bookmarks_bar);
- g_signal_handlers_unblock_by_func
- (G_OBJECT (GTK_TOGGLE_ACTION (action)),
- G_CALLBACK (cmd_show_in_bookmarks_bar),
- editor);
+ g_object_set (action, "sensitive", select_all, NULL);
}
static gboolean
view_focus_cb (EphyNodeView *view,
- GdkEventFocus *event,
- EphyBookmarksEditor *editor)
+ GdkEventFocus *event,
+ EphyBookmarksEditor *editor)
{
ephy_bookmarks_editor_update_menu (editor);
@@ -1316,21 +1224,21 @@ static void
add_focus_monitor (EphyBookmarksEditor *editor, GtkWidget *widget)
{
g_signal_connect (G_OBJECT (widget),
- "focus_in_event",
- G_CALLBACK (view_focus_cb),
- editor);
+ "focus_in_event",
+ G_CALLBACK (view_focus_cb),
+ editor);
g_signal_connect (G_OBJECT (widget),
- "focus_out_event",
- G_CALLBACK (view_focus_cb),
- editor);
+ "focus_out_event",
+ G_CALLBACK (view_focus_cb),
+ editor);
}
static void
remove_focus_monitor (EphyBookmarksEditor *editor, GtkWidget *widget)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (widget),
- G_CALLBACK (view_focus_cb),
- editor);
+ G_CALLBACK (view_focus_cb),
+ editor);
}
static gboolean
@@ -1381,13 +1289,13 @@ ephy_bookmarks_editor_dispose (GObject *object)
static void
bookmarks_filter (EphyBookmarksEditor *editor,
- EphyNode *keyword)
+ EphyNode *keyword)
{
ephy_node_filter_empty (editor->priv->bookmarks_filter);
ephy_node_filter_add_expression (editor->priv->bookmarks_filter,
- ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_HAS_PARENT,
- keyword),
- 0);
+ ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_HAS_PARENT,
+ keyword),
+ 0);
ephy_node_filter_done_changing (editor->priv->bookmarks_filter);
}
@@ -1462,15 +1370,15 @@ search_entry_search_cb (GtkWidget *entry, const char *search_text, EphyBookmarks
ephy_node_filter_empty (editor->priv->bookmarks_filter);
ephy_node_filter_add_expression (editor->priv->bookmarks_filter,
- ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_STRING_PROP_CONTAINS,
- EPHY_NODE_BMK_PROP_TITLE,
- search_text),
- 0);
+ ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_STRING_PROP_CONTAINS,
+ EPHY_NODE_BMK_PROP_TITLE,
+ search_text),
+ 0);
ephy_node_filter_add_expression (editor->priv->bookmarks_filter,
- ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_STRING_PROP_CONTAINS,
- EPHY_NODE_BMK_PROP_KEYWORDS,
- search_text),
- 0);
+ ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_STRING_PROP_CONTAINS,
+ EPHY_NODE_BMK_PROP_KEYWORDS,
+ search_text),
+ 0);
ephy_node_filter_done_changing (editor->priv->bookmarks_filter);
}
@@ -1646,10 +1554,6 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
gtk_action_group_set_translation_domain (action_group, NULL);
gtk_action_group_add_actions (action_group, ephy_bookmark_popup_entries,
ephy_bookmark_popup_n_entries, editor);
- gtk_action_group_add_toggle_actions (action_group,
- 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,
@@ -1661,8 +1565,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
gtk_ui_manager_insert_action_group (ui_merge,
action_group, 0);
gtk_ui_manager_add_ui_from_file (ui_merge,
- ephy_file ("epiphany-bookmark-editor-ui.xml"),
- NULL);
+ ephy_file ("epiphany-bookmark-editor-ui.xml"),
+ NULL);
gtk_window_add_accel_group (GTK_WINDOW (editor),
gtk_ui_manager_get_accel_group (ui_merge));
gtk_ui_manager_ensure_update (ui_merge);
@@ -1694,7 +1598,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
key_view = ephy_node_view_new (node, NULL);
add_focus_monitor (editor, key_view);
col_id = ephy_node_view_add_data_column (EPHY_NODE_VIEW (key_view),
- G_TYPE_STRING, -1,
+ G_TYPE_STRING, -1,
provide_keyword_uri, editor);
ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
G_TYPE_STRING,
@@ -1704,11 +1608,11 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
EPHY_NODE_VIEW_SEARCHABLE, NULL, NULL);
ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (key_view),
topic_drag_types,
- n_topic_drag_types,
+ n_topic_drag_types,
col_id, -1);
ephy_node_view_enable_drag_dest (EPHY_NODE_VIEW (key_view),
- topic_drag_dest_types,
- n_topic_drag_dest_types);
+ topic_drag_dest_types,
+ n_topic_drag_dest_types);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (key_view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
g_signal_connect (G_OBJECT (selection),
@@ -1777,7 +1681,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
0, NULL, &(editor->priv->address_col));
ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (bm_view),
bmk_drag_types,
- n_bmk_drag_types,
+ n_bmk_drag_types,
url_col_id, title_col_id);
ephy_node_view_set_sort (EPHY_NODE_VIEW (bm_view), G_TYPE_STRING,
EPHY_NODE_BMK_PROP_TITLE, GTK_SORT_ASCENDING);
@@ -1804,11 +1708,11 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_state_add_window (GTK_WIDGET(editor),
"bookmarks_editor",
- 450, 400, FALSE,
+ 450, 400, FALSE,
EPHY_STATE_WINDOW_SAVE_SIZE | EPHY_STATE_WINDOW_SAVE_POSITION);
ephy_state_add_paned (GTK_WIDGET (hpaned),
"bookmarks_paned",
- 130);
+ 130);
set_columns_visibility (editor, details_value);
}
@@ -1820,15 +1724,15 @@ ephy_bookmarks_editor_set_parent (EphyBookmarksEditor *ebe,
if (ebe->priv->window)
{
g_object_remove_weak_pointer
- (G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (G_OBJECT(ebe->priv->window),
+ (gpointer *)&ebe->priv->window);
}
ebe->priv->window = window;
g_object_add_weak_pointer
- (G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (G_OBJECT(ebe->priv->window),
+ (gpointer *)&ebe->priv->window);
}
@@ -1851,9 +1755,9 @@ ephy_bookmarks_editor_new (EphyBookmarks *bookmarks)
static void
ephy_bookmarks_editor_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
EphyBookmarksEditor *editor = EPHY_BOOKMARKS_EDITOR (object);
@@ -1870,9 +1774,9 @@ ephy_bookmarks_editor_set_property (GObject *object,
static void
ephy_bookmarks_editor_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
EphyBookmarksEditor *editor = EPHY_BOOKMARKS_EDITOR (object);
@@ -1891,13 +1795,4 @@ static void
ephy_bookmarks_editor_init (EphyBookmarksEditor *editor)
{
editor->priv = EPHY_BOOKMARKS_EDITOR_GET_PRIVATE (editor);
-
- editor->priv->tb_model = EPHY_BOOKMARKSBAR_MODEL
- (ephy_bookmarks_get_toolbars_model
- (ephy_shell_get_bookmarks (ephy_shell)));
-
- g_signal_connect (editor->priv->tb_model, "item_added",
- G_CALLBACK (toolbar_items_changed_cb), editor);
- g_signal_connect (editor->priv->tb_model, "item_removed",
- G_CALLBACK (toolbar_items_changed_cb), editor);
}