Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_apps.c e_config.c e_config.h e_int_config_icon_themes.c 


Log Message:
Saves selected icon theme in e_config.  I hope I did everything I need
to do when adding a new config string.

Doesn't actually update icons or clear caches yet, but new icons will be in
the selected theme.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -3 -r1.150 -r1.151
--- e_apps.c    20 Aug 2006 03:51:54 -0000      1.150
+++ e_apps.c    21 Aug 2006 02:30:10 -0000      1.151
@@ -1179,8 +1179,8 @@
           if (desktop->icon)
              {
                 /* FIXME: Should do this only when needed, is it can be 
expensive. */
-                /* FIXME: Use a real icon size and theme. */
-                v = (char *) ecore_desktop_icon_find(desktop->icon, NULL, 
NULL);
+                /* FIXME: Use a real icon size. */
+                v = (char *) ecore_desktop_icon_find(desktop->icon, NULL, 
e_config->icon_theme);
                 if (v)
                    a->icon_path = evas_stringshare_add(v);
              }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -3 -r1.194 -r1.195
--- e_config.c  20 Aug 2006 22:30:44 -0000      1.194
+++ e_config.c  21 Aug 2006 02:30:10 -0000      1.195
@@ -471,6 +471,8 @@
    E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
    E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
 
+   E_CONFIG_VAL(D, T, icon_theme, STR);
+
    E_CONFIG_VAL(D, T, wallpaper_import_last_dev, STR);
    E_CONFIG_VAL(D, T, wallpaper_import_last_path, STR);
 
@@ -655,6 +657,8 @@
    e_config->display_res_height = 0;
    e_config->display_res_hz = 0;
    e_config->display_res_rotation = 0;
+
+   e_config->icon_theme = evas_stringshare_add("hicolor");
    
      {
        E_Config_Module *em;
@@ -1873,6 +1877,7 @@
        if (e_config->transition_desk) 
evas_stringshare_del(e_config->transition_desk);
        if (e_config->transition_change) 
evas_stringshare_del(e_config->transition_change);
        if (e_config->input_method) 
evas_stringshare_del(e_config->input_method);
+       if (e_config->icon_theme) evas_stringshare_del(e_config->icon_theme);
        E_FREE(e_config);
      }
 }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -3 -r1.108 -r1.109
--- e_config.h  20 Aug 2006 22:30:44 -0000      1.108
+++ e_config.h  21 Aug 2006 02:30:10 -0000      1.109
@@ -233,6 +233,8 @@
    int         border_raise_on_mouse_action; // GUI
    int         border_raise_on_focus; // GUI
    int         desk_flip_wrap; // GUI
+
+   const char *icon_theme; // GUI
    
    const char *wallpaper_import_last_dev; // INTERNAL
    const char *wallpaper_import_last_path; // INTERNAL
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_icon_themes.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_int_config_icon_themes.c  20 Aug 2006 05:30:42 -0000      1.2
+++ e_int_config_icon_themes.c  21 Aug 2006 02:30:10 -0000      1.3
@@ -53,8 +53,8 @@
    
    cfd = e_config_dialog_new(con,
                             _("Icon Theme Settings"),
-                           "E", "_config_icon_themes_dialog",
-                            "enlightenment/icon_themes", 0, v, NULL);
+                           "E", "_config_icon_theme_dialog",
+                            "enlightenment/icon_theme", 0, v, NULL);
    return cfd;
 }
 
@@ -69,6 +69,13 @@
    if (cfdata->icon_themes)
      cfdata->icon_themes = evas_list_sort(cfdata->icon_themes, 
evas_list_count(cfdata->icon_themes), _sort_icon_themes);
 
+   if (e_config->icon_theme)
+      cfdata->themename = strdup(e_config->icon_theme);
+   else
+      cfdata->themename = strdup("hicolor");
+
+printf("CURRENT ICON THEME - %s  -  %s\n", e_config->icon_theme, 
cfdata->themename);
+
    return;
 }
 
@@ -101,75 +108,23 @@
    free(cfdata);
 }
 
