Merge remote-tracking branch 'mjtorn/login_shell'

Conflicts:
	src/bin/config.c
This commit is contained in:
Boris Faure 2014-01-15 22:03:26 +01:00
commit 2706eef099
4 changed files with 55 additions and 26 deletions

View File

@ -112,6 +112,8 @@ config_init(void)
(edd_base, Config, "cg_height", cg_height, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC
(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
(edd_base, Config, "application_server", application_server, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
@ -221,6 +223,7 @@ config_sync(const Config *config_src, Config *config)
config->erase_is_del = config_src->erase_is_del;
config->temporary = config_src->temporary;
config->custom_geometry = config_src->custom_geometry;
config->login_shell = config_src->login_shell;
config->cg_width = config_src->cg_width;
config->cg_height = config_src->cg_height;
config->colors_use = config_src->colors_use;
@ -515,6 +518,7 @@ config_load(const char *key)
config->xterm_256color = EINA_FALSE;
config->erase_is_del = EINA_FALSE;
config->custom_geometry = EINA_FALSE;
config->login_shell = EINA_FALSE;
config->cg_width = 80;
config->cg_height = 24;
config->colors_use = EINA_FALSE;
@ -588,6 +592,7 @@ config_fork(Config *config)
CPY(xterm_256color);
CPY(erase_is_del);
CPY(custom_geometry);
CPY(login_shell);
CPY(cg_width);
CPY(cg_height);
CPY(colors_use);

View File

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

View File

@ -293,7 +293,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
config = config_fork(sp->term->config);
if (termio_cwd_get(sp->term->term, buf, sizeof(buf))) wdir = buf;
sp2->term = main_term_new(sp->wn, config,
NULL, EINA_FALSE, wdir,
NULL, config->login_shell, wdir,
80, 24, EINA_FALSE);
sp2->terms = eina_list_append(sp2->terms, sp2->term);
_term_resize_track_start(sp2);
@ -367,7 +367,7 @@ main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir)
config = config_fork(sp->term->config);
termio_size_get(sp->term->term, &w, &h);
sp->term = main_term_new(sp->wn, config,
NULL, EINA_FALSE, wdir,
NULL, config->login_shell, wdir,
w, h, EINA_FALSE);
sp->terms = eina_list_append(sp->terms, sp->term);
_term_resize_track_start(sp);
@ -2925,8 +2925,12 @@ elm_main(int argc, char **argv)
}
}
// for now if not set - dont do login shell - later from config
if (login_shell == 0xff) login_shell = EINA_FALSE;
if (login_shell != 0xff)
{
config->login_shell = login_shell;
config->temporary = EINA_TRUE;
}
login_shell = config->login_shell;
remote:
if ((!single) && (config->multi_instance))

View File

@ -252,6 +252,15 @@ _cb_op_behavior_cg_height(void *data, Evas_Object *obj, void *event EINA_UNUSED)
}
}
static void
_cb_op_behavior_login_shell_chg(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
Evas_Object *term = data;
Config *config = termio_config_get(term);
config->login_shell = elm_check_state_get(obj);
config_save(config, NULL);
}
void
options_behavior(Evas_Object *opbox, Evas_Object *term)
{
@ -396,6 +405,16 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
evas_object_smart_callback_add(o, "changed",
_cb_op_behavior_drag_links_chg, term);
o = elm_check_add(bx);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Start as login shell");
elm_check_state_set(o, config->login_shell);
elm_box_pack_end(bx, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_behavior_login_shell_chg, term);
o = elm_check_add(bx);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);