From 3c17a5a8870422b9a9145ff805d6d3bb872dacea Mon Sep 17 00:00:00 2001 From: Huzaifa Sidhpurwala Date: Tue, 23 Feb 2010 18:07:08 +0000 Subject: Bug 593926 - --progress needs a --nocancel option --- src/progress.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/progress.c') diff --git a/src/progress.c b/src/progress.c index bc1c102d..40f91821 100644 --- a/src/progress.c +++ b/src/progress.c @@ -38,6 +38,8 @@ static GIOChannel *channel; static gint pulsate_timeout = -1; static gboolean autokill; +static gboolean no_cancel; +static gboolean auto_close; gint zenity_progress_timeout (gpointer data); gint zenity_progress_pulsate_timeout (gpointer data); @@ -227,6 +229,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) GtkWidget *dialog; GObject *text; GObject *progress_bar; + GObject *cancel_button,*ok_button; zen_data = data; builder = zenity_util_load_ui_file ("zenity_progress_dialog", NULL); @@ -265,6 +268,20 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) autokill = progress_data->autokill; + auto_close = progress_data->autoclose; + ok_button = gtk_builder_get_object (builder, "zenity_progress_ok_button"); + + no_cancel = progress_data->no_cancel; + cancel_button = gtk_builder_get_object (builder, "zenity_progress_cancel_button"); + + if (no_cancel) { + gtk_widget_hide (GTK_WIDGET(cancel_button)); + gtk_window_set_deletable (GTK_WINDOW (dialog), FALSE); + } + + if (no_cancel && auto_close) + gtk_widget_hide(GTK_WIDGET(ok_button)); + zenity_util_show_dialog (dialog); zenity_progress_read_info (progress_data); -- cgit