diff options
author | Huzaifa Sidhpurwala <huzaifas@redhat.com> | 2010-02-23 18:07:08 +0000 |
---|---|---|
committer | Lucas Rocha <lucasr@litl.com> | 2010-02-23 18:07:08 +0000 |
commit | 3c17a5a8870422b9a9145ff805d6d3bb872dacea (patch) | |
tree | 3d3a29dbe901def04853a35e15528ad18a1a3a0e /src/progress.c | |
parent | 078ff023621c57c7287a4978bf944d812481c82c (diff) |
Bug 593926 - --progress needs a --nocancel option
Diffstat (limited to 'src/progress.c')
-rw-r--r-- | src/progress.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/progress.c b/src/progress.c index bc1c102..40f9182 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); |