Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_apps.c e_int_config_modules.c e_module.c 


Log Message:
module.desktop almost working, but e_module_dialog_show has issues with
it.  Probably something silly.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -3 -r1.163 -r1.164
--- e_apps.c    2 Sep 2006 04:20:10 -0000       1.163
+++ e_apps.c    2 Sep 2006 11:58:53 -0000       1.164
@@ -1536,35 +1536,60 @@
    return ok;
 }
 
+static Evas_Object *
+_e_app_icon_path_add(Evas *evas, E_App *a)
+{
+   Evas_Object *o;
+   char *ext;
+
+   o = e_icon_add(evas);
+   ext = strrchr(a->icon_path, '.');
+   if (ext)
+      {
+         if (strcmp(ext, ".edj") == 0)
+            e_icon_file_edje_set(o, a->icon_path, "icon");
+         else
+            e_icon_file_set(o, a->icon_path);
+      }
+   else
+      e_icon_file_set(o, a->icon_path);
+   e_icon_fill_inside_set(o, 1);
+   return o;
+}
+
+
 EAPI Evas_Object *
 e_app_icon_add(Evas *evas, E_App *a)
 {
    Evas_Object *o;
    
-   o = edje_object_add(evas);
-   if (!e_util_edje_icon_list_set(o, a->icon_class))
+   if (a->icon_path)
+      o = _e_app_icon_path_add(evas, a);
+   else
       {
-         if (edje_object_file_set(o, a->path, "icon"))
-           {
-              ;  /* It's a bit more obvious this way. */
-           }
-         else if (a->icon_class)   /* If that fails, then this might be an FDO 
icon. */
-           {
-              char *v;
+         o = edje_object_add(evas);
+         if (!e_util_edje_icon_list_set(o, a->icon_class))
+            {
+               if (edje_object_file_set(o, a->path, "icon"))
+                 {
+                    ;  /* It's a bit more obvious this way. */
+                 }
+               else if (a->icon_class)   /* If that fails, then this might be 
an FDO icon. */
+                 {
+                    char *v;
 
-              /* FIXME: Use a real icon size. */
-              v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, 
e_config->icon_theme);
-              if (v)
-                 a->icon_path = evas_stringshare_add(v);
-           }
+                    /* FIXME: Use a real icon size. */
+                    v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, 
e_config->icon_theme);
+                    if (v)
+                       a->icon_path = evas_stringshare_add(v);
+                 }
 
-         if (a->icon_path)
-           {
-              /* Free the aborted object first. */
-               if (o) evas_object_del(o);
-              o = e_icon_add(evas);
-              e_icon_file_set(o, a->icon_path);
-              e_icon_fill_inside_set(o, 1);
+               if (a->icon_path)
+                  {
+                     /* Free the aborted object first. */
+                     if (o)   evas_object_del(o);
+                     o = _e_app_icon_path_add(evas, a);
+                  }
             }
       }
 
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_modules.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- e_int_config_modules.c      14 Aug 2006 15:22:45 -0000      1.39
+++ e_int_config_modules.c      2 Sep 2006 11:58:53 -0000       1.40
@@ -264,13 +264,14 @@
               {
                  if (m->enabled) cm->state = MOD_ENABLED;
               }
-            snprintf(buf, sizeof(buf), "%s/module.eap", cm->path);
-            
+            snprintf(buf, sizeof(buf), "%s/module.desktop", cm->path);
+            if (!ecore_file_exists(buf))
+               snprintf(buf, sizeof(buf), "%s/module.eap", cm->path);
+
             a = e_app_new(buf, 0);
             if (a)
               {
-                 oc = edje_object_add(evas);
-                 edje_object_file_set(oc, buf, "icon");
+                 oc = e_app_icon_add(evas, a);
                  e_widget_ilist_append(ilist, oc, a->name, NULL, NULL, 
cm->name);
                  e_object_unref(E_OBJECT(a));
               }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_module.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -3 -r1.66 -r1.67
--- e_module.c  2 Sep 2006 10:01:55 -0000       1.66
+++ e_module.c  2 Sep 2006 11:58:53 -0000       1.67
@@ -379,9 +379,11 @@
           {
               E_App *app;
 
+printf("e_module_dialog_show() - Trying %s\n", eap);
               app = e_app_new(eap, 0);
              if (app)
                 {
+printf("e_module_dialog_show() - Trying %s, and it exists.\n", eap);
                    dia->icon_object = e_app_icon_add(e_win_evas_get(dia->win), 
app);
                     edje_extern_object_min_size_set(dia->icon_object, 64, 64);
                     edje_object_part_swallow(dia->bg_object, "icon_swallow", 
dia->icon_object);
@@ -393,10 +395,14 @@
           {
              snprintf(eap, sizeof(eap), "%s/module.edj", e_module_dir_get(m));
              if (ecore_file_exists(eap))
-                _e_module_dialog_icon_set(dia, eap);
+                {
+printf("e_module_dialog_show() - Trying %s\n", eap);
+                   _e_module_dialog_icon_set(dia, eap);
+                }
              else
                 {
                    snprintf(eap, sizeof(eap), "%s/module.eap", 
e_module_dir_get(m));
+printf("e_module_dialog_show() - Trying %s\n", eap);
                    _e_module_dialog_icon_set(dia, eap);
                 }
           }



-------------------------------------------------------------------------
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