diff --git a/src/calendar.c b/src/calendar.c index 9aaee9f..60931c4 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -85,7 +85,7 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } g_object_unref (builder); diff --git a/src/color.c b/src/color.c index 8f31937..eee68ee 100644 --- a/src/color.c +++ b/src/color.c @@ -64,7 +64,7 @@ void zenity_colorselection (ZenityData *data, ZenityColorData *color_data) if (data->timeout_delay > 0) { g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, - NULL); + dialog); } gtk_main(); diff --git a/src/entry.c b/src/entry.c index d69d918..ce6cda5 100644 --- a/src/entry.c +++ b/src/entry.c @@ -129,7 +129,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main (); diff --git a/src/fileselection.c b/src/fileselection.c index 026bb31..07d85c0 100644 --- a/src/fileselection.c +++ b/src/fileselection.c @@ -136,7 +136,7 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main (); diff --git a/src/forms.c b/src/forms.c index 9ad78de..d6db778 100644 --- a/src/forms.c +++ b/src/forms.c @@ -164,7 +164,7 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data) g_object_unref (builder); if (data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main(); diff --git a/src/msg.c b/src/msg.c index 1a92875..567ee23 100644 --- a/src/msg.c +++ b/src/msg.c @@ -138,7 +138,7 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } g_object_unref (builder); diff --git a/src/password.c b/src/password.c index 2de1a76..219f5f9 100644 --- a/src/password.c +++ b/src/password.c @@ -143,7 +143,7 @@ void zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data if (data->timeout_delay > 0) { g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, - NULL); + dialog); } gtk_main(); } diff --git a/src/progress.c b/src/progress.c index 29814d9..2533aa1 100644 --- a/src/progress.c +++ b/src/progress.c @@ -286,7 +286,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) zenity_progress_read_info (progress_data); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main (); diff --git a/src/scale.c b/src/scale.c index c0d25d1..d6cc340 100644 --- a/src/scale.c +++ b/src/scale.c @@ -92,7 +92,7 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } g_object_unref (builder); diff --git a/src/text.c b/src/text.c index b8bf42e..147e706 100644 --- a/src/text.c +++ b/src/text.c @@ -160,7 +160,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) g_object_unref (builder); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main (); diff --git a/src/tree.c b/src/tree.c index 7b46667..c7477c3 100644 --- a/src/tree.c +++ b/src/tree.c @@ -499,7 +499,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) zenity_util_show_dialog (dialog); if(data->timeout_delay > 0) { - g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL); + g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } gtk_main (); diff --git a/src/util.c b/src/util.c index 7072c25..37845a0 100644 --- a/src/util.c +++ b/src/util.c @@ -411,9 +411,14 @@ zenity_util_show_dialog (GtkWidget *dialog) } gboolean -zenity_util_timeout_handle (void) +zenity_util_timeout_handle (gpointer data) { - gtk_main_quit(); - exit(ZENITY_TIMEOUT); + GtkDialog *dialog = GTK_DIALOG(data); + if(dialog != NULL) + gtk_dialog_response(dialog, GTK_RESPONSE_OK); + else { + gtk_main_quit(); + exit(ZENITY_TIMEOUT); + } return FALSE; } diff --git a/src/util.h b/src/util.h index 2bf154e..7005441 100644 --- a/src/util.h +++ b/src/util.h @@ -28,7 +28,7 @@ void zenity_util_show_help (GError **error); gint zenity_util_return_exit_code (ZenityExitCode value); void zenity_util_show_dialog (GtkWidget *widget); -gboolean zenity_util_timeout_handle (void); +gboolean zenity_util_timeout_handle (gpointer data); G_END_DECLS diff --git a/src/zenity.ui b/src/zenity.ui index 5573bbd..3187d0b 100644 --- a/src/zenity.ui +++ b/src/zenity.ui @@ -1,29 +1,85 @@ - + - + + 100 + 1 + 1 + + + False 5 Calendar selection center dialog - + - + True + False 2 + + + True + False + end + + + gtk-cancel + True + True + True + False + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + True + False + False + True + + + False + False + 1 + + + + + False + True + end + 0 + + True + False 5 6 True + False 6 True + False 0 Select a date from below. True @@ -37,12 +93,15 @@ + True + True 0 True + False 0 C_alendar: True @@ -69,50 +128,10 @@ - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - True - True - True - True - False - True - - - False - False - 1 - - - False - end - 0 + True + 1 @@ -122,67 +141,31 @@ zenity_calendar_ok_button - + + False 5 - Warning + Add a new entry center dialog - + - + True - 14 - - - True - 5 - 12 - - - True - 0 - 0 - gtk-dialog-warning - 6 - - - False - 0 - - - - - True - True - 0 - Are you sure you want to proceed? - True - True - True - - - False - False - 1 - - - - - 1 - - + False + 2 - + True + False end - - gtk-ok + + gtk-cancel True True - True True False + False True @@ -191,56 +174,16 @@ 0 - - - False - end - 0 - - - - - - zenity_warning_ok_button - - - - 5 - Question - center - dialog - - - - True - 14 - - - True - 5 - 12 - - True - 0 - 0 - gtk-dialog-question - 6 - - - False - 0 - - - - + + gtk-ok True True - 0 - Are you sure you want to proceed? - True - True - True + True + True + False + False + True False @@ -249,45 +192,27 @@ - - 1 - - - - - True - end - False + True end 0 - - - - - 5 - Add a new entry - center - dialog - - - - True - 2 True + False 6 True + False 6 True + False 0 _Enter new text: True @@ -305,54 +230,15 @@ False + True 0 - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - True - True - True - True - False - True - - - False - False - 1 - - - False - end - 0 + True + 1 @@ -362,205 +248,69 @@ zenity_entry_ok_button - - 5 - Text View - center - 300 - 200 - dialog - - - - True - 2 - - - True - 5 - - - True - True - automatic - automatic - etched-in - - - True - True - 2 - 2 - False - word - 2 - 2 - textbuffer1 - - - - - 0 - - - - - 1 - - - - - True - end - - - gtk-close - True - True - True - False - True - - - False - False - 0 - - - - - False - end - 0 - - - - - - zenity_text_close_button - - - - 5 - Progress - center - dialog - - - - True - 2 - - - True - 5 - 6 - - - True - 0 - Running... - True - - - False - False - 0 - - - - - True - 0.10000000149 - - - False - False - 1 - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - True - False - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - zenity_progress_cancel_button - zenity_progress_ok_button - - + False 5 Error center dialog - + - + True + False 14 + + + True + False + end + + + gtk-ok + True + True + True + False + False + True + + + False + False + 0 + + + + + False + True + end + 0 + + True + False 6 True + False 5 12 True + False 0 gtk-dialog-error 6 + True + True 0 @@ -582,38 +332,16 @@ - 0 - - - - - 1 - - - - - True - end - - - gtk-ok - True - True - True - False - True - - - False - False + True + True 0 False - end - 0 + True + 1 @@ -622,70 +350,27 @@ zenity_error_ok_button - + + False 5 - Select items from the list - center - 300 - 196 - dialog - + normal - + True - - - True - 5 - 6 - - - True - 0 - Select items from the list below. - True - - - False - False - 0 - - - - - True - True - automatic - automatic - in - - - True - True - True - - - - - 1 - - - - - 1 - - + False + 2 - + True + False end - + gtk-cancel True True - True - False + True + False True @@ -695,12 +380,12 @@ - + gtk-ok True True - True - False + True + False True @@ -712,40 +397,120 @@ False + True end 0 + + + True + False + 0 + + + True + False + 12 + 12 + 6 + + + True + False + 2 + 10 + 6 + + + + + + + + + + + + + True + False + <b>Forms dialog</b> + True + + + + + False + True + 1 + + - zenity_tree_cancel_button - zenity_tree_ok_button + cancelbutton12 + okbutton12 + False 5 Information center dialog - + - + True + False 14 + + + True + False + end + + + gtk-ok + True + True + True + False + False + True + + + False + False + 0 + + + + + False + True + end + 0 + + True + False 5 12 True + False 0 gtk-dialog-info 6 + True + True 0 @@ -766,34 +531,10 @@ - - 1 - - - - - True - end - - - gtk-ok - True - True - True - False - True - - - False - False - 0 - - - False - end - 0 + True + 1 @@ -802,28 +543,77 @@ zenity_info_ok_button - - True + + False 5 - Adjust the scale value - 300 - 100 + Progress + center dialog - + - + True - - + False + 2 + + True + False + end + + + gtk-cancel + True + True + True + False + False + True + + + False + False + 0 + + + + + gtk-ok + True + False + True + True + True + False + False + True + + + False + False + 1 + + + + + False + True + end + 0 + + + + + True + False 5 6 - + True + False 0 - 4 - Adjust the scale value + Running... True @@ -833,26 +623,120 @@ - + True - True - discontinuous - adjustment1 - 0 - right + False + 0.10000000149 + False + False 1 + False + True 1 + + + + zenity_progress_cancel_button + zenity_progress_ok_button + + + + False + 5 + Question + center + dialog + + + + True + False + 14 - + True + False + end + + + False + True + end + 0 + + + + + True + False + 5 + 12 + + + True + False + 0 + 0 + gtk-dialog-question + 6 + + + False + True + 0 + + + + + True + True + 0 + Are you sure you want to proceed? + True + True + True + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + 5 + Adjust the scale value + 300 + 100 + dialog + + + + True + False + + + True + False end @@ -861,6 +745,7 @@ True True False + False True @@ -876,6 +761,7 @@ True True False + False True @@ -887,10 +773,53 @@ False + True end 0 + + + True + False + 5 + 6 + + + True + False + 0 + 4 + Adjust the scale value + True + + + False + False + 0 + + + + + True + True + adjustment1 + 0 + right + + + True + True + 1 + + + + + False + True + 1 + + @@ -898,67 +827,118 @@ okbutton1 - - 100 - 1 - 1 - - - + + False 5 - normal + Text View + center + 300 + 200 + dialog + - + True + False 2 - - + + True - 0 + False + end - + + gtk-close True - 12 - 12 - 6 - - - True - 2 - 10 - 6 - - - - - - - - - - - - - True - <b>Forms dialog</b> - True + True + True + False + False + True + + False + False + 0 + + False + True + end + 0 + + + + + True + False + 5 + + + True + True + etched-in + + + True + True + 2 + 2 + False + word + 2 + 2 + textbuffer1 + + + + + True + True + 0 + + + + + True + True 1 + + + + zenity_text_close_button + + + + False + 5 + Select items from the list + center + 300 + 196 + dialog + + + + True + False - + True + False end - + gtk-cancel True True - True + True + False + False True @@ -968,11 +948,13 @@ - + gtk-ok True True - True + True + False + False True @@ -984,15 +966,157 @@ False + True end 0 + + + True + False + 5 + 6 + + + True + False + 0 + Select items from the list below. + True + + + False + False + 0 + + + + + True + True + in + + + True + True + True + + + + + + + + True + True + 1 + + + + + False + True + 1 + + - cancelbutton12 - okbutton12 + zenity_tree_cancel_button + zenity_tree_ok_button + + + + False + 5 + Warning + center + dialog + + + + True + False + 14 + + + True + False + end + + + gtk-ok + True + True + True + True + False + False + True + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + 5 + 12 + + + True + False + 0 + 0 + gtk-dialog-warning + 6 + + + False + True + 0 + + + + + True + True + 0 + Are you sure you want to proceed? + True + True + True + + + False + False + 1 + + + + + False + True + 1 + + + + + + zenity_warning_ok_button