mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-23 20:30:15 +00:00
Some cleanups to the GtkDialog code: (#170746, Morten Welinder) Simplify,
2005-03-23 Matthias Clasen <mclasen@redhat.com> Some cleanups to the GtkDialog code: (#170746, Morten Welinder) * gtk/gtkdialog.c (action_widget_activated): Simplify, use _gtk_dialog_get_response_for_widget. (gtk_dialog_add_action_widget): Use the correct signal id for non-buttons. (gtk_dialog_set_response_sensitive): (gtk_dialog_set_default_response): Use get_response_data. (gtk_dialog_run): Don't disconnect the signals if the dialog was destroyed while running.
This commit is contained in:
parent
edc3b13575
commit
c43673f17f
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2005-03-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Some cleanups to the GtkDialog code: (#170746,
|
||||
Morten Welinder)
|
||||
* gtk/gtkdialog.c (action_widget_activated): Simplify,
|
||||
use _gtk_dialog_get_response_for_widget.
|
||||
(gtk_dialog_add_action_widget): Use the correct signal
|
||||
id for non-buttons.
|
||||
(gtk_dialog_set_response_sensitive):
|
||||
(gtk_dialog_set_default_response): Use get_response_data.
|
||||
(gtk_dialog_run): Don't disconnect the signals if the
|
||||
dialog was destroyed while running.
|
||||
|
||||
Tue Mar 22 14:16:31 2005 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_set_bookmark_label):
|
||||
|
@ -1,3 +1,16 @@
|
||||
2005-03-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Some cleanups to the GtkDialog code: (#170746,
|
||||
Morten Welinder)
|
||||
* gtk/gtkdialog.c (action_widget_activated): Simplify,
|
||||
use _gtk_dialog_get_response_for_widget.
|
||||
(gtk_dialog_add_action_widget): Use the correct signal
|
||||
id for non-buttons.
|
||||
(gtk_dialog_set_response_sensitive):
|
||||
(gtk_dialog_set_default_response): Use get_response_data.
|
||||
(gtk_dialog_run): Don't disconnect the signals if the
|
||||
dialog was destroyed while running.
|
||||
|
||||
Tue Mar 22 14:16:31 2005 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_set_bookmark_label):
|
||||
|
@ -1,3 +1,16 @@
|
||||
2005-03-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Some cleanups to the GtkDialog code: (#170746,
|
||||
Morten Welinder)
|
||||
* gtk/gtkdialog.c (action_widget_activated): Simplify,
|
||||
use _gtk_dialog_get_response_for_widget.
|
||||
(gtk_dialog_add_action_widget): Use the correct signal
|
||||
id for non-buttons.
|
||||
(gtk_dialog_set_response_sensitive):
|
||||
(gtk_dialog_set_default_response): Use get_response_data.
|
||||
(gtk_dialog_run): Don't disconnect the signals if the
|
||||
dialog was destroyed while running.
|
||||
|
||||
Tue Mar 22 14:16:31 2005 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_system_set_bookmark_label):
|
||||
|
@ -553,18 +553,9 @@ get_response_data (GtkWidget *widget,
|
||||
static void
|
||||
action_widget_activated (GtkWidget *widget, GtkDialog *dialog)
|
||||
{
|
||||
ResponseData *ad;
|
||||
gint response_id;
|
||||
|
||||
g_return_if_fail (GTK_IS_DIALOG (dialog));
|
||||
|
||||
response_id = GTK_RESPONSE_NONE;
|
||||
|
||||
ad = get_response_data (widget, TRUE);
|
||||
|
||||
g_assert (ad != NULL);
|
||||
|
||||
response_id = ad->response_id;
|
||||
response_id = _gtk_dialog_get_response_for_widget (dialog, widget);
|
||||
|
||||
gtk_dialog_response (dialog, response_id);
|
||||
}
|
||||
@ -588,7 +579,7 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
|
||||
gint response_id)
|
||||
{
|
||||
ResponseData *ad;
|
||||
gint signal_id = 0;
|
||||
guint signal_id;
|
||||
|
||||
g_return_if_fail (GTK_IS_DIALOG (dialog));
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
@ -600,7 +591,7 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
|
||||
if (GTK_IS_BUTTON (child))
|
||||
signal_id = g_signal_lookup ("clicked", GTK_TYPE_BUTTON);
|
||||
else
|
||||
signal_id = GTK_WIDGET_GET_CLASS (child)->activate_signal != 0;
|
||||
signal_id = GTK_WIDGET_GET_CLASS (child)->activate_signal;
|
||||
|
||||
if (signal_id)
|
||||
{
|
||||
@ -742,8 +733,7 @@ gtk_dialog_set_response_sensitive (GtkDialog *dialog,
|
||||
while (tmp_list != NULL)
|
||||
{
|
||||
GtkWidget *widget = tmp_list->data;
|
||||
ResponseData *rd = g_object_get_data (G_OBJECT (widget),
|
||||
"gtk-dialog-response-data");
|
||||
ResponseData *rd = get_response_data (widget, FALSE);
|
||||
|
||||
if (rd && rd->response_id == response_id)
|
||||
gtk_widget_set_sensitive (widget, setting);
|
||||
@ -778,8 +768,7 @@ gtk_dialog_set_default_response (GtkDialog *dialog,
|
||||
while (tmp_list != NULL)
|
||||
{
|
||||
GtkWidget *widget = tmp_list->data;
|
||||
ResponseData *rd = g_object_get_data (G_OBJECT (widget),
|
||||
"gtk-dialog-response-data");
|
||||
ResponseData *rd = get_response_data (widget, FALSE);
|
||||
|
||||
if (rd && rd->response_id == response_id)
|
||||
gtk_widget_grab_default (widget);
|
||||
@ -985,7 +974,7 @@ run_destroy_handler (GtkDialog *dialog, gpointer data)
|
||||
gint
|
||||
gtk_dialog_run (GtkDialog *dialog)
|
||||
{
|
||||
RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL };
|
||||
RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL, FALSE };
|
||||
gboolean was_modal;
|
||||
gulong response_handler;
|
||||
gulong unmap_handler;
|
||||
@ -1036,7 +1025,6 @@ gtk_dialog_run (GtkDialog *dialog)
|
||||
g_main_loop_unref (ri.loop);
|
||||
|
||||
ri.loop = NULL;
|
||||
ri.destroyed = FALSE;
|
||||
|
||||
if (!ri.destroyed)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user