Drop callbacks for cursor-changed and columns-changed
We don't have special separators any more, so there is no items that can't be deleted.
This commit is contained in:
parent
7f4c4ad287
commit
76ea968e20
2 changed files with 0 additions and 71 deletions
|
@ -383,34 +383,6 @@ midori_bookmarks_delete_clicked_cb (GtkWidget* toolitem,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
midori_bookmarks_cursor_or_row_changed_cb (GtkTreeView* treeview,
|
|
||||||
MidoriBookmarks* bookmarks)
|
|
||||||
{
|
|
||||||
GtkTreeModel* model;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
KatzeItem* item;
|
|
||||||
|
|
||||||
if (!bookmarks->edit)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (katze_tree_view_get_selected_iter (treeview, &model, &iter))
|
|
||||||
{
|
|
||||||
gtk_tree_model_get (model, &iter, 0, &item, -1);
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive (bookmarks->edit, !KATZE_ITEM_IS_SEPARATOR (item));
|
|
||||||
gtk_widget_set_sensitive (bookmarks->delete, TRUE);
|
|
||||||
|
|
||||||
if (item != NULL)
|
|
||||||
g_object_unref (item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive (bookmarks->edit, FALSE);
|
|
||||||
gtk_widget_set_sensitive (bookmarks->delete, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
midori_bookmarks_get_toolbar (MidoriViewable* viewable)
|
midori_bookmarks_get_toolbar (MidoriViewable* viewable)
|
||||||
{
|
{
|
||||||
|
@ -463,8 +435,6 @@ midori_bookmarks_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));
|
||||||
|
|
||||||
midori_bookmarks_cursor_or_row_changed_cb (
|
|
||||||
GTK_TREE_VIEW (bookmarks->treeview), bookmarks);
|
|
||||||
g_signal_connect (bookmarks->edit, "destroy",
|
g_signal_connect (bookmarks->edit, "destroy",
|
||||||
G_CALLBACK (gtk_widget_destroyed), &bookmarks->edit);
|
G_CALLBACK (gtk_widget_destroyed), &bookmarks->edit);
|
||||||
g_signal_connect (bookmarks->delete, "destroy",
|
g_signal_connect (bookmarks->delete, "destroy",
|
||||||
|
@ -984,10 +954,6 @@ midori_bookmarks_init (MidoriBookmarks* bookmarks)
|
||||||
g_object_connect (treeview,
|
g_object_connect (treeview,
|
||||||
"signal::row-activated",
|
"signal::row-activated",
|
||||||
midori_bookmarks_row_activated_cb, bookmarks,
|
midori_bookmarks_row_activated_cb, bookmarks,
|
||||||
"signal::cursor-changed",
|
|
||||||
midori_bookmarks_cursor_or_row_changed_cb, bookmarks,
|
|
||||||
"signal::columns-changed",
|
|
||||||
midori_bookmarks_cursor_or_row_changed_cb, bookmarks,
|
|
||||||
"signal::button-release-event",
|
"signal::button-release-event",
|
||||||
midori_bookmarks_button_release_event_cb, bookmarks,
|
midori_bookmarks_button_release_event_cb, bookmarks,
|
||||||
"signal::key-release-event",
|
"signal::key-release-event",
|
||||||
|
|
|
@ -376,37 +376,6 @@ midori_history_clear_clicked_cb (GtkWidget* toolitem,
|
||||||
|
|
||||||
midori_history_clear_db (history);
|
midori_history_clear_db (history);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
midori_history_cursor_or_row_changed_cb (GtkTreeView* treeview,
|
|
||||||
MidoriHistory* history)
|
|
||||||
{
|
|
||||||
GtkTreeModel* model;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
KatzeItem* item;
|
|
||||||
|
|
||||||
if (!history->bookmark)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (katze_tree_view_get_selected_iter (treeview, &model, &iter))
|
|
||||||
{
|
|
||||||
gboolean is_page;
|
|
||||||
|
|
||||||
gtk_tree_model_get (model, &iter, 0, &item, -1);
|
|
||||||
|
|
||||||
is_page = item && katze_item_get_uri (item);
|
|
||||||
gtk_widget_set_sensitive (history->bookmark, is_page);
|
|
||||||
gtk_widget_set_sensitive (history->delete, TRUE);
|
|
||||||
|
|
||||||
if (item)
|
|
||||||
g_object_unref (item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive (history->bookmark, FALSE);
|
|
||||||
gtk_widget_set_sensitive (history->delete, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -465,8 +434,6 @@ 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_cursor_or_row_changed_cb (
|
|
||||||
GTK_TREE_VIEW (history->treeview), 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",
|
||||||
|
@ -979,10 +946,6 @@ midori_history_init (MidoriHistory* history)
|
||||||
g_object_connect (treeview,
|
g_object_connect (treeview,
|
||||||
"signal::row-activated",
|
"signal::row-activated",
|
||||||
midori_history_row_activated_cb, history,
|
midori_history_row_activated_cb, history,
|
||||||
"signal::cursor-changed",
|
|
||||||
midori_history_cursor_or_row_changed_cb, history,
|
|
||||||
"signal::columns-changed",
|
|
||||||
midori_history_cursor_or_row_changed_cb, history,
|
|
||||||
"signal::button-release-event",
|
"signal::button-release-event",
|
||||||
midori_history_button_release_event_cb, history,
|
midori_history_button_release_event_cb, history,
|
||||||
"signal::key-release-event",
|
"signal::key-release-event",
|
||||||
|
|
Loading…
Reference in a new issue