Commit e5905ec3f83ae83dc194c693fd6aa1147c23c241
1 parent
670c6ef2
Exists in
master
and in
5 other branches
Fixing default session name.
Showing
3 changed files
with
15 additions
and
5 deletions
Show diff stats
modules/lib3270
modules/libv3270
src/pw3270/main.c
| ... | ... | @@ -29,6 +29,8 @@ |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | +#include <config.h> | |
| 33 | + | |
| 32 | 34 | #include <glib.h> |
| 33 | 35 | #include <glib/gstdio.h> |
| 34 | 36 | #include "globals.h" |
| ... | ... | @@ -352,7 +354,7 @@ static gboolean startup(GtkWidget *toplevel) |
| 352 | 354 | |
| 353 | 355 | int main(int argc, char *argv[]) |
| 354 | 356 | { |
| 355 | - static const gchar * session_name = PACKAGE_NAME; | |
| 357 | + static const gchar * session_name = NULL; | |
| 356 | 358 | static const gchar * host = NULL; |
| 357 | 359 | int rc = 0; |
| 358 | 360 | |
| ... | ... | @@ -380,7 +382,7 @@ int main(int argc, char *argv[]) |
| 380 | 382 | { "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, N_( "Application name" ), PACKAGE_NAME }, |
| 381 | 383 | { "datadir", 'd', 0, G_OPTION_ARG_CALLBACK, datadir, N_( "Path to application data files" ), NULL }, |
| 382 | 384 | #endif // WIN32 |
| 383 | - { "session", 's', 0, G_OPTION_ARG_STRING, &session_name, N_( "Session name" ), PACKAGE_NAME }, | |
| 385 | + { "session", 's', 0, G_OPTION_ARG_STRING, &session_name, N_( "Session name" ), NULL }, | |
| 384 | 386 | { "host", 'h', 0, G_OPTION_ARG_STRING, &host, N_( "Host to connect"), NULL }, |
| 385 | 387 | { "colors", 'c', 0, G_OPTION_ARG_CALLBACK, optcolors, N_( "Set reported colors (8/16)" ), "16" }, |
| 386 | 388 | { "systype", 't', 0, G_OPTION_ARG_STRING, &systype, N_( "Host system type" ), "S390" }, |
| ... | ... | @@ -546,7 +548,15 @@ int main(int argc, char *argv[]) |
| 546 | 548 | |
| 547 | 549 | pw3270_load_plugins(pluginpath); |
| 548 | 550 | toplevel = pw3270_new(host,systype,syscolors); |
| 549 | - pw3270_set_session_name(toplevel,session_name); | |
| 551 | + | |
| 552 | + if(session_name) | |
| 553 | + { | |
| 554 | + pw3270_set_session_name(toplevel,session_name); | |
| 555 | + } | |
| 556 | + else | |
| 557 | + { | |
| 558 | + pw3270_set_session_name(toplevel,g_get_application_name()); | |
| 559 | + } | |
| 550 | 560 | |
| 551 | 561 | if(toggleset) |
| 552 | 562 | { | ... | ... |