e17: fix: show evry 'start' and 'plugins' dialogs via settings panel action

added a function to pass the params with which the configure registry item will be called. 


SVN revision: 58396
This commit is contained in:
Hannes Janetzek 2011-04-06 22:17:58 +00:00
parent 2681c18ada
commit 6da0d7a74d
3 changed files with 19 additions and 7 deletions

View File

@ -5,7 +5,7 @@ static void _e_configure_menu_add(void *data, E_Menu *m);
static void _e_configure_efreet_desktop_cleanup(void);
static void _e_configure_efreet_desktop_update(void);
static Eina_Bool _e_configure_cb_efreet_desktop_cache_update(void *data, int type, void *event);
static void _e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), void (*generic_func) (E_Container *con, const char *params), Efreet_Desktop *desktop);
static void _e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), void (*generic_func) (E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params);
static void _e_configure_registry_item_free(E_Configure_It *eci);
static void _configure_job(void *data);
@ -60,6 +60,8 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
EINA_LIST_FOREACH(ecat->items, ll, eci)
if (!strcmp(item, eci->item))
{
if (!params) params = eci->params;
if (eci->func) eci->func(con, params);
else if (eci->generic_func) eci->generic_func(con, params);
else if (eci->desktop)
@ -81,13 +83,19 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
EAPI void
e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params))
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL);
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, NULL);
}
EAPI void
e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params))
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, NULL, generic_func, NULL);
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, NULL, generic_func, NULL, NULL);
}
EAPI void
e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), const char *params)
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, params);
}
EAPI void
@ -365,7 +373,7 @@ _e_configure_efreet_desktop_update(void)
}
_e_configure_registry_item_full_add(cfg_cat_cfg, cfg_pri, label,
NULL, cfg_icon,
NULL, NULL, desktop);
NULL, NULL, desktop, NULL);
}
EINA_LIST_FREE(settings_desktops, desktop)
efreet_desktop_free(desktop);
@ -383,7 +391,7 @@ _e_configure_cb_efreet_desktop_cache_update(void *data __UNUSED__, int type __UN
}
static void
_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), void (*generic_func) (E_Container *con, const char *params), Efreet_Desktop *desktop)
_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), void (*generic_func) (E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params)
{
Eina_List *l;
char *cat;
@ -403,6 +411,7 @@ _e_configure_registry_item_full_add(const char *path, int pri, const char *label
eci->label = eina_stringshare_add(label);
if (icon_file) eci->icon_file = eina_stringshare_add(icon_file);
if (icon) eci->icon = eina_stringshare_add(icon);
if (params) eci->params = eina_stringshare_add(params);
eci->func = func;
eci->generic_func = generic_func;
eci->desktop = desktop;
@ -436,5 +445,6 @@ _e_configure_registry_item_free(E_Configure_It *eci)
eina_stringshare_del(eci->icon);
if (eci->icon_file) eina_stringshare_del(eci->icon_file);
if (eci->desktop) efreet_desktop_free(eci->desktop);
if (eci->params) eina_stringshare_del(eci->params);
free(eci);
}

View File

@ -24,12 +24,14 @@ struct _E_Configure_It
const char *label;
const char *icon_file;
const char *icon;
const char *params;
E_Config_Dialog *(*func) (E_Container *con, const char *params);
void (*generic_func) (E_Container *con, const char *params);
Efreet_Desktop *desktop;
};
EAPI void e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params));
EAPI void e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), const char *params);
EAPI void e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params));
EAPI void e_configure_registry_item_del(const char *path);
EAPI void e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon);

View File

@ -148,8 +148,8 @@ _add_plugin(const char *name)
snprintf(title, sizeof(title), "Everything %s", p->name);
e_configure_registry_item_add
(path, 110, title, NULL, NULL/*icon*/, evry_collection_conf_dialog);
e_configure_registry_item_params_add
(path, 110, title, NULL, p->base.icon, evry_collection_conf_dialog, p->name);
p->config_path = eina_stringshare_add(path);