Commit e5905ec3f83ae83dc194c693fd6aa1147c23c241

Authored by Perry Werneck
1 parent 670c6ef2

Fixing default session name.

modules/lib3270
1 -Subproject commit cade562926337035d83a669156313e97152d594a 1 +Subproject commit 39c7b224a1ad48db7a05a8f58c336c602df32f19
modules/libv3270
1 -Subproject commit 4cab09f65489893aa1b0815547485f79251d329a 1 +Subproject commit c9d59970d3a3660a63d76517a5626e83bd5ba74e
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 {