From: Enlightenment S. <no-...@en...> - 2012-11-30 20:02:53
|
Log: elev8: Fix ecore_con error message on startup Summary: - If there was no server running, trying to connect to one showed an error message (ecore_con non-sense internal stuff). So, an option was created to try to connect to a server, and the default is not to connect. - Better use of ecore_get_opt (some code was using, some wasn't. Fixed) Author: ederson <ed...@pr...> Author: mello Date: 2012-11-30 12:02:46 -0800 (Fri, 30 Nov 2012) New Revision: 79945 Trac: http://trac.enlightenment.org/e/changeset/79945 Modified: trunk/PROTO/elev8/src/bin/args.c trunk/PROTO/elev8/src/bin/args.h trunk/PROTO/elev8/src/bin/main.cc Modified: trunk/PROTO/elev8/src/bin/args.c =================================================================== --- trunk/PROTO/elev8/src/bin/args.c 2012-11-30 19:57:59 UTC (rev 79944) +++ trunk/PROTO/elev8/src/bin/args.c 2012-11-30 20:02:46 UTC (rev 79945) @@ -18,6 +18,7 @@ ECORE_GETOPT_STORE_DEF_BOOL(0, "debug", "enable debuggind mode", EINA_TRUE), ECORE_GETOPT_STORE_DEF_BOOL(0, "server", "enable server mode", EINA_TRUE), ECORE_GETOPT_STORE_DEF_BOOL(0, "shutdown", "shutdown elev8 server.", EINA_TRUE), + ECORE_GETOPT_STORE_DEF_BOOL(0, "connect", "run app spawing a elev8 server.", EINA_TRUE), ECORE_GETOPT_HELP('h', "help"), ECORE_GETOPT_LICENSE('l', "license"), ECORE_GETOPT_VERSION('v', "version"), @@ -33,6 +34,7 @@ ECORE_GETOPT_VALUE_BOOL(args->debug), ECORE_GETOPT_VALUE_BOOL(args->server), ECORE_GETOPT_VALUE_BOOL(args->shutdown), + ECORE_GETOPT_VALUE_BOOL(args->connect), ECORE_GETOPT_VALUE_BOOL(args->quit), ECORE_GETOPT_VALUE_BOOL(args->quit), ECORE_GETOPT_VALUE_BOOL(args->quit), Modified: trunk/PROTO/elev8/src/bin/args.h =================================================================== --- trunk/PROTO/elev8/src/bin/args.h 2012-11-30 19:57:59 UTC (rev 79944) +++ trunk/PROTO/elev8/src/bin/args.h 2012-11-30 20:02:46 UTC (rev 79945) @@ -12,6 +12,7 @@ Eina_Bool debug; Eina_Bool server; Eina_Bool shutdown; + Eina_Bool connect; Eina_Bool quit; } elev8_args; Modified: trunk/PROTO/elev8/src/bin/main.cc =================================================================== --- trunk/PROTO/elev8/src/bin/main.cc 2012-11-30 19:57:59 UTC (rev 79944) +++ trunk/PROTO/elev8/src/bin/main.cc 2012-11-30 20:02:46 UTC (rev 79945) @@ -491,15 +491,23 @@ HandleScope handle_scope; - if (!strcmp(argv[1], "--server")) + if (args.server) { daemonize(); server_start(); } - else if (!strcmp(argv[1], "--shutdown")) + else if (args.shutdown) server_shutdown(); + else if (args.connect) + { + script_arg = 2; + server_spawn(script_arg, argc, argv); + } else - server_spawn(script_arg, argc, argv); + { + load_elev8_modules(); + execute_elev8_script(argv[script_arg], argc, argv); + } ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, flush_garbage_collector, NULL); ecore_main_loop_begin(); |