Commit eccf28b262b70117a755e56d166e31b12ab9d01d
1 parent
3b3a59b9
Exists in
master
and in
5 other branches
Argumento --appname passa a mudar o nome do aplicativo direto no gtk no momento …
…em que o parse ocorre e não após o parse de todas as opções
Showing
1 changed file
with
9 additions
and
3 deletions
Show diff stats
src/pw3270/main.c
@@ -99,9 +99,15 @@ static void toplevel_setup(GtkWindow *window) | @@ -99,9 +99,15 @@ static void toplevel_setup(GtkWindow *window) | ||
99 | g_free(name); | 99 | g_free(name); |
100 | } | 100 | } |
101 | 101 | ||
102 | +static gboolean appname(const gchar *option_name, const gchar *value, gpointer data,GError **error) | ||
103 | +{ | ||
104 | + g_set_application_name(value); | ||
105 | + return TRUE; | ||
106 | +} | ||
107 | + | ||
102 | int main(int argc, char *argv[]) | 108 | int main(int argc, char *argv[]) |
103 | { | 109 | { |
104 | - static const gchar * appname = PACKAGE_NAME; | 110 | +// static const gchar * appname = PACKAGE_NAME; |
105 | static const gchar * host = NULL; | 111 | static const gchar * host = NULL; |
106 | int rc = 0; | 112 | int rc = 0; |
107 | 113 | ||
@@ -143,7 +149,7 @@ int main(int argc, char *argv[]) | @@ -143,7 +149,7 @@ int main(int argc, char *argv[]) | ||
143 | { | 149 | { |
144 | static const GOptionEntry app_options[] = | 150 | static const GOptionEntry app_options[] = |
145 | { | 151 | { |
146 | - { "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, N_( "Application name" ), PACKAGE_NAME }, | 152 | + { "appname", 'a', 0, G_OPTION_ARG_CALLBACK, appname, N_( "Application name" ), PACKAGE_NAME }, |
147 | { "host", 'h', 0, G_OPTION_ARG_STRING, &host, N_( "Host to connect"), NULL }, | 153 | { "host", 'h', 0, G_OPTION_ARG_STRING, &host, N_( "Host to connect"), NULL }, |
148 | { NULL } | 154 | { NULL } |
149 | }; | 155 | }; |
@@ -188,7 +194,7 @@ int main(int argc, char *argv[]) | @@ -188,7 +194,7 @@ int main(int argc, char *argv[]) | ||
188 | } | 194 | } |
189 | } | 195 | } |
190 | 196 | ||
191 | - g_set_application_name(appname); | 197 | +// g_set_application_name(appname); |
192 | 198 | ||
193 | rc = initialize(); | 199 | rc = initialize(); |
194 | if(!rc) | 200 | if(!rc) |