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,6 +29,8 @@ | ||
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
32 | +#include <config.h> | ||
33 | + | ||
32 | #include <glib.h> | 34 | #include <glib.h> |
33 | #include <glib/gstdio.h> | 35 | #include <glib/gstdio.h> |
34 | #include "globals.h" | 36 | #include "globals.h" |
@@ -352,7 +354,7 @@ static gboolean startup(GtkWidget *toplevel) | @@ -352,7 +354,7 @@ static gboolean startup(GtkWidget *toplevel) | ||
352 | 354 | ||
353 | int main(int argc, char *argv[]) | 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 | static const gchar * host = NULL; | 358 | static const gchar * host = NULL; |
357 | int rc = 0; | 359 | int rc = 0; |
358 | 360 | ||
@@ -380,7 +382,7 @@ int main(int argc, char *argv[]) | @@ -380,7 +382,7 @@ int main(int argc, char *argv[]) | ||
380 | { "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, N_( "Application name" ), PACKAGE_NAME }, | 382 | { "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, N_( "Application name" ), PACKAGE_NAME }, |
381 | { "datadir", 'd', 0, G_OPTION_ARG_CALLBACK, datadir, N_( "Path to application data files" ), NULL }, | 383 | { "datadir", 'd', 0, G_OPTION_ARG_CALLBACK, datadir, N_( "Path to application data files" ), NULL }, |
382 | #endif // WIN32 | 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 | { "host", 'h', 0, G_OPTION_ARG_STRING, &host, N_( "Host to connect"), NULL }, | 386 | { "host", 'h', 0, G_OPTION_ARG_STRING, &host, N_( "Host to connect"), NULL }, |
385 | { "colors", 'c', 0, G_OPTION_ARG_CALLBACK, optcolors, N_( "Set reported colors (8/16)" ), "16" }, | 387 | { "colors", 'c', 0, G_OPTION_ARG_CALLBACK, optcolors, N_( "Set reported colors (8/16)" ), "16" }, |
386 | { "systype", 't', 0, G_OPTION_ARG_STRING, &systype, N_( "Host system type" ), "S390" }, | 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,7 +548,15 @@ int main(int argc, char *argv[]) | ||
546 | 548 | ||
547 | pw3270_load_plugins(pluginpath); | 549 | pw3270_load_plugins(pluginpath); |
548 | toplevel = pw3270_new(host,systype,syscolors); | 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 | if(toggleset) | 561 | if(toggleset) |
552 | { | 562 | { |