diff --git a/src/bin/e_int_config_theme_import.c b/src/bin/e_int_config_theme_import.c index 138b8a3c7..7ead7b636 100644 --- a/src/bin/e_int_config_theme_import.c +++ b/src/bin/e_int_config_theme_import.c @@ -236,10 +236,12 @@ _theme_import_cb_ok(void *data, void *data2) { Import *import; E_Win *win; + Evas_Object *o; const char *path; const char *file; char *homedir; char buf[4096]; + int is_theme; win = data; import = win->data; @@ -264,8 +266,12 @@ _theme_import_cb_ok(void *data, void *data2) if (!e_util_glob_case_match(file, "*.edj")) return; - if (!edje_file_data_get(import->cfdata->file, - "e/widgets/border/default/border")) + o = edje_object_add(e_win_evas_get(win)); + is_theme = (edje_object_file_set(o, import->cfdata->file, + "e/widgets/border/default/border")); + evas_object_del(o); + + if (!is_theme) { e_util_dialog_show(_("Theme Import Error"), _("Enlightenment was unable to import " @@ -278,7 +284,7 @@ _theme_import_cb_ok(void *data, void *data2) { e_util_dialog_show(_("Theme Import Error"), _("Enlightenment was unable to import" - "the theme
due to a copy error")); + "the theme
due to a copy error.")); } else e_int_config_theme_update(import->parent, buf); diff --git a/src/bin/e_int_config_wallpaper_import.c b/src/bin/e_int_config_wallpaper_import.c index 27eacdafb..8151bbe5c 100644 --- a/src/bin/e_int_config_wallpaper_import.c +++ b/src/bin/e_int_config_wallpaper_import.c @@ -503,6 +503,9 @@ _import_cb_ok(void *data, void *data2) Import *import; E_Win *win; const char *path; + const char *file; + char buf[4096], *homedir; + int is_bg, is_theme; win = data; import = win->data; @@ -512,7 +515,58 @@ _import_cb_ok(void *data, void *data2) if (path) import->cfdata->file = strdup(path); if (import->cfdata->file) { - _import_edj_gen(import); + file = ecore_file_get_file(import->cfdata->file); + if (!e_util_glob_case_match(file, "*.edj")) + _import_edj_gen(import); + else + { + homedir = e_user_homedir_get(); + if (!homedir) return; + snprintf(buf, sizeof(buf), "%s/.e/e/backgrounds/%s", + homedir, file); + E_FREE(homedir); + + Evas_Object *o; + + o = edje_object_add(e_win_evas_get(import->win)); + is_bg = (edje_object_file_set(o, import->cfdata->file, + "e/desktop/background")); + is_theme = + (edje_object_file_set(o, import->cfdata->file, + "e/widgets/border/default/border")); + evas_object_del(o); + + if ((is_bg) && (!is_theme)) + { + if (!ecore_file_cp(import->cfdata->file, buf)) + { + e_int_config_wallpaper_del(win); + e_util_dialog_show(_("Wallpaper Import Error"), + _("Enlightenment was unable to " + "import the wallpaper
due to a " + "copy error")); + return; + } + else + { + e_int_config_wallpaper_update(import->parent, buf); + e_int_config_wallpaper_del(win); + return; + } + } + else + { + e_int_config_wallpaper_del(win); + e_util_dialog_show(_("Wallpaper Import Error"), + _("Enlightenment was unable to " + "import the wallpaper.

" + "Are you sure this is a valid " + "wallpaper?")); + return; + } + + } + e_win_hide(win); return; }