Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_config_mime_edit.c 


Log Message:
Start of some file trapping. More todo.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_mime_edit.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_int_config_mime_edit.c    3 Nov 2006 04:11:20 -0000       1.1
+++ e_int_config_mime_edit.c    3 Nov 2006 04:56:54 -0000       1.2
@@ -11,6 +11,7 @@
 static void         _cb_fsel_sel    (void *data, Evas_Object *obj);
 static void         _cb_fsel_ok     (void *data, E_Dialog *dia);
 static void         _cb_fsel_cancel (void *data, E_Dialog *dia);
+static void         _cb_file_change (void *data);
 
 typedef enum _Icon_Type Icon_Type;
 enum _Icon_Type 
@@ -25,9 +26,11 @@
    char *mime;
    char *icon;
    int type;
+
+   char *file;
    struct 
      {
-       Evas_Object *icon;
+       Evas_Object *icon, *fsel_wid;
        E_Dialog *fsel;
      } gui;
 };
@@ -90,7 +93,6 @@
      cfdata->type = THUMB;
    else
      {
-       printf("Icon: %s\n", cfdata->icon);
        p = strrchr(cfdata->icon, '.');
        if ((p) && (!strcmp(p, ".edj"))) 
          cfdata->type = EDJ;
@@ -102,6 +104,8 @@
 static void
 _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) 
 {
+   if (cfdata->gui.fsel) e_object_del(E_OBJECT(cfdata->gui.fsel));
+   IFFREE(cfdata->file);
    IFFREE(cfdata->mime);
    IFFREE(cfdata->icon);
    E_FREE(cfdata);
@@ -190,7 +194,8 @@
    else
      o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
                           _cb_fsel_sel, cfdata, NULL, cfdata, 1);
-     
+
+   cfdata->gui.fsel_wid = o;
    evas_object_show(o);
    e_widget_min_size_get(o, &w, &h);
    e_dialog_content_set(dia, o, w, h);
@@ -272,17 +277,22 @@
    
    cfdata = data;
    if (!cfdata) return;
-   
 }
 
 static void 
 _cb_fsel_ok(void *data, E_Dialog *dia) 
 {
    E_Config_Dialog_Data *cfdata;
+   const char *file;
    
    cfdata = data;
    if (!cfdata) return;
+   
+   file = e_widget_fsel_selection_path_get(cfdata->gui.fsel_wid);
+   IFDUP(file, cfdata->file);
    _cb_fsel_cancel(data, dia);
+   if (cfdata->file)
+     _cb_file_change(cfdata);
 }
 
 static void 
@@ -295,3 +305,26 @@
    cfdata->gui.fsel = NULL;
 }
 
+static void 
+_cb_file_change(void *data) 
+{
+   E_Config_Dialog_Data *cfdata;
+   
+   cfdata = data;
+   if (!cfdata) return;
+   if (!cfdata->file) return;
+   switch (cfdata->type) 
+     {
+      case EDJ:
+       if (!strstr(cfdata->file, ".edj")) return;
+//     if (!edje_file_group_exists(cfdata->file, "")) return;
+       break;
+      case IMAGE:
+       break;
+      default:
+       return;
+       break;
+     }
+   
+   printf("File: %s\n", cfdata->file);
+}



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