aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-17 02:02:41 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-17 02:02:41 +0800
commit3d8d6c2a763f3f8cdb69719763ebe3cbeeaab789 (patch)
tree5ff81bb6b71d998e15426ea23af855b28e007243 /src/bookmarks/ephy-bookmarks-editor.c
parent4bc1338f7943928d6abaac5b955c2a86f5ddc8e6 (diff)
downloadgsoc2013-epiphany-3d8d6c2a763f3f8cdb69719763ebe3cbeeaab789.tar.gz
gsoc2013-epiphany-3d8d6c2a763f3f8cdb69719763ebe3cbeeaab789.tar.zst
gsoc2013-epiphany-3d8d6c2a763f3f8cdb69719763ebe3cbeeaab789.zip
Add a way to decide if the view is target. The impl is an hack but we keep
2003-04-16 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-editor.c: (cmd_rename), (cmd_delete), (cmd_select_all), (ephy_bookmarks_editor_update_menu), (ephy_bookmarks_editor_show_popup_cb), (keyword_node_show_popup_cb), (menu_activate_cb): * src/bookmarks/ephy-node-view.c: (ephy_node_view_key_press_cb), (ephy_node_view_button_press_cb), (ephy_node_view_construct), (ephy_node_view_is_editing), (ephy_node_view_is_target): * src/bookmarks/ephy-node-view.h: Add a way to decide if the view is target. The impl is an hack but we keep ephy-bookmarks clean. The best we can do right now.
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 3992cc0e1..b9782120f 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -200,11 +200,11 @@ static void
cmd_rename (EggAction *action,
EphyBookmarksEditor *editor)
{
- if (gtk_widget_is_focus (editor->priv->bm_view))
+ if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)))
{
ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->bm_view));
}
- else if (gtk_widget_is_focus (editor->priv->key_view))
+ else if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->key_view)))
{
ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view));
}
@@ -279,11 +279,11 @@ static void
cmd_delete (EggAction *action,
EphyBookmarksEditor *editor)
{
- if (gtk_widget_is_focus (editor->priv->bm_view))
+ if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)))
{
ephy_node_view_remove (EPHY_NODE_VIEW (editor->priv->bm_view));
}
- else if (gtk_widget_is_focus (editor->priv->key_view))
+ else if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->key_view)))
{
ephy_node_view_remove (EPHY_NODE_VIEW (editor->priv->key_view));
}
@@ -356,7 +356,7 @@ cmd_select_all (EggAction *action,
{
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
}
- else if (gtk_widget_is_focus (bm_view))
+ else if (ephy_node_view_is_target (EPHY_NODE_VIEW (bm_view)))
{
GtkTreeSelection *sel;
@@ -481,8 +481,7 @@ ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
}
static void
-ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor,
- GtkWidget *selected_view)
+ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
{
gboolean open_in_window, open_in_tab,
rename, delete, properties;
@@ -497,16 +496,10 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor,
GList *selected;
GtkWidget *focus_widget;
- if (selected_view)
- {
- bmk_focus = (selected_view == editor->priv->bm_view);
- key_focus = (selected_view == editor->priv->key_view);
- }
- else
- {
- bmk_focus = gtk_widget_is_focus (editor->priv->bm_view);
- key_focus = gtk_widget_is_focus (editor->priv->key_view);
- }
+ bmk_focus = ephy_node_view_is_target
+ (EPHY_NODE_VIEW (editor->priv->bm_view));
+ key_focus = ephy_node_view_is_target
+ (EPHY_NODE_VIEW (editor->priv->key_view));
focus_widget = gtk_window_get_focus (GTK_WINDOW (editor));
@@ -598,7 +591,7 @@ ephy_bookmarks_editor_show_popup_cb (GtkWidget *view,
widget = egg_menu_merge_get_widget (editor->priv->ui_merge,
"/popups/EphyBookmarkEditorPopup");
- ephy_bookmarks_editor_update_menu (editor, view);
+ ephy_bookmarks_editor_update_menu (editor);
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
gtk_get_current_event_time ());
}
@@ -716,7 +709,7 @@ keyword_node_show_popup_cb (GtkWidget *view, EphyBookmarksEditor *editor)
widget = egg_menu_merge_get_widget (editor->priv->ui_merge,
"/popups/EphyBookmarkKeywordPopup");
- ephy_bookmarks_editor_update_menu (editor, view);
+ ephy_bookmarks_editor_update_menu (editor);
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
gtk_get_current_event_time ());
}
@@ -831,7 +824,7 @@ static void
menu_activate_cb (EphyNodeView *view,
EphyBookmarksEditor *editor)
{
- ephy_bookmarks_editor_update_menu (editor, NULL);
+ ephy_bookmarks_editor_update_menu (editor);
}
static void