History panel buttons sensitive with selection
Fixes: https://bugs.launchpad.net/midori/+bug/711482
This commit is contained in:
parent
7c08b7cce5
commit
5d372c116d
2 changed files with 22 additions and 1 deletions
|
@ -434,7 +434,6 @@ midori_bookmarks_delete_clicked_cb (GtkWidget* toolitem,
|
||||||
midori_bookmarks_remove_item_cb, bookmarks);
|
midori_bookmarks_remove_item_cb, bookmarks);
|
||||||
g_object_unref (item);
|
g_object_unref (item);
|
||||||
}
|
}
|
||||||
midori_bookmarks_toolbar_update (bookmarks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
|
|
|
@ -154,6 +154,16 @@ midori_history_format_date (KatzeItem *item)
|
||||||
return sdate;
|
return sdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_history_toolbar_update (MidoriHistory *history)
|
||||||
|
{
|
||||||
|
gboolean selected;
|
||||||
|
|
||||||
|
selected = katze_tree_view_get_selected_iter (
|
||||||
|
GTK_TREE_VIEW (history->treeview), NULL, NULL);
|
||||||
|
gtk_widget_set_sensitive (GTK_WIDGET (history->delete), selected);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_history_remove_item_from_db (MidoriHistory* history,
|
midori_history_remove_item_from_db (MidoriHistory* history,
|
||||||
KatzeItem* item)
|
KatzeItem* item)
|
||||||
|
@ -370,6 +380,7 @@ midori_history_get_toolbar (MidoriViewable* viewable)
|
||||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1);
|
||||||
gtk_widget_show (GTK_WIDGET (toolitem));
|
gtk_widget_show (GTK_WIDGET (toolitem));
|
||||||
history->clear = GTK_WIDGET (toolitem);
|
history->clear = GTK_WIDGET (toolitem);
|
||||||
|
midori_history_toolbar_update (history);
|
||||||
g_signal_connect (history->bookmark, "destroy",
|
g_signal_connect (history->bookmark, "destroy",
|
||||||
G_CALLBACK (gtk_widget_destroyed), &history->bookmark);
|
G_CALLBACK (gtk_widget_destroyed), &history->bookmark);
|
||||||
g_signal_connect (history->delete, "destroy",
|
g_signal_connect (history->delete, "destroy",
|
||||||
|
@ -903,6 +914,12 @@ midori_history_filter_entry_clear_cb (GtkEntry* entry,
|
||||||
gtk_entry_set_text (entry, "");
|
gtk_entry_set_text (entry, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_history_selection_changed_cb (GtkTreeView* treeview,
|
||||||
|
MidoriHistory* history)
|
||||||
|
{
|
||||||
|
midori_history_toolbar_update (history);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_history_init (MidoriHistory* history)
|
midori_history_init (MidoriHistory* history)
|
||||||
|
@ -914,6 +931,7 @@ midori_history_init (MidoriHistory* history)
|
||||||
GtkTreeViewColumn* column;
|
GtkTreeViewColumn* column;
|
||||||
GtkCellRenderer* renderer_pixbuf;
|
GtkCellRenderer* renderer_pixbuf;
|
||||||
GtkCellRenderer* renderer_text;
|
GtkCellRenderer* renderer_text;
|
||||||
|
GtkTreeSelection* selection;
|
||||||
|
|
||||||
/* Create the filter entry */
|
/* Create the filter entry */
|
||||||
entry = gtk_icon_entry_new ();
|
entry = gtk_icon_entry_new ();
|
||||||
|
@ -968,6 +986,10 @@ midori_history_init (MidoriHistory* history)
|
||||||
"signal::popup-menu",
|
"signal::popup-menu",
|
||||||
midori_history_popup_menu_cb, history,
|
midori_history_popup_menu_cb, history,
|
||||||
NULL);
|
NULL);
|
||||||
|
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
|
||||||
|
g_signal_connect_after (selection, "changed",
|
||||||
|
G_CALLBACK (midori_history_selection_changed_cb),
|
||||||
|
history);
|
||||||
gtk_widget_show (treeview);
|
gtk_widget_show (treeview);
|
||||||
gtk_box_pack_start (GTK_BOX (history), treeview, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (history), treeview, TRUE, TRUE, 0);
|
||||||
history->treeview = treeview;
|
history->treeview = treeview;
|
||||||
|
|
Loading…
Reference in a new issue