Commit 4068fee8 authored by Victor Ananjevsky's avatar Victor Ananjevsky

fix options parsing

parent 757e4745
...@@ -243,7 +243,7 @@ entry_create_widget (GtkWidget * dlg) ...@@ -243,7 +243,7 @@ entry_create_widget (GtkWidget * dlg)
if (options.entry_data.entry_text) if (options.entry_data.entry_text)
gtk_entry_set_text (GTK_ENTRY (entry), options.entry_data.entry_text); gtk_entry_set_text (GTK_ENTRY (entry), options.entry_data.entry_text);
if (options.entry_data.hide_text) if (options.common_data.hide_text)
g_object_set (G_OBJECT (entry), "visibility", FALSE, NULL); g_object_set (G_OBJECT (entry), "visibility", FALSE, NULL);
if (options.entry_data.completion) if (options.entry_data.completion)
......
...@@ -295,8 +295,8 @@ static GOptionEntry entry_options[] = { ...@@ -295,8 +295,8 @@ static GOptionEntry entry_options[] = {
N_("Set the entry label"), N_("TEXT") }, N_("Set the entry label"), N_("TEXT") },
{ "entry-text", 0, 0, G_OPTION_ARG_STRING, &options.entry_data.entry_text, { "entry-text", 0, 0, G_OPTION_ARG_STRING, &options.entry_data.entry_text,
N_("Set the entry text"), N_("TEXT") }, N_("Set the entry text"), N_("TEXT") },
{ "hide-text", 0, 0, G_OPTION_ARG_NONE, &options.entry_data.hide_text, { "hide-text", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.common_data.hide_text,
N_("Hide the entry text"), N_("TEXT") }, N_("Hide the entry text"), NULL },
{ "completion", 0, 0, G_OPTION_ARG_NONE, &options.entry_data.completion, { "completion", 0, 0, G_OPTION_ARG_NONE, &options.entry_data.completion,
N_("Use completion instead of combo-box"), NULL }, N_("Use completion instead of combo-box"), NULL },
{ "numeric", 0, 0, G_OPTION_ARG_NONE, &options.entry_data.numeric, { "numeric", 0, 0, G_OPTION_ARG_NONE, &options.entry_data.numeric,
...@@ -540,8 +540,8 @@ static GOptionEntry progress_options[] = { ...@@ -540,8 +540,8 @@ static GOptionEntry progress_options[] = {
N_("Set alignment of bar labels (left, center or right)"), N_("TYPE") }, 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, { "progress-text", 0, 0, G_OPTION_ARG_STRING, &options.progress_data.progress_text,
N_("Set progress text"), N_("TEXT") }, N_("Set progress text"), N_("TEXT") },
{ "hide-text", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.progress_data.show_text, { "hide-text", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.common_data.hide_text,
N_("Show text on progress bar"), NULL }, N_("Hide text on progress bar"), NULL },
{ "pulsate", 0, 0, G_OPTION_ARG_NONE, &options.progress_data.pulsate, { "pulsate", 0, 0, G_OPTION_ARG_NONE, &options.progress_data.pulsate,
N_("Pulsate progress bar"), NULL }, N_("Pulsate progress bar"), NULL },
{ "auto-close", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.progress_data.autoclose, { "auto-close", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.progress_data.autoclose,
...@@ -1499,6 +1499,7 @@ yad_options_init (void) ...@@ -1499,6 +1499,7 @@ yad_options_init (void)
options.common_data.show_hidden = FALSE; options.common_data.show_hidden = FALSE;
options.common_data.quoted_output = FALSE; options.common_data.quoted_output = FALSE;
options.common_data.num_output = FALSE; options.common_data.num_output = FALSE;
options.common_data.hide_text = FALSE;
options.common_data.filters = NULL; options.common_data.filters = NULL;
options.common_data.key = -1; options.common_data.key = -1;
options.common_data.bool_fmt = YAD_BOOL_FMT_UT; options.common_data.bool_fmt = YAD_BOOL_FMT_UT;
...@@ -1541,7 +1542,6 @@ yad_options_init (void) ...@@ -1541,7 +1542,6 @@ yad_options_init (void)
/* Initialize entry data */ /* Initialize entry data */
options.entry_data.entry_text = NULL; options.entry_data.entry_text = NULL;
options.entry_data.entry_label = NULL; options.entry_data.entry_label = NULL;
options.entry_data.hide_text = FALSE;
options.entry_data.completion = FALSE; options.entry_data.completion = FALSE;
options.entry_data.numeric = FALSE; options.entry_data.numeric = FALSE;
options.entry_data.licon = NULL; options.entry_data.licon = NULL;
...@@ -1653,7 +1653,6 @@ yad_options_init (void) ...@@ -1653,7 +1653,6 @@ yad_options_init (void)
options.progress_data.bars = NULL; options.progress_data.bars = NULL;
options.progress_data.watch_bar = 0; options.progress_data.watch_bar = 0;
options.progress_data.progress_text = NULL; options.progress_data.progress_text = NULL;
options.progress_data.show_text = TRUE;
options.progress_data.pulsate = FALSE; options.progress_data.pulsate = FALSE;
options.progress_data.autoclose = FALSE; options.progress_data.autoclose = FALSE;
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
......
...@@ -127,7 +127,7 @@ handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer data) ...@@ -127,7 +127,7 @@ handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer data)
} }
else else
{ {
if (options.progress_data.show_text) if (!options.common_data.hide_text)
gtk_progress_bar_set_text (pb, match); gtk_progress_bar_set_text (pb, match);
} }
g_free (match); g_free (match);
...@@ -280,7 +280,7 @@ progress_create_widget (GtkWidget *dlg) ...@@ -280,7 +280,7 @@ progress_create_widget (GtkWidget *dlg)
/* add progress bar */ /* add progress bar */
w = gtk_progress_bar_new (); w = gtk_progress_bar_new ();
gtk_widget_set_name (w, "yad-progress-widget"); gtk_widget_set_name (w, "yad-progress-widget");
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (w), options.progress_data.show_text); gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (w), !options.common_data.hide_text);
if (p->type != YAD_PROGRESS_PULSE) if (p->type != YAD_PROGRESS_PULSE)
{ {
......
...@@ -277,7 +277,6 @@ typedef struct { ...@@ -277,7 +277,6 @@ typedef struct {
typedef struct { typedef struct {
gchar *entry_text; gchar *entry_text;
gchar *entry_label; gchar *entry_label;
gboolean hide_text;
gboolean completion; gboolean completion;
gboolean numeric; gboolean numeric;
gchar *licon; gchar *licon;
...@@ -407,7 +406,6 @@ typedef struct { ...@@ -407,7 +406,6 @@ typedef struct {
gboolean autokill; gboolean autokill;
#endif #endif
gboolean rtl; gboolean rtl;
gboolean show_text;
gchar *log; gchar *log;
gboolean log_expanded; gboolean log_expanded;
gboolean log_on_top; gboolean log_on_top;
...@@ -463,6 +461,7 @@ typedef struct { ...@@ -463,6 +461,7 @@ typedef struct {
gboolean show_hidden; gboolean show_hidden;
gboolean quoted_output; gboolean quoted_output;
gboolean num_output; gboolean num_output;
gboolean hide_text;
gint icon_size; gint icon_size;
#if GLIB_CHECK_VERSION(2,30,0) #if GLIB_CHECK_VERSION(2,30,0)
GFormatSizeFlags size_fmt; GFormatSizeFlags size_fmt;
......
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