Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_apps.c e_eap_editor.c 


Log Message:
*The icon theme checkbox now works.

*Clean things up a bit.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -3 -r1.187 -r1.188
--- e_apps.c    16 Sep 2006 17:37:05 -0000      1.187
+++ e_apps.c    16 Sep 2006 20:59:40 -0000      1.188
@@ -1355,7 +1355,6 @@
            }
         if (desktop)
            {
-              desktop->eap_name = (char *) a->path;
               desktop->name = (char *) a->name;
               desktop->generic = (char *) a->generic;
               desktop->comment = (char *) a->comment;
@@ -1670,7 +1669,10 @@
 e_app_icon_add(Evas *evas, E_App *a)
 {
    Evas_Object *o = NULL;
-   
+
+#if DEBUG
+printf("e_app_icon_add(%s)   %s   %s   %s\n", a->path, a->icon_class, 
e_config->icon_theme, a->icon_path);
+#endif
    if ((a->icon_path) && (a->icon_path[0] != 0))
      o = _e_app_icon_path_add(evas, a);
    else
@@ -1722,6 +1724,9 @@
    /* e_menu_item_icon_edje_set() just tucks away the params, the actual call 
to edje_object_file_set() happens later. */
    /* e_menu_item_icon_file_set() just tucks away the params, the actual call 
to e_icon_add() happens later. */
 
+#if DEBUG
+printf("e_app_icon_add_to_menu_item(%s)   %s   %s   %s\n", a->path, 
a->icon_class, e_config->icon_theme, a->icon_path);
+#endif
    if ((a->icon_path) && (a->icon_path[0] != 0))
       _e_app_icon_path_add_to_menu_item(mi, a);
    else
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_eap_editor.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- e_eap_editor.c      16 Sep 2006 12:09:29 -0000      1.55
+++ e_eap_editor.c      16 Sep 2006 20:59:40 -0000      1.56
@@ -26,6 +26,7 @@
    int    height;
    int    icon_theme;
    E_App_Edit *editor;
+   Evas_Object *themed;
 };
 
 /* local subsystem functions */
@@ -44,6 +45,7 @@
 static void           _e_eap_edit_cb_icon_select_del(void *obj);
 static void           _e_eap_edit_cb_icon_select_ok(void *data, E_Dialog *dia);
 static void           _e_eap_edit_cb_icon_select_cancel(void *data, E_Dialog 
*dia);
+static void           _cb_files_icon_theme_changed(void *data, Evas_Object 
*obj, void *event_info);
 
 #define IFADD(src, dst) if (src) dst = evas_stringshare_add(src); else dst = 
NULL
 #define IFDEL(src) if (src) evas_stringshare_del(src);  src = NULL;
@@ -139,12 +141,12 @@
    IFDUP(cfdata->editor->eap->image, cfdata->image);
    cfdata->height = cfdata->editor->eap->height;
    cfdata->width = cfdata->editor->eap->width;
-   if (cfdata->image)  cfdata->editor->img_set = 1;
 
+   IFADD(cfdata->editor->eap->path, cfdata->eap.path);
    IFADD(cfdata->editor->eap->icon_class, cfdata->eap.icon_class);
-
-   IFDEL(cfdata->eap.icon_path);
    IFADD(cfdata->editor->eap->icon_path, cfdata->eap.icon_path);
+   if (!cfdata->eap.icon_path)
+      cfdata->icon_theme = 1;
 }
 
 static void *
@@ -205,6 +207,8 @@
    IFDEL(eap->image);
 
    IFADD(data->name, eap->name);
+   IFADD(data->iclass, eap->icon_class);
+   IFADD(data->eap.icon_path, eap->icon_path);
    if (data->exe)
       {
          char *exe;
@@ -218,11 +222,6 @@
            }
          eap->exe = evas_stringshare_add(data->exe);
       }
-   if (data->image)
-      {
-         eap->image = evas_stringshare_add(data->image);
-         eap->icon_class = evas_stringshare_add("");   /* Call this temporary, 
until I reconsider the icon search order. */
-      }
 
    eap->startup_notify = data->startup_notify;
    eap->wait_exit = data->wait_exit;
@@ -256,8 +255,6 @@
    IFADD(data->wclass, eap->win_class);
    IFADD(data->wtitle, eap->win_title);
    IFADD(data->wrole, eap->win_role);
-   IFADD(data->iclass, eap->icon_class);
-   IFADD(data->eap.icon_path, eap->icon_path);
 
    _e_eap_edit_basic_apply_data(cfd, data);
 