+
 static int
 _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
 {
-   E_Module *m;
-   const char *v;
-   int i;
-
-   v = cfdata->themename;
-   if (!v) return 0;
-#if 0
-   for (i = 0; i < evas_list_count(cfdata->icon_themes); i++)
-     {
-       CFIconTheme *cm;
-
-       cm = evas_list_nth(cfdata->icon_themes, i);
-       if ((cm) && (!strcmp(cm->name, v)))
-         {
-            if (cm->state != cfdata->state)
-              {
-                 e_widget_disabled_set(cfdata->gui.configure, 1);
-                 e_widget_disabled_set(cfdata->gui.about, 1);
-                 
-                 m = e_icon_theme_find(v);
-                 if (!m) 
-                   { 
-                      m = e_icon_theme_new(v);
-                      if (!m) break;
-                   }             
-                 switch (cfdata->state)
-                   {
-                    case MOD_ENABLED:
-                      if (!m->enabled) 
-                        {
-                           if (!e_icon_theme_enable(m)) 
-                             {
-                                cm->state = MOD_UNLOADED;
-                                break;
-                             }
-                        }
-                      if (m->enabled) 
-                        {       
-                           if (m->func.config)
-                             e_widget_disabled_set(cfdata->gui.configure, 0);
-                           if (m->func.about)
-                             e_widget_disabled_set(cfdata->gui.about, 0);
-                           cm->state = MOD_ENABLED;
-                        }
-                      break;
-                    case MOD_UNLOADED:
-                      if (m)
-                        {
-                           if (m->func.config)
-                             e_widget_disabled_set(cfdata->gui.configure, 1);
-                           if (m->func.about)
-                             e_widget_disabled_set(cfdata->gui.about, 1);
-                           e_icon_theme_disable(m);
-                           e_object_del(E_OBJECT(m));
-                           cm->state = MOD_UNLOADED;                       
-                        }
-                      break;
-                   }
-              }
-            break;
-         }
-     }
-#endif
-   return 1;
+   E_Action *a;
+   
+   /* Actually take our cfdata settings and apply them in real life */
+printf("NEW ICON THEME - %s\n", cfdata->themename);
+   e_config->icon_theme = evas_stringshare_add(cfdata->themename);
+   e_config_save_queue();
+
+//   a = e_action_find("restart");
+//   if ((a) && (a->func.go)) a->func.go(NULL, NULL);
+   return 1; /* Apply was OK */
 }
 
+
 static void
 _cb_button_up(void *data1, void *data2)
 {
@@ -214,16 +169,18 @@
    char buf[4096];
    Evas_Coord ew, eh, mw, mh;
    E_Fm2_Config fmc;
+   int i;
 
    o = e_widget_list_add(evas, 1, 0);
    ot = e_widget_table_add(evas, 1);
-   
+
    of = e_widget_framelist_add(evas, _("Icon Themes"), 1);
    ilist = e_widget_ilist_add(evas, 24, 24, &(cfdata->themename));
    cfdata->gui.list = ilist;
    e_widget_on_change_hook_set(ilist, _ilist_cb_change, cfdata);
 
    cfdata->state = -1;
+   i = 0;
    for (l = cfdata->icon_themes; l; l = l->next)
      {
        CFIconTheme *cm;
@@ -244,6 +201,9 @@
                      }
                }
              e_widget_ilist_append(ilist, oc, cm->theme->name, NULL, NULL, 
cm->name);
+            if (strcmp(cfdata->themename, cm->name) == 0)
+               e_widget_ilist_selected_set(ilist, i);
+            i++;
          }
      }
 
@@ -286,13 +246,7 @@
    e_fm2_config_set(mt, &fmc);
    evas_object_smart_callback_add(mt, "dir_changed",
                                  _cb_files_changed, cfdata);
-//   evas_object_smart_callback_add(mt, "selection_change",
-//                               _cb_files_selection_change, cfdata);
-//   evas_object_smart_callback_add(mt, "selected",
-//                               _cb_files_selected, cfdata);
-//   evas_object_smart_callback_add(mt, "changed",
-//                               _cb_files_files_changed, cfdata);
-   e_fm2_path_set(cfdata->gui.o_fm, "/opt/kde3/share/icons/crystalsvg", "/");
+//   e_fm2_path_set(cfdata->gui.o_fm, "/opt/kde3/share/icons/crystalsvg", "/");
 
    ob = e_widget_scrollframe_pan_add(evas, mt,
                                     e_fm2_pan_set,
@@ -307,6 +261,9 @@
    e_widget_list_object_append(o, ot, 1, 1, 0.5);
 
    e_dialog_resizable_set(cfd->dia, 1);
+
+   _ilist_cb_change(cfdata, ilist);
+
    return o;
 }
 



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