forked from enlightenment/enlightenment
restart on profile set to jump to (and load) the new profile instantly
(saving current config to old profile first). much nicer SVN revision: 16035
This commit is contained in:
parent
9029330e89
commit
ecfe75d378
|
@ -17,6 +17,7 @@ static void _e_config_free(void);
|
|||
static int _e_config_cb_timer(void *data);
|
||||
|
||||
/* local subsystem globals */
|
||||
static int _e_config_save_block = 0;
|
||||
static Ecore_Job *_e_config_save_job = NULL;
|
||||
static char *_e_config_profile = NULL;
|
||||
|
||||
|
@ -977,6 +978,7 @@ e_config_save(void)
|
|||
ecore_job_del(_e_config_save_job);
|
||||
_e_config_save_job = NULL;
|
||||
}
|
||||
_e_config_save_cb(NULL);
|
||||
return e_config_domain_save("e", _e_config_edd, e_config);
|
||||
}
|
||||
|
||||
|
@ -987,7 +989,7 @@ e_config_save_flush(void)
|
|||
{
|
||||
ecore_job_del(_e_config_save_job);
|
||||
_e_config_save_job = NULL;
|
||||
e_config_domain_save("e", _e_config_edd, e_config);
|
||||
_e_config_save_cb(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1081,6 +1083,17 @@ e_config_profile_del(char *prof)
|
|||
E_FREE(homedir);
|
||||
}
|
||||
|
||||
void
|
||||
e_config_save_block_set(int block)
|
||||
{
|
||||
_e_config_save_block = block;
|
||||
}
|
||||
|
||||
int
|
||||
e_config_save_block_get(void)
|
||||
{
|
||||
return _e_config_save_block;
|
||||
}
|
||||
|
||||
void *
|
||||
e_config_domain_load(char *domain, E_Config_DD *edd)
|
||||
|
@ -1110,14 +1123,14 @@ e_config_domain_load(char *domain, E_Config_DD *edd)
|
|||
}
|
||||
|
||||
int
|
||||
e_config_domain_save(char *domain, E_Config_DD *edd, void *data)
|
||||
e_config_profile_save(void)
|
||||
{
|
||||
Eet_File *ef;
|
||||
char buf[4096];
|
||||
char *homedir;
|
||||
int ok = 0;
|
||||
|
||||
/* FIXME: check for other sessions fo E runing */
|
||||
/* FIXME: check for other sessions fo E running */
|
||||
homedir = e_user_homedir_get();
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
|
||||
homedir);
|
||||
|
@ -1128,6 +1141,20 @@ e_config_domain_save(char *domain, E_Config_DD *edd, void *data)
|
|||
strlen(_e_config_profile), 0);
|
||||
eet_close(ef);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
int
|
||||
e_config_domain_save(char *domain, E_Config_DD *edd, void *data)
|
||||
{
|
||||
Eet_File *ef;
|
||||
char buf[4096];
|
||||
char *homedir;
|
||||
int ok = 0;
|
||||
|
||||
if (_e_config_save_block) return 0;
|
||||
/* FIXME: check for other sessions fo E running */
|
||||
homedir = e_user_homedir_get();
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s",
|
||||
homedir, _e_config_profile);
|
||||
ecore_file_mkpath(buf);
|
||||
|
@ -1189,6 +1216,7 @@ e_config_binding_key_match(E_Config_Binding_Key *eb_in)
|
|||
static void
|
||||
_e_config_save_cb(void *data)
|
||||
{
|
||||
e_config_profile_save();
|
||||
e_module_save_all();
|
||||
e_config_domain_save("e", _e_config_edd, e_config);
|
||||
_e_config_save_job = NULL;
|
||||
|
|
|
@ -195,7 +195,11 @@ EAPI Evas_List *e_config_profile_list(void);
|
|||
EAPI void e_config_profile_add(char *prof);
|
||||
EAPI void e_config_profile_del(char *prof);
|
||||
|
||||
EAPI void e_config_save_block_set(int block);
|
||||
EAPI int e_config_save_block_get(void);
|
||||
|
||||
EAPI void *e_config_domain_load(char *domain, E_Config_DD *edd);
|
||||
EAPI int e_config_profile_save(void);
|
||||
EAPI int e_config_domain_save(char *domain, E_Config_DD *edd, void *data);
|
||||
|
||||
EAPI E_Config_Binding_Mouse *e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
|
||||
|
|
|
@ -730,6 +730,7 @@ _e_gadman_client_edit_begin(E_Gadman_Client *gmc)
|
|||
static void
|
||||
_e_gadman_client_edit_end(E_Gadman_Client *gmc)
|
||||
{
|
||||
e_gadman_client_save(gmc);
|
||||
if (gmc->moving) e_move_end();
|
||||
if ((gmc->resizing_l) || (gmc->resizing_r) ||
|
||||
(gmc->resizing_u) || (gmc->resizing_d))
|
||||
|
|
|
@ -4407,8 +4407,12 @@ break;
|
|||
REQ_STRING(params[0], HDL);
|
||||
#elif (TYPE == E_WM_IN)
|
||||
STRING(s, HDL);
|
||||
e_config_save_flush();
|
||||
e_config_profile_set(s);
|
||||
SAVE;
|
||||
e_config_profile_save();
|
||||
e_config_save_block_set(1);
|
||||
restart = 1;
|
||||
ecore_main_loop_quit();
|
||||
END_STRING(s);
|
||||
#elif (TYPE == E_REMOTE_IN)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue