Bug 651948 - zenity list does not return default value when timeout is over
This commit is contained in:
parent
2fa457ed44
commit
b39ad33c35
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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 ();
|
||||
|
@ -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 ();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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 ();
|
||||
|
@ -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);
|
||||
|
@ -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 ();
|
||||
|
@ -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 ();
|
||||
|
11
src/util.c
11
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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
1234
src/zenity.ui
1234
src/zenity.ui
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user