Add configuration for login_shell

This commit is contained in:
Markus Törnqvist 2014-01-11 16:21:59 +02:00
parent d802bf6324
commit 2e064a2fe2
2 changed files with 18 additions and 12 deletions

View File

@ -26,7 +26,7 @@ config_init(void)
elm_need_efreet(); elm_need_efreet();
efreet_init(); efreet_init();
eet_eina_stream_data_descriptor_class_set eet_eina_stream_data_descriptor_class_set
(&eddc, sizeof(eddc), "Config", sizeof(Config)); (&eddc, sizeof(eddc), "Config", sizeof(Config));
edd_base = eet_data_descriptor_stream_new(&eddc); edd_base = eet_data_descriptor_stream_new(&eddc);
@ -43,7 +43,7 @@ config_init(void)
(edd_color, Config_Color, "b", b, EET_T_UCHAR); (edd_color, Config_Color, "b", b, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_color, Config_Color, "a", a, EET_T_UCHAR); (edd_color, Config_Color, "a", a, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "version", version, EET_T_INT); (edd_base, Config, "version", version, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
@ -110,6 +110,8 @@ config_init(void)
(edd_base, Config, "cg_height", cg_height, EET_T_INT); (edd_base, Config, "cg_height", cg_height, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "drag_links", drag_links, EET_T_UCHAR); (edd_base, Config, "drag_links", drag_links, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "login_shell", login_shell, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "application_server", application_server, EET_T_UCHAR); (edd_base, Config, "application_server", application_server, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC EET_DATA_DESCRIPTOR_ADD_BASIC
@ -158,7 +160,7 @@ config_save(Config *config, const char *key)
config->font.orig_name = NULL; config->font.orig_name = NULL;
if (config->font.name) config->font.orig_name = eina_stringshare_add(config->font.name); if (config->font.name) config->font.orig_name = eina_stringshare_add(config->font.name);
config->font.orig_bitmap = config->font.bitmap; config->font.orig_bitmap = config->font.bitmap;
cfgdir = _config_home_get(); cfgdir = _config_home_get();
snprintf(buf, sizeof(buf), "%s/terminology/config/standard", cfgdir); snprintf(buf, sizeof(buf), "%s/terminology/config/standard", cfgdir);
ecore_file_mkpath(buf); ecore_file_mkpath(buf);
@ -208,6 +210,7 @@ config_sync(const Config *config_src, Config *config)
config->erase_is_del = config_src->erase_is_del; config->erase_is_del = config_src->erase_is_del;
config->temporary = config_src->temporary; config->temporary = config_src->temporary;
config->custom_geometry = config_src->custom_geometry; config->custom_geometry = config_src->custom_geometry;
config->login_shell = config_src->login_shell;
config->cg_width = config_src->cg_width; config->cg_width = config_src->cg_width;
config->cg_height = config_src->cg_height; config->cg_height = config_src->cg_height;
config->colors_use = config_src->colors_use; config->colors_use = config_src->colors_use;
@ -422,18 +425,18 @@ config_load(const char *key)
0x1367, 0x1367,
0xa60f, 0xa60f,
0x2cfa, 0x2cfa,
'`', '`',
0 0
}; };
char *s; char *s;
int slen = 0; int slen = 0;
config = calloc(1, sizeof(Config)); config = calloc(1, sizeof(Config));
if (config) if (config)
{ {
int i, j; int i, j;
config->version = CONF_VER; config->version = CONF_VER;
config->font.bitmap = EINA_TRUE; config->font.bitmap = EINA_TRUE;
config->font.name = eina_stringshare_add("nexus.pcf"); config->font.name = eina_stringshare_add("nexus.pcf");
@ -471,6 +474,7 @@ config_load(const char *key)
config->xterm_256color = EINA_FALSE; config->xterm_256color = EINA_FALSE;
config->erase_is_del = EINA_FALSE; config->erase_is_del = EINA_FALSE;
config->custom_geometry = EINA_FALSE; config->custom_geometry = EINA_FALSE;
config->login_shell = EINA_FALSE;
config->cg_width = 80; config->cg_width = 80;
config->cg_height = 24; config->cg_height = 24;
config->colors_use = EINA_FALSE; config->colors_use = EINA_FALSE;
@ -479,7 +483,7 @@ config_load(const char *key)
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
{ {
unsigned char rr = 0, gg = 0, bb = 0, aa = 0; unsigned char rr = 0, gg = 0, bb = 0, aa = 0;
colors_standard_get(j, i, &rr, &gg, &bb, &aa); colors_standard_get(j, i, &rr, &gg, &bb, &aa);
config->colors[(j * 12) + i].r = rr; config->colors[(j * 12) + i].r = rr;
config->colors[(j * 12) + i].g = gg; config->colors[(j * 12) + i].g = gg;
@ -500,17 +504,17 @@ Config *
config_fork(Config *config) config_fork(Config *config)
{ {
Config *config2; Config *config2;
config2 = calloc(1, sizeof(Config)); config2 = calloc(1, sizeof(Config));
if (!config2) return NULL; if (!config2) return NULL;
#define CPY(fld) config2->fld = config->fld; #define CPY(fld) config2->fld = config->fld;
#define SCPY(fld) if (config->fld) config2->fld = eina_stringshare_add(config->fld) #define SCPY(fld) if (config->fld) config2->fld = eina_stringshare_add(config->fld)
CPY(version); CPY(version);
SCPY(font.name); SCPY(font.name);
CPY(font.size); CPY(font.size);
CPY(font.bitmap); CPY(font.bitmap);
SCPY(helper.email); SCPY(helper.email);
SCPY(helper.url.general); SCPY(helper.url.general);
SCPY(helper.url.video); SCPY(helper.url.video);
SCPY(helper.url.image); SCPY(helper.url.image);
@ -538,11 +542,12 @@ config_fork(Config *config)
CPY(xterm_256color); CPY(xterm_256color);
CPY(erase_is_del); CPY(erase_is_del);
CPY(custom_geometry); CPY(custom_geometry);
CPY(login_shell);
CPY(cg_width); CPY(cg_width);
CPY(cg_height); CPY(cg_height);
CPY(colors_use); CPY(colors_use);
memcpy(config2->colors, config->colors, sizeof(config->colors)); memcpy(config2->colors, config->colors, sizeof(config->colors));
CPY(temporary); CPY(temporary);
SCPY(config_key); SCPY(config_key);
return config2; return config2;

View File

@ -52,6 +52,7 @@ struct _Config
Eina_Bool erase_is_del; Eina_Bool erase_is_del;
Eina_Bool custom_geometry; Eina_Bool custom_geometry;
Eina_Bool drag_links; Eina_Bool drag_links;
Eina_Bool login_shell;
int cg_width; int cg_width;
int cg_height; int cg_height;
Eina_Bool colors_use; Eina_Bool colors_use;