Treat select-all specially with text views and tree views

Unfortunately select-all signals within Gtk have different
semantics against intuition, so we have to treat text views
and tree views specially to avoid crashing.
This commit is contained in:
Enrico Tröger 2009-05-28 23:01:56 +02:00 committed by Christian Dywan
parent 5aa3ac456d
commit 20a34d0ae7

View file

@ -2021,7 +2021,17 @@ _action_select_all_activate (GtkAction* action,
if (GTK_IS_EDITABLE (widget)) if (GTK_IS_EDITABLE (widget))
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget))) else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget)))
g_signal_emit_by_name (widget, "select-all", TRUE); {
if (GTK_IS_TEXT_VIEW (widget))
g_signal_emit_by_name (widget, "select-all", TRUE);
else if (GTK_IS_TREE_VIEW (widget))
{
gboolean dummy;
g_signal_emit_by_name (widget, "select-all", &dummy);
}
else
g_signal_emit_by_name (widget, "select-all");
}
} }
} }