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);
|
static int _e_config_cb_timer(void *data);
|
||||||
|
|
||||||
/* local subsystem globals */
|
/* local subsystem globals */
|
||||||
|
static int _e_config_save_block = 0;
|
||||||
static Ecore_Job *_e_config_save_job = NULL;
|
static Ecore_Job *_e_config_save_job = NULL;
|
||||||
static char *_e_config_profile = NULL;
|
static char *_e_config_profile = NULL;
|
||||||
|
|
||||||
|
@ -977,6 +978,7 @@ e_config_save(void)
|
||||||
ecore_job_del(_e_config_save_job);
|
ecore_job_del(_e_config_save_job);
|
||||||
_e_config_save_job = NULL;
|
_e_config_save_job = NULL;
|
||||||
}
|
}
|
||||||
|
_e_config_save_cb(NULL);
|
||||||
return e_config_domain_save("e", _e_config_edd, e_config);
|
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);
|
ecore_job_del(_e_config_save_job);
|
||||||
_e_config_save_job = NULL;
|
_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);
|
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 *
|
void *
|
||||||
e_config_domain_load(char *domain, E_Config_DD *edd)
|
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
|
int
|
||||||
e_config_domain_save(char *domain, E_Config_DD *edd, void *data)
|
e_config_profile_save(void)
|
||||||
{
|
{
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
char *homedir;
|
char *homedir;
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
/* FIXME: check for other sessions fo E runing */
|
/* FIXME: check for other sessions fo E running */
|
||||||
homedir = e_user_homedir_get();
|
homedir = e_user_homedir_get();
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
|
snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
|
||||||
homedir);
|
homedir);
|
||||||
|
@ -1128,6 +1141,20 @@ e_config_domain_save(char *domain, E_Config_DD *edd, void *data)
|
||||||
strlen(_e_config_profile), 0);
|
strlen(_e_config_profile), 0);
|
||||||
eet_close(ef);
|
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",
|
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s",
|
||||||
homedir, _e_config_profile);
|
homedir, _e_config_profile);
|
||||||
ecore_file_mkpath(buf);
|
ecore_file_mkpath(buf);
|
||||||
|
@ -1189,6 +1216,7 @@ e_config_binding_key_match(E_Config_Binding_Key *eb_in)
|
||||||
static void
|
static void
|
||||||
_e_config_save_cb(void *data)
|
_e_config_save_cb(void *data)
|
||||||
{
|
{
|
||||||
|
e_config_profile_save();
|
||||||
e_module_save_all();
|
e_module_save_all();
|
||||||
e_config_domain_save("e", _e_config_edd, e_config);
|
e_config_domain_save("e", _e_config_edd, e_config);
|
||||||
_e_config_save_job = NULL;
|
_e_config_save_job = NULL;
|
||||||
|
|
|
@ -182,24 +182,28 @@ struct _E_Config_Desktop_Background
|
||||||
char *file;
|
char *file;
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI int e_config_init(void);
|
EAPI int e_config_init(void);
|
||||||
EAPI int e_config_shutdown(void);
|
EAPI int e_config_shutdown(void);
|
||||||
|
|
||||||
EAPI int e_config_save(void);
|
EAPI int e_config_save(void);
|
||||||
EAPI void e_config_save_flush(void);
|
EAPI void e_config_save_flush(void);
|
||||||
EAPI void e_config_save_queue(void);
|
EAPI void e_config_save_queue(void);
|
||||||
|
|
||||||
EAPI char *e_config_profile_get(void);
|
EAPI char *e_config_profile_get(void);
|
||||||
EAPI void e_config_profile_set(char *prof);
|
EAPI void e_config_profile_set(char *prof);
|
||||||
EAPI Evas_List *e_config_profile_list(void);
|
EAPI Evas_List *e_config_profile_list(void);
|
||||||
EAPI void e_config_profile_add(char *prof);
|
EAPI void e_config_profile_add(char *prof);
|
||||||
EAPI void e_config_profile_del(char *prof);
|
EAPI void e_config_profile_del(char *prof);
|
||||||
|
|
||||||
EAPI void *e_config_domain_load(char *domain, E_Config_DD *edd);
|
EAPI void e_config_save_block_set(int block);
|
||||||
EAPI int e_config_domain_save(char *domain, E_Config_DD *edd, void *data);
|
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);
|
EAPI E_Config_Binding_Mouse *e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
|
||||||
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *eb_in);
|
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *eb_in);
|
||||||
|
|
||||||
extern EAPI E_Config *e_config;
|
extern EAPI E_Config *e_config;
|
||||||
|
|
||||||
|
|
|
@ -730,6 +730,7 @@ _e_gadman_client_edit_begin(E_Gadman_Client *gmc)
|
||||||
static void
|
static void
|
||||||
_e_gadman_client_edit_end(E_Gadman_Client *gmc)
|
_e_gadman_client_edit_end(E_Gadman_Client *gmc)
|
||||||
{
|
{
|
||||||
|
e_gadman_client_save(gmc);
|
||||||
if (gmc->moving) e_move_end();
|
if (gmc->moving) e_move_end();
|
||||||
if ((gmc->resizing_l) || (gmc->resizing_r) ||
|
if ((gmc->resizing_l) || (gmc->resizing_r) ||
|
||||||
(gmc->resizing_u) || (gmc->resizing_d))
|
(gmc->resizing_u) || (gmc->resizing_d))
|
||||||
|
|
|
@ -4407,8 +4407,12 @@ break;
|
||||||
REQ_STRING(params[0], HDL);
|
REQ_STRING(params[0], HDL);
|
||||||
#elif (TYPE == E_WM_IN)
|
#elif (TYPE == E_WM_IN)
|
||||||
STRING(s, HDL);
|
STRING(s, HDL);
|
||||||
|
e_config_save_flush();
|
||||||
e_config_profile_set(s);
|
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);
|
END_STRING(s);
|
||||||
#elif (TYPE == E_REMOTE_IN)
|
#elif (TYPE == E_REMOTE_IN)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue