restart e when language changes AFTER warning dialog is closed

SVN revision: 76011
This commit is contained in:
Mike Blumenkrantz 2012-09-03 13:49:40 +00:00
parent a8bc4ea2eb
commit 5f90c2ab70
1 changed files with 30 additions and 24 deletions

View File

@ -879,37 +879,48 @@ _region_hash_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED_
return 1;
}
static void
_lc_check_del(void *data __UNUSED__)
{
E_Action *a;
a = e_action_find("restart");
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
}
static void
_lc_check(void)
{
char buf[8192];
char buf2[512];
E_Dialog *dia;
buf[0] = 0;
buf2[0] = 0;
if (getenv("LC_CTYPE")) strcat(buf, "<br>LC_CTYPE");
if (getenv("LC_NUMERIC")) strcat(buf, "<br>LC_NUMERIC");
if (getenv("LC_TIME")) strcat(buf, "<br>LC_TIME");
if (getenv("LC_COLLATE")) strcat(buf, "<br>LC_COLLATE");
if (getenv("LC_MONETARY")) strcat(buf, "<br>LC_MONETARY");
if (getenv("LC_MESSAGES")) strcat(buf, "<br>LC_MESSAGES");
if (getenv("LC_ALL")) strcat(buf, "<br>LC_ALL");
if (getenv("LC_CTYPE")) strcat(buf2, "<br>LC_CTYPE");
if (getenv("LC_NUMERIC")) strcat(buf2, "<br>LC_NUMERIC");
if (getenv("LC_TIME")) strcat(buf2, "<br>LC_TIME");
if (getenv("LC_COLLATE")) strcat(buf2, "<br>LC_COLLATE");
if (getenv("LC_MONETARY")) strcat(buf2, "<br>LC_MONETARY");
if (getenv("LC_MESSAGES")) strcat(buf2, "<br>LC_MESSAGES");
if (getenv("LC_ALL")) strcat(buf2, "<br>LC_ALL");
if (buf[0] != 0)
e_util_dialog_show(_("Possible Locale problems"),
_("You have some extra locale environment<br>"
"variables set that may interfere with<br>"
"correct display of your chosen language.<br>"
"If you don't want these affected, use the<br>"
"Environment variable settings to unset them.<br>"
"The variables that may affect you are<br>"
"as follows:<br>"
"%s"), buf);
if (!buf2[0]) return;
snprintf(buf, sizeof(buf), _("You have some extra locale environment<br>"
"variables set that may interfere with<br>"
"correct display of your chosen language.<br>"
"If you don't want these affected, use the<br>"
"Environment variable settings to unset them.<br>"
"The variables that may affect you are<br>"
"as follows:<br>"
"%s"), buf2);
dia = e_util_dialog_internal(_("Possible Locale problems"), buf);
e_object_free_attach_func_set(E_OBJECT(dia), _lc_check_del);
}
static int
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
E_Action *a;
if (cfdata->cur_language)
{
if (e_config->language) eina_stringshare_del(e_config->language);
@ -921,15 +932,12 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
}
e_config_save_queue();
a = e_action_find("restart");
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
return 1;
}
static int
_advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
E_Action *a;
if (cfdata->cur_language)
{
if (e_config->language) eina_stringshare_del(e_config->language);
@ -941,8 +949,6 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda
}
e_config_save_queue();
a = e_action_find("restart");
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
return 1;
}