Bug 651948 - zenity list does not return default value when timeout is over

This commit is contained in:
Arx Cruz 2011-06-16 11:07:58 -03:00
parent 2fa457ed44
commit b39ad33c35
14 changed files with 699 additions and 570 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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 ();

View File

@ -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 ();

View File

@ -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();

View File

@ -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);

View File

@ -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();
}

View File

@ -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 ();

View File

@ -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);

View File

@ -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 ();

View File

@ -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 ();

View File

@ -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;
}

View File

@ -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

File diff suppressed because it is too large Load Diff