Enlightenment CVS committal
Author : xcomputerman
Project : e17
Module : apps/entrance
Dir : e17/apps/entrance/src/client
Modified Files:
entrance_session.c entrance_session.h main.c
Log Message:
- Fix non-working -display option for spawner
- Add option to specify a custom config instead of the default
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- entrance_session.c 4 Feb 2004 20:59:35 -0000 1.30
+++ entrance_session.c 16 Feb 2004 01:04:06 -0000 1.31
@@ -34,23 +34,31 @@
* Also Allocates the auth, and parse the config struct
*/
Entrance_Session *
-entrance_session_new(void)
+entrance_session_new(const char *config)
{
Entrance_Session *e;
+ char *db;
+
+ if (config)
+ db = strdup(config);
+ else
+ db = strdup(PACKAGE_CFG_DIR "/entrance_config.db");
e = (Entrance_Session *) malloc(sizeof(struct _Entrance_Session));
memset(e, 0, sizeof(struct _Entrance_Session));
openlog("entrance", LOG_NOWAIT, LOG_DAEMON);
e->auth = entrance_auth_new();
- e->config = entrance_config_parse(PACKAGE_CFG_DIR "/entrance_config.db");
+ e->config = entrance_config_parse(db);
if (!e->config)
{
- fprintf(stderr, "%s\n", PACKAGE_CFG_DIR "/entrance_config.db");
- syslog(LOG_CRIT, "Fatal Error: Unable to read configuration.");
+ fprintf(stderr, "Could not load %s\n", db);
+ syslog(LOG_CRIT, "Fatal Error: Unable to read config file %s.", db);
exit(1);
}
e->session = strdup("");
+
+ free(db);
/* ?
e->theme->path = strdup(theme_path);
*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- entrance_session.h 4 Feb 2004 20:59:35 -0000 1.11
+++ entrance_session.h 16 Feb 2004 01:04:06 -0000 1.12
@@ -28,7 +28,7 @@
typedef struct _Entrance_Session Entrance_Session;
-Entrance_Session *entrance_session_new(void);
+Entrance_Session *entrance_session_new(const char *config);
void entrance_session_ecore_evas_set(Entrance_Session * e, Ecore_Evas * ee);
void entrance_session_free(Entrance_Session * e);
void entrance_session_run(Entrance_Session * e);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- main.c 4 Feb 2004 20:59:35 -0000 1.32
+++ main.c 16 Feb 2004 01:04:06 -0000 1.33
@@ -440,8 +440,11 @@
printf
("---------------------------------------------------------------------------\n");
printf
+ (" -c, --config=CONFIG Specify a custom config file\n");
+ printf
(" -d, --display=DISPLAY Specify which display Entrance should use\n");
- printf(" -h, --help Display this help message\n");
+ printf
+ (" -h, --help Display this help message\n");
printf
(" -g, --geometry=WIDTHxHEIGHT Specify the size of the Entrance window.\n");
printf
@@ -452,7 +455,8 @@
(" either the name of an installed theme, or
an\n");
printf
(" arbitrary path to an eet file (use ./ for\n");
- printf(" the current directory).\n");
+ printf
+ (" the current directory).\n");
printf
(" -T, --test Enable testing mode. This will cause xterm\n");
printf
@@ -467,7 +471,8 @@
("Note: To automatically launch an X server that will be managed, please
use\n");
printf
(" entranced instead of entrance. Entrance requires an existing X
server\n");
- printf(" to run. Run entranced --help for more information.\n\n");
+ printf
+ (" to run. Run entranced --help for more information.\n\n");
exit(0);
}
@@ -512,14 +517,14 @@
{"geometry", 1, 0, 'g'},
{"theme", 1, 0, 't'},
{"test", 0, 0, 'T'},
+ {"config", 1, 0, 'c'},
{0, 0, 0, 0}
};
int g_x = WINW, g_y = WINH;
char *theme = NULL;
+ char *config = NULL;
int fs_en = 1;
- session = entrance_session_new();
-
/* if (argv[1])
snprintf(buf, PATH_MAX, "%s", argv[1]);*/
@@ -533,7 +538,7 @@
{
char *t;
- c = getopt_long(argc, argv, "hd:g:t:T", d_opt, NULL);
+ c = getopt_long(argc, argv, "hd:g:t:Tc:", d_opt, NULL);
if (c == -1)
break;
switch (c)
@@ -587,11 +592,18 @@
_entrance_test_en = 1;
fs_en = 0;
break;
+ case 'c':
+ config = strdup(optarg);
+ break;
default:
entrance_help(argv);
}
}
+ session = entrance_session_new(config);
+ if (config)
+ free(config);
+
#if 1
if (!ecore_x_init(display))
{
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs