Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_config_wallpaper_import.c e_int_config_theme_import.c 


Log Message:
Wallpaper and Theme Import now both work correctly. Cannot Import a theme
into wallpaper, and cannot do a wallpaper into theme.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_wallpaper_import.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_int_config_wallpaper_import.c     1 Sep 2006 17:38:25 -0000       1.20
+++ e_int_config_wallpaper_import.c     2 Sep 2006 04:43:55 -0000       1.21
@@ -503,6 +503,9 @@
    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 @@
    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<br>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.<br><br>"
+                                      "Are you sure this is a valid "
+                                      "wallpaper?"));
+                 return;                 
+              }
+            
+         }
+       
        e_win_hide(win);
        return;
      }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_theme_import.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_int_config_theme_import.c 2 Sep 2006 03:46:17 -0000       1.3
+++ e_int_config_theme_import.c 2 Sep 2006 04:43:55 -0000       1.4
@@ -236,10 +236,12 @@
 {
    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 @@
        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 @@
               {
                  e_util_dialog_show(_("Theme Import Error"),
                                     _("Enlightenment was unable to import"
-                                      "the theme<br>due to a copy error"));
+                                      "the theme<br>due to a copy error."));
               }
             else
               e_int_config_theme_update(import->parent, buf);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to