summaryrefslogtreecommitdiff
path: root/src/progress.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/progress.c')
-rw-r--r--src/progress.c17
1 files changed, 17 insertions, 0 deletions
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);
bgstack15