@@ -270,7 +267,7 @@
 {
    E_App_Edit *editor;
    E_App *eap;
-   Evas_Object *ol, *o;
+   Evas_Object *ol, *o, *mt;
    Evas_Object *entry;
 
    editor = data->editor;
@@ -288,24 +285,6 @@
      }
    
    editor->img = e_app_icon_add(evas, &(data->eap));
-#if 0
-   if ((editor->img_set) && (data->image))
-     {
-       if (editor->img) evas_object_del(editor->img);
-       editor->img = e_icon_add(evas);
-       e_icon_file_set(editor->img, data->image);
-       e_icon_fill_inside_set(editor->img, 1);
-     }
-   else if (!editor->img)
-     {
-       editor->img = e_icon_add(evas);
-       if (eap->path)
-         {
-            e_icon_file_key_set(editor->img, eap->path, "images/0");
-            e_icon_fill_inside_set(editor->img, 1);
-         }
-     }
-#endif
 
    if (editor->img_widget) evas_object_del(editor->img_widget);
    editor->img_widget = e_widget_button_add(evas, "", NULL,
@@ -316,7 +295,10 @@
                                     0, 0, 1, 1,
                                     1, 1, 1, 1);
 
-   e_widget_frametable_object_append(o, e_widget_check_add(evas, _("Use Icon 
Theme"), &(data->icon_theme)),
+   data->themed = e_widget_check_add(evas, _("Use Icon Theme"), 
&(data->icon_theme));
+   evas_object_smart_callback_add(data->themed, "changed",
+                                 _cb_files_icon_theme_changed, data);
+   e_widget_frametable_object_append(o, data->themed,
                                     1, 0, 1, 1,
                                     1, 1, 1, 1);
 
@@ -494,7 +476,7 @@
    if (!file) return;
 
    IFFREE(cfdata->image);
-   IFDUP(cfdata->image, file);
+   IFDUP(file, cfdata->image);
 }
 
 static void
@@ -505,7 +487,6 @@
 
    dia = obj;
    cfdata = dia->data;
-   cfdata->editor->img_set = 0;
    e_widget_focused_object_clear(cfdata->editor->img_widget);
 }
 
@@ -517,28 +498,11 @@
    cfdata = data;
    if (cfdata->image)
      {
-       cfdata->editor->img_set = 1;
-       if (cfdata->editor->img) evas_object_del(cfdata->editor->img);
-
-        IFDEL(cfdata->eap.icon_class);
-        IFDEL(cfdata->eap.icon_path);
-
-       cfdata->eap.icon_path = evas_stringshare_add(cfdata->image);
-       cfdata->eap.icon_class = NULL;
-        cfdata->editor->img = e_app_icon_add(cfdata->editor->evas, 
&(cfdata->eap));
-#if 0
-       cfdata->editor->img = e_icon_add(cfdata->editor->evas);
-       e_icon_file_set(cfdata->editor->img, cfdata->image);
-       e_icon_fill_inside_set(cfdata->editor->img, 1);
-#endif
-       e_widget_button_icon_set(cfdata->editor->img_widget, 
cfdata->editor->img);
+        e_widget_check_checked_set(cfdata->themed, 0);
+        _cb_files_icon_theme_changed(cfdata, NULL, NULL);
      }
-   else
-     cfdata->editor->img_set = 0;
 
-   e_widget_focused_object_clear(cfdata->editor->img_widget);
-   e_object_del_attach_func_set(E_OBJECT(dia), NULL);
-   e_object_del(E_OBJECT(dia));
+   _e_eap_edit_cb_icon_select_cancel(data, dia);
 }
 
 static void
@@ -547,8 +511,23 @@
    E_Config_Dialog_Data *cfdata;
 
    cfdata = data;
-   cfdata->editor->img_set = 0;
    e_widget_focused_object_clear(cfdata->editor->img_widget);
    e_object_del_attach_func_set(E_OBJECT(dia), NULL);
    e_object_del(E_OBJECT(dia));
+}
+
+static void
+_cb_files_icon_theme_changed(void *data, Evas_Object *obj, void *event_info)
+{
+   E_Config_Dialog_Data *cfdata;
+
+   cfdata = data;
+   IFDEL(cfdata->eap.icon_path);
+   if (!cfdata->icon_theme)
+      {
+         IFADD(cfdata->image, cfdata->eap.icon_path);
+      }
+   if (cfdata->editor->img) evas_object_del(cfdata->editor->img);
+   cfdata->editor->img = e_app_icon_add(cfdata->editor->evas, &(cfdata->eap));
+   e_widget_button_icon_set(cfdata->editor->img_widget, cfdata->editor->img);
 }



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