forked from AuroraMiddleware/gtk
open-with: don't override the class signal handler, as it's RUN_LAST
And explain why in a comment; basically we want our handler to always run before client code.
This commit is contained in:
parent
c8ea415873
commit
1d67b4ac26
@ -293,7 +293,8 @@ emit_application_selected (GtkOpenWithDialog *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_open_with_dialog_response (GtkDialog *dialog,
|
gtk_open_with_dialog_response (GtkDialog *dialog,
|
||||||
gint response_id)
|
gint response_id,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GAppInfo *application;
|
GAppInfo *application;
|
||||||
GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (dialog);
|
GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (dialog);
|
||||||
@ -346,6 +347,9 @@ gtk_open_with_dialog_response (GtkDialog *dialog,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* don't forward this signal to other clients in this case */
|
||||||
|
g_signal_stop_emission_by_name (self, "response");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
@ -1058,7 +1062,6 @@ static void
|
|||||||
gtk_open_with_dialog_class_init (GtkOpenWithDialogClass *klass)
|
gtk_open_with_dialog_class_init (GtkOpenWithDialogClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GtkDialogClass *dialog_class;
|
|
||||||
|
|
||||||
gobject_class = G_OBJECT_CLASS (klass);
|
gobject_class = G_OBJECT_CLASS (klass);
|
||||||
gobject_class->finalize = gtk_open_with_dialog_finalize;
|
gobject_class->finalize = gtk_open_with_dialog_finalize;
|
||||||
@ -1066,9 +1069,6 @@ gtk_open_with_dialog_class_init (GtkOpenWithDialogClass *klass)
|
|||||||
gobject_class->get_property = gtk_open_with_dialog_get_property;
|
gobject_class->get_property = gtk_open_with_dialog_get_property;
|
||||||
gobject_class->constructed = gtk_open_with_dialog_constructed;
|
gobject_class->constructed = gtk_open_with_dialog_constructed;
|
||||||
|
|
||||||
dialog_class = GTK_DIALOG_CLASS (klass);
|
|
||||||
dialog_class->response = gtk_open_with_dialog_response;
|
|
||||||
|
|
||||||
properties[PROP_GFILE] =
|
properties[PROP_GFILE] =
|
||||||
g_param_spec_object ("gfile",
|
g_param_spec_object ("gfile",
|
||||||
P_("A GFile object"),
|
P_("A GFile object"),
|
||||||
@ -1249,6 +1249,12 @@ gtk_open_with_dialog_init (GtkOpenWithDialog *self)
|
|||||||
|
|
||||||
gtk_dialog_set_default_response (GTK_DIALOG (self),
|
gtk_dialog_set_default_response (GTK_DIALOG (self),
|
||||||
GTK_RESPONSE_OK);
|
GTK_RESPONSE_OK);
|
||||||
|
|
||||||
|
/* we can't override the class signal handler here, as it's a RUN_LAST;
|
||||||
|
* we want our signal handler instead to be executed before any user code.
|
||||||
|
*/
|
||||||
|
g_signal_connect (self, "response",
|
||||||
|
G_CALLBACK (gtk_open_with_dialog_response), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user