diff options
author | Glynn Foster <glynn.foster@sun.com> | 2005-04-20 03:00:57 +0000 |
---|---|---|
committer | Glynn Foster <gman@src.gnome.org> | 2005-04-20 03:00:57 +0000 |
commit | 403c8104aefc11954398106ab4fa39f9a79233c6 (patch) | |
tree | e3da420235ef0d0e915bf1077dc4bdc27cb1d8dc | |
parent | 6e6eeaf79c01b6cc755b57dac7e7ff2d36038316 (diff) |
Clean up the code a little bit.
2005-04-20 Glynn Foster <glynn.foster@sun.com>
* src/entry.c, src/option.c, src/zenity.h: Clean
up the code a little bit.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/entry.c | 5 | ||||
-rw-r--r-- | src/option.c | 14 | ||||
-rw-r--r-- | src/zenity.h | 2 |
4 files changed, 16 insertions, 10 deletions
@@ -1,5 +1,10 @@ 2005-04-20 Glynn Foster <glynn.foster@sun.com> + * src/entry.c, src/option.c, src/zenity.h: Clean + up the code a little bit. + +2005-04-20 Glynn Foster <glynn.foster@sun.com> + * src/msg.c, src/option.c, src/zenity.h: Bug fix for #149290, based on contributions from Timo Aaltonen, Lucas Rocha, and Carlos Parra. diff --git a/src/entry.c b/src/entry.c index 46672f8..2d92f2d 100644 --- a/src/entry.c +++ b/src/entry.c @@ -72,12 +72,13 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) if (entry_data->entry_text) gtk_entry_set_text (GTK_ENTRY (entry), entry_data->entry_text); - if (!entry_data->visible) - g_object_set (G_OBJECT (entry), "visibility", entry_data->visible, NULL); + if (entry_data->hide_text) + g_object_set (G_OBJECT (entry), "visibility", FALSE, NULL); gtk_label_set_mnemonic_widget (GTK_LABEL (text), entry); zenity_util_show_dialog (dialog); + gtk_main (); } diff --git a/src/option.c b/src/option.c index 0835912..44fd74a 100644 --- a/src/option.c +++ b/src/option.c @@ -46,7 +46,7 @@ gchar *zenity_calendar_date_format; /* Entry Dialog Options */ gboolean zenity_entry_active; gchar *zenity_entry_entry_text; -gboolean zenity_entry_visible; +gboolean zenity_entry_hide_text; /* Error Dialog Options */ gboolean zenity_error_active; @@ -225,7 +225,7 @@ GOptionEntry entry_options[] = { '\0', 0, G_OPTION_ARG_NONE, - &zenity_entry_visible, + &zenity_entry_hide_text, N_("Hide the entry text"), NULL }, @@ -770,7 +770,7 @@ zenity_entry_pre_callback (GOptionContext *context, { zenity_entry_active = FALSE; zenity_entry_entry_text = NULL; - zenity_entry_visible = FALSE; + zenity_entry_hide_text = FALSE; return TRUE; } @@ -979,14 +979,14 @@ zenity_entry_post_callback (GOptionContext *context, if (results->mode == MODE_ENTRY) { results->entry_data->dialog_text = zenity_general_dialog_text; results->entry_data->entry_text = zenity_entry_entry_text; - results->entry_data->visible = !zenity_entry_visible; + results->entry_data->hide_text= zenity_entry_hide_text; } else { if (zenity_entry_entry_text) zenity_option_error (zenity_option_get_name (entry_options, &zenity_entry_entry_text), ERROR_SUPPORT); - if (zenity_entry_visible) - zenity_option_error (zenity_option_get_name (entry_options, &zenity_entry_visible), + if (zenity_entry_hide_text) + zenity_option_error (zenity_option_get_name (entry_options, &zenity_entry_hide_text), ERROR_SUPPORT); } @@ -1373,7 +1373,7 @@ zenity_option_error (gchar *string, ZenityError error) { switch (error) { case ERROR_SYNTAX: - g_printerr (_("Syntax error\n")); + g_printerr (_("This option is not available. Please see --help for all possible usages.\n")); zenity_option_free (); exit (-1); case ERROR_SUPPORT: diff --git a/src/zenity.h b/src/zenity.h index 0f821a4..7ab47cb 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -71,7 +71,7 @@ typedef struct { typedef struct { gchar *dialog_text; gchar *entry_text; - gboolean visible; + gboolean hide_text; } ZenityEntryData; typedef struct { |