diff options
author | Arx Cruz <arxcruz@gnome.org> | 2013-03-05 16:56:24 -0300 |
---|---|---|
committer | Arx Cruz <arxcruz@gnome.org> | 2013-03-05 16:56:24 -0300 |
commit | 1ac1da63f8de626ce10d350be7b29744a743ec95 (patch) | |
tree | 1cefe39f0cd305c6f30807fcf8e87022ff249f48 /src/text.c | |
parent | 3af1e444e63449b97167e428ef99b9b8c7c130dd (diff) | |
download | zenity-1ac1da63f8de626ce10d350be7b29744a743ec95.tar.gz |
But #674881 - Timeout option overriding normal exit code
Diffstat (limited to 'src/text.c')
-rw-r--r-- | src/text.c | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -345,23 +345,34 @@ zenity_text_toggle_button (GtkToggleButton *button, gpointer data) } static void +zenity_text_dialog_output (ZenityData *zen_data) +{ + if (zen_text_data->editable) { + GtkTextIter start, end; + gchar *text; + gtk_text_buffer_get_bounds (zen_text_data->buffer, &start, &end); + text = gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0); + g_print ("%s", text); + g_free (text); + } +} + +static void zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) { ZenityData *zen_data = data; switch (response) { case GTK_RESPONSE_CLOSE: - if (zen_text_data->editable) { - GtkTextIter start, end; - gchar *text; - gtk_text_buffer_get_bounds (zen_text_data->buffer, &start, &end); - text = gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0); - g_print ("%s", text); - g_free (text); - } + zenity_text_dialog_output (zen_data); zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK); break; + case ZENITY_TIMEOUT: + zenity_text_dialog_output (zen_data); + zen_data->exit_code = zenity_util_return_exit_code (ZENITY_TIMEOUT); + break; + default: /* Esc dialog */ zenity_util_exit_code_with_data(ZENITY_ESC, zen_data); |