Commit 77520da9 authored by Victor Ananjevsky's avatar Victor Ananjevsky

some updates in progress dialog. add --hide-text option

parent 9f11bb0a
......@@ -540,8 +540,8 @@ static GOptionEntry progress_options[] = {
N_("Set alignment of bar labels (left, center or right)"), N_("TYPE") },
{ "progress-text", 0, 0, G_OPTION_ARG_STRING, &options.progress_data.progress_text,
N_("Set progress text"), N_("TEXT") },
{ "percentage", 0, 0, G_OPTION_ARG_INT, &options.progress_data.percentage,
N_("Set initial percentage"), N_("PERCENTAGE") },
{ "hide-text", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.progress_data.show_text,
N_("Show text on progress bar"), NULL },
{ "pulsate", 0, 0, G_OPTION_ARG_NONE, &options.progress_data.pulsate,
N_("Pulsate progress bar"), NULL },
{ "auto-close", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.progress_data.autoclose,
......@@ -1653,7 +1653,7 @@ yad_options_init (void)
options.progress_data.bars = NULL;
options.progress_data.watch_bar = 0;
options.progress_data.progress_text = NULL;
options.progress_data.percentage = 0;
options.progress_data.show_text = TRUE;
options.progress_data.pulsate = FALSE;
options.progress_data.autoclose = FALSE;
#ifndef G_OS_WIN32
......
......@@ -126,7 +126,10 @@ handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer data)
gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (progress_log), &end, 0, FALSE, 0, 0);
}
else
gtk_progress_bar_set_text (pb, match);
{
if (options.progress_data.show_text)
gtk_progress_bar_set_text (pb, match);
}
g_free (match);
}
else
......@@ -241,9 +244,12 @@ progress_create_widget (GtkWidget *dlg)
else
bar->type = YAD_PROGRESS_NORMAL;
if (options.progress_data.progress_text)
bar->name = options.progress_data.progress_text;
options.progress_data.bars = g_slist_append (options.progress_data.bars, bar);
nbars = 1;
options.progress_data.watch_bar = 1;
single_mode = TRUE;
......@@ -274,7 +280,7 @@ progress_create_widget (GtkWidget *dlg)
/* add progress bar */
w = gtk_progress_bar_new ();
gtk_widget_set_name (w, "yad-progress-widget");
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (w), TRUE);
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (w), options.progress_data.show_text);
if (p->type != YAD_PROGRESS_PULSE)
{
......
......@@ -406,8 +406,8 @@ typedef struct {
#ifndef G_OS_WIN32
gboolean autokill;
#endif
guint percentage;
gboolean rtl;
gboolean show_text;
gchar *log;
gboolean log_expanded;
gboolean log_on_top;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment