forked from enlightenment/enlightenment
More Formatting...man this was a mess
SVN revision: 19163
This commit is contained in:
parent
d20ad6001b
commit
4d260a8c32
|
@ -30,10 +30,9 @@ struct _CFData
|
|||
Evas_Object *mod_name;
|
||||
struct
|
||||
{
|
||||
Evas_Object *configure, *enable, *disable;
|
||||
Evas_Object *load, *unload, *loaded, *unloaded;
|
||||
}
|
||||
gui;
|
||||
Evas_Object *configure, *enable, *disable;
|
||||
Evas_Object *load, *unload, *loaded, *unloaded;
|
||||
} gui;
|
||||
};
|
||||
|
||||
struct _E_Cfg_Mod_Data
|
||||
|
@ -67,33 +66,33 @@ e_int_config_modules(E_Container *con)
|
|||
void
|
||||
_e_config_module_list(Evas_List **b,char *dir,int loaded)
|
||||
{
|
||||
Evas_List *l;
|
||||
l = *b;
|
||||
Evas_List *l;
|
||||
l = *b;
|
||||
char fullpath[PATH_MAX];
|
||||
if ((ecore_file_exists(dir)) && (ecore_file_is_dir(dir)))
|
||||
{
|
||||
Ecore_List *mods;
|
||||
mods = ecore_file_ls(dir);
|
||||
if (mods)
|
||||
{
|
||||
Ecore_List *mods;
|
||||
mods = ecore_file_ls(dir);
|
||||
if (mods)
|
||||
{
|
||||
char *mod;
|
||||
int i = 0;
|
||||
while ((mod = ecore_list_next(mods)))
|
||||
{
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", dir, mod);
|
||||
if (ecore_file_is_dir(fullpath))
|
||||
{
|
||||
char *mod;
|
||||
int i = 0;
|
||||
while ((mod = ecore_list_next(mods)))
|
||||
{
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", dir, mod);
|
||||
if (ecore_file_is_dir(fullpath))
|
||||
{
|
||||
E_Module *m;
|
||||
m = e_module_find(mod);
|
||||
E_Module *m;
|
||||
m = e_module_find(mod);
|
||||
|
||||
if(!m && !loaded)
|
||||
l = evas_list_append(l,mod);
|
||||
else if(m && loaded)
|
||||
l = evas_list_append(l,m);
|
||||
}
|
||||
}
|
||||
if(!m && !loaded)
|
||||
l = evas_list_append(l,mod);
|
||||
else if(m && loaded)
|
||||
l = evas_list_append(l,m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*b=l;
|
||||
}
|
||||
|
||||
|
@ -111,38 +110,38 @@ _e_config_mod_cb_standard(void *data)
|
|||
|
||||
if(cfd->view_type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
|
||||
{
|
||||
m = d->mod;
|
||||
cfd->data=m;
|
||||
if(m->enabled)
|
||||
{
|
||||
e_widget_disabled_set(cfdata->gui.enable, 1);
|
||||
e_widget_disabled_set(cfdata->gui.disable, 0);
|
||||
if(m->func.config)
|
||||
e_widget_disabled_set(cfdata->gui.configure, 0);
|
||||
else
|
||||
e_widget_disabled_set(cfdata->gui.configure, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
e_widget_disabled_set(cfdata->gui.configure, 1);
|
||||
e_widget_disabled_set(cfdata->gui.enable, 0);
|
||||
e_widget_disabled_set(cfdata->gui.disable, 1);
|
||||
}
|
||||
m = d->mod;
|
||||
cfd->data=m;
|
||||
if(m->enabled)
|
||||
{
|
||||
e_widget_disabled_set( cfdata->gui.enable, 1);
|
||||
e_widget_disabled_set( cfdata->gui.disable, 0);
|
||||
if(m->func.config)
|
||||
e_widget_disabled_set( cfdata->gui.configure, 0);
|
||||
else
|
||||
e_widget_disabled_set( cfdata->gui.configure, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
e_widget_disabled_set( cfdata->gui.configure, 1);
|
||||
e_widget_disabled_set( cfdata->gui.enable, 0);
|
||||
e_widget_disabled_set( cfdata->gui.disable, 1);
|
||||
}
|
||||
}
|
||||
else /* Load / Unload menu */
|
||||
{
|
||||
if(!d->loaded)/* unloaded module was clicked */
|
||||
{
|
||||
cfd->data=d->mod_name;
|
||||
e_widget_disabled_set(cfdata->gui.load,0);
|
||||
e_widget_disabled_set(cfdata->gui.unload,1);
|
||||
e_widget_disabled_set(cfdata->gui.loaded,1);
|
||||
e_widget_disabled_set(cfdata->gui.load, 0);
|
||||
e_widget_disabled_set(cfdata->gui.unload, 1);
|
||||
e_widget_disabled_set(cfdata->gui.loaded, 1);
|
||||
}
|
||||
else /* this is a loaded module */
|
||||
{
|
||||
cfd->data=d->mod;
|
||||
e_widget_disabled_set(cfdata->gui.load,1);
|
||||
e_widget_disabled_set(cfdata->gui.unload,0);
|
||||
e_widget_disabled_set(cfdata->gui.load, 1);
|
||||
e_widget_disabled_set(cfdata->gui.unload, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,18 +194,18 @@ _module_enable(void *data, void *data2)/* this enables and disables :) */
|
|||
e_module_save(m);
|
||||
e_module_disable(m);
|
||||
|
||||
e_widget_disabled_set(cfdata->gui.configure, 1);
|
||||
e_widget_disabled_set(cfdata->gui.enable, 0);
|
||||
e_widget_disabled_set(cfdata->gui.disable, 1);
|
||||
e_widget_disabled_set( cfdata->gui.configure, 1);
|
||||
e_widget_disabled_set( cfdata->gui.enable, 0);
|
||||
e_widget_disabled_set( cfdata->gui.disable, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
e_module_enable(m);
|
||||
|
||||
if(m->func.config)
|
||||
e_widget_disabled_set(cfdata->gui.configure, 0);
|
||||
e_widget_disabled_set(cfdata->gui.enable, 1);
|
||||
e_widget_disabled_set(cfdata->gui.disable, 0);
|
||||
e_widget_disabled_set( cfdata->gui.configure, 0);
|
||||
e_widget_disabled_set( cfdata->gui.enable, 1);
|
||||
e_widget_disabled_set( cfdata->gui.disable, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,40 +220,42 @@ _module_configure(void *data, void *data2)
|
|||
m = cfd->data;
|
||||
cfdata = cfd->cfdata;
|
||||
if(m->func.config)
|
||||
{
|
||||
m->func.config(m);
|
||||
}
|
||||
{
|
||||
m->func.config(m);
|
||||
}
|
||||
else
|
||||
printf("Can't run config no module!!!\n");// Debug!!
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**--CREATE--**/
|
||||
static void
|
||||
_fill_data(CFData *cfdata)
|
||||
{
|
||||
char buf[4096];
|
||||
char fullpath[PATH_MAX];
|
||||
Evas_List *l=NULL;
|
||||
char buf[4096];
|
||||
char fullpath[PATH_MAX];
|
||||
Evas_List *l=NULL;
|
||||
|
||||
cfdata->umods = NULL;
|
||||
cfdata->umods = NULL;
|
||||
|
||||
cfdata->mods= NULL;
|
||||
cfdata->mods= NULL;
|
||||
//e_module_list();
|
||||
|
||||
/* We could use e_module_list() but this method gives us alphabetical order */
|
||||
for(l = e_path_dir_list_get(path_modules);l;l = l->next)
|
||||
{
|
||||
E_Path_Dir *epd;
|
||||
epd = l->data;
|
||||
_e_config_module_list(&(cfdata->mods),epd->dir,1);
|
||||
}
|
||||
for(l = e_path_dir_list_get(path_modules);l;l = l->next)
|
||||
{
|
||||
E_Path_Dir *epd;
|
||||
epd = l->data;
|
||||
_e_config_module_list(&(cfdata->mods),epd->dir,1);
|
||||
}
|
||||
|
||||
for(l = e_path_dir_list_get(path_modules);l;l = l->next)
|
||||
{
|
||||
E_Path_Dir *epd;
|
||||
epd = l->data;
|
||||
_e_config_module_list(&(cfdata->umods),epd->dir,0);
|
||||
}
|
||||
for(l = e_path_dir_list_get(path_modules);l;l = l->next)
|
||||
{
|
||||
E_Path_Dir *epd;
|
||||
epd = l->data;
|
||||
_e_config_module_list(&(cfdata->umods),epd->dir,0);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -283,14 +284,13 @@ _free_data(E_Config_Dialog *cfd, CFData *cfdata)
|
|||
static int
|
||||
_basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||
{
|
||||
return 1; /* Apply was OK */
|
||||
return 1; /* Apply was OK */
|
||||
}
|
||||
|
||||
static int
|
||||
_advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||
{
|
||||
|
||||
return 1; /* Apply was OK */
|
||||
return 1; /* Apply was OK */
|
||||
}
|
||||
|
||||
/**--GUI--**/
|
||||
|
@ -368,18 +368,18 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
|||
of = e_widget_framelist_add(evas, "Loaded", 1);
|
||||
ob = e_widget_ilist_add(evas,16,16,NULL);
|
||||
for(l = cfdata->mods;l;l = l->next)
|
||||
{
|
||||
E_Cfg_Mod_Data *cb_data;
|
||||
m = l->data;
|
||||
sob = e_icon_add(evas);
|
||||
if (m->icon_file)
|
||||
e_icon_file_set(sob,m->icon_file);
|
||||
cb_data = E_NEW(E_Cfg_Mod_Data, 1);
|
||||
cb_data->cfd = cfd;
|
||||
cb_data->loaded = 1;
|
||||
cb_data->mod = m;
|
||||
e_widget_ilist_append(ob, sob, m->name, _e_config_mod_cb_standard, cb_data, m->name);
|
||||
}
|
||||
{
|
||||
E_Cfg_Mod_Data *cb_data;
|
||||
m = l->data;
|
||||
sob = e_icon_add(evas);
|
||||
if (m->icon_file)
|
||||
e_icon_file_set(sob,m->icon_file);
|
||||
cb_data = E_NEW(E_Cfg_Mod_Data, 1);
|
||||
cb_data->cfd = cfd;
|
||||
cb_data->loaded = 1;
|
||||
cb_data->mod = m;
|
||||
e_widget_ilist_append(ob, sob, m->name, _e_config_mod_cb_standard, cb_data, m->name);
|
||||
}
|
||||
cfdata->gui.loaded = ob;
|
||||
e_widget_ilist_go(ob);
|
||||
e_widget_min_size_set(ob, 120, 120);
|
||||
|
@ -401,23 +401,23 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
|||
of = e_widget_framelist_add(evas, "Unloaded", 1);
|
||||
ob = e_widget_ilist_add(evas,16,16,NULL);
|
||||
for(l = cfdata->umods;l;l = l->next)
|
||||
{
|
||||
char *mod;
|
||||
char *icon;
|
||||
char buf[PATH_MAX];
|
||||
E_Cfg_Mod_Data *cb_data;
|
||||
{
|
||||
char *mod;
|
||||
char *icon;
|
||||
char buf[PATH_MAX];
|
||||
E_Cfg_Mod_Data *cb_data;
|
||||
|
||||
mod = l->data;
|
||||
sob = e_icon_add(evas);
|
||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", mod);
|
||||
icon = e_path_find(path_modules, buf);
|
||||
e_icon_file_set(sob,icon);
|
||||
cb_data = E_NEW(CFData,1);
|
||||
cb_data->cfd = cfd;
|
||||
cb_data->loaded = 0;
|
||||
cb_data->mod_name = strdup(mod);
|
||||
e_widget_ilist_append(ob, sob, mod, _e_config_mod_cb_standard, cb_data, mod);
|
||||
}
|
||||
mod = l->data;
|
||||
sob = e_icon_add(evas);
|
||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", mod);
|
||||
icon = e_path_find(path_modules, buf);
|
||||
e_icon_file_set(sob,icon);
|
||||
cb_data = E_NEW(CFData,1);
|
||||
cb_data->cfd = cfd;
|
||||
cb_data->loaded = 0;
|
||||
cb_data->mod_name = strdup(mod);
|
||||
e_widget_ilist_append(ob, sob, mod, _e_config_mod_cb_standard, cb_data, mod);
|
||||
}
|
||||
cfdata->gui.unloaded = ob;
|
||||
e_widget_ilist_go(ob);
|
||||
e_widget_min_size_set(ob, 120, 120);
|
||||
|
|
Loading…
Reference in New Issue