forked from enlightenment/enlightenment
initial config dialog for collection
suff mentioned in last commit msg SVN revision: 49263
This commit is contained in:
parent
9e581982f7
commit
249e926a61
|
@ -965,7 +965,8 @@ _plugins_init(const Evry_API *api)
|
||||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), NULL, EVRY_TYPE_APP,
|
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"),
|
||||||
|
"system-run", EVRY_TYPE_APP,
|
||||||
_begin, _finish, _fetch, NULL);
|
_begin, _finish, _fetch, NULL);
|
||||||
p->complete = &_complete;
|
p->complete = &_complete;
|
||||||
p->config_path = "extensions/everything-apps";
|
p->config_path = "extensions/everything-apps";
|
||||||
|
@ -973,7 +974,8 @@ _plugins_init(const Evry_API *api)
|
||||||
_plugins = eina_list_append(_plugins, p);
|
_plugins = eina_list_append(_plugins, p);
|
||||||
|
|
||||||
|
|
||||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Exebuf"), NULL, EVRY_TYPE_APP,
|
p = EVRY_PLUGIN_NEW(Plugin, N_("Exebuf"),
|
||||||
|
"system-run", EVRY_TYPE_APP,
|
||||||
_begin_exe, _finish_exe, _fetch_exe, NULL);
|
_begin_exe, _finish_exe, _fetch_exe, NULL);
|
||||||
p->complete = &_complete;
|
p->complete = &_complete;
|
||||||
p->config_path = "extensions/everything-apps";
|
p->config_path = "extensions/everything-apps";
|
||||||
|
@ -981,14 +983,16 @@ _plugins_init(const Evry_API *api)
|
||||||
if (evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 3))
|
if (evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 3))
|
||||||
p->config->min_query = 5;
|
p->config->min_query = 5;
|
||||||
|
|
||||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), NULL, EVRY_TYPE_APP,
|
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"),
|
||||||
|
"system-run", EVRY_TYPE_APP,
|
||||||
_begin_mime, _finish, _fetch, NULL);
|
_begin_mime, _finish, _fetch, NULL);
|
||||||
p->complete = &_complete;
|
p->complete = &_complete;
|
||||||
p->config_path = "extensions/everything-apps";
|
p->config_path = "extensions/everything-apps";
|
||||||
evry->plugin_register(p, EVRY_PLUGIN_OBJECT, 1);
|
evry->plugin_register(p, EVRY_PLUGIN_OBJECT, 1);
|
||||||
_plugins = eina_list_append(_plugins, p);
|
_plugins = eina_list_append(_plugins, p);
|
||||||
|
|
||||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Open With..."), NULL, EVRY_TYPE_APP,
|
p = EVRY_PLUGIN_NEW(Plugin, N_("Open With..."),
|
||||||
|
"system-run", EVRY_TYPE_APP,
|
||||||
_begin_mime, _finish_mime, _fetch_mime, NULL);
|
_begin_mime, _finish_mime, _fetch_mime, NULL);
|
||||||
p->config_path = "extensions/everything-apps";
|
p->config_path = "extensions/everything-apps";
|
||||||
evry->plugin_register(p, EVRY_PLUGIN_ACTION, 1);
|
evry->plugin_register(p, EVRY_PLUGIN_ACTION, 1);
|
||||||
|
|
|
@ -649,8 +649,8 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
|
||||||
{
|
{
|
||||||
/* provide subject */
|
/* provide subject */
|
||||||
EVRY_PLUGIN_INSTANCE(p, plugin);
|
EVRY_PLUGIN_INSTANCE(p, plugin);
|
||||||
p->min_query = plugin->config->min_query;
|
p->parent = EINA_FALSE;
|
||||||
|
|
||||||
if (_conf->show_homedir)
|
if (_conf->show_homedir)
|
||||||
p->directory = eina_stringshare_add(e_user_homedir_get());
|
p->directory = eina_stringshare_add(e_user_homedir_get());
|
||||||
|
|
||||||
|
@ -823,6 +823,9 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
if (input && !p->command)
|
if (input && !p->command)
|
||||||
p->input = eina_stringshare_add(input);
|
p->input = eina_stringshare_add(input);
|
||||||
|
|
||||||
|
if (!p->parent)
|
||||||
|
p->min_query = plugin->config->min_query;
|
||||||
|
|
||||||
if ((p->command) || (!p->min_query) || (len >= p->min_query))
|
if ((p->command) || (!p->min_query) || (len >= p->min_query))
|
||||||
_append_files(p);
|
_append_files(p);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,16 @@
|
||||||
#include "e_mod_main.h"
|
#include "e_mod_main.h"
|
||||||
#include "evry_api.h"
|
#include "evry_api.h"
|
||||||
|
|
||||||
|
typedef struct _Plugin Plugin;
|
||||||
typedef struct _Settings_Item Settings_Item;
|
typedef struct _Settings_Item Settings_Item;
|
||||||
|
|
||||||
|
struct _Plugin
|
||||||
|
{
|
||||||
|
Evry_Plugin base;
|
||||||
|
Eina_List *items;
|
||||||
|
Eina_List *categories;
|
||||||
|
};
|
||||||
|
|
||||||
struct _Settings_Item
|
struct _Settings_Item
|
||||||
{
|
{
|
||||||
Evry_Item base;
|
Evry_Item base;
|
||||||
|
@ -16,22 +24,27 @@ struct _Settings_Item
|
||||||
E_Configure_It *eci;
|
E_Configure_It *eci;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const Evry_API *evry = NULL;
|
static const Evry_API *evry = NULL;
|
||||||
static Evry_Module *evry_module = NULL;
|
static Evry_Module *evry_module = NULL;
|
||||||
static Evry_Plugin *p;
|
static Evry_Plugin *p;
|
||||||
static Evry_Action *act;
|
static Evry_Action *act;
|
||||||
static Eina_List *items = NULL;
|
static Evry_Type E_SETTINGS;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_finish(Evry_Plugin *p)
|
_finish(Evry_Plugin *plugin)
|
||||||
{
|
{
|
||||||
Evry_Item *it;
|
Settings_Item *it;
|
||||||
|
GET_PLUGIN(p, plugin);
|
||||||
|
|
||||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||||
|
|
||||||
EINA_LIST_FREE(items, it)
|
EINA_LIST_FREE(p->items, it)
|
||||||
evry->item_free(it);
|
EVRY_ITEM_FREE(it);
|
||||||
|
|
||||||
|
EINA_LIST_FREE(p->categories, it)
|
||||||
|
EVRY_ITEM_FREE(it);
|
||||||
|
|
||||||
|
E_FREE(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -40,50 +53,110 @@ _icon_get(Evry_Item *item, Evas *e)
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
Settings_Item *it = (Settings_Item *) item;
|
Settings_Item *it = (Settings_Item *) item;
|
||||||
|
|
||||||
if (it->eci->icon &&
|
if (it->eci && it->eci->icon &&
|
||||||
((o = evry->icon_theme_get(it->eci->icon, e)) ||
|
((o = evry->icon_theme_get(it->eci->icon, e)) ||
|
||||||
(o = e_util_icon_add(it->eci->icon, e))))
|
(o = e_util_icon_add(it->eci->icon, e))))
|
||||||
return o;
|
return o;
|
||||||
|
|
||||||
|
if (it->ecat->icon &&
|
||||||
|
((o = evry->icon_theme_get(it->ecat->icon, e)) ||
|
||||||
|
(o = e_util_icon_add(it->ecat->icon, e))))
|
||||||
|
return o;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evry_Plugin *
|
static Evry_Plugin *
|
||||||
_begin(Evry_Plugin *p, const Evry_Item *item __UNUSED__)
|
_browse(Evry_Plugin *plugin, const Evry_Item *item)
|
||||||
{
|
{
|
||||||
Settings_Item *it;
|
Plugin *p;
|
||||||
Eina_List *l, *ll;
|
Eina_List *l;
|
||||||
E_Configure_Cat *ecat;
|
Settings_Item *it, *it2;
|
||||||
E_Configure_It *eci;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
if (!CHECK_TYPE(item, E_SETTINGS))
|
||||||
{
|
return NULL;
|
||||||
if ((ecat->pri < 0) || (!ecat->items)) continue;
|
|
||||||
if (!strcmp(ecat->cat, "system")) continue;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ecat->items, ll, eci)
|
it = (Settings_Item *) item;
|
||||||
{
|
|
||||||
if (eci->pri < 0) continue;
|
EVRY_PLUGIN_INSTANCE(p, plugin);
|
||||||
|
|
||||||
it = EVRY_ITEM_NEW(Settings_Item, p, eci->label, _icon_get, NULL);
|
|
||||||
it->eci = eci;
|
|
||||||
it->ecat = ecat;
|
|
||||||
EVRY_ITEM_DETAIL_SET(it, ecat->label);
|
|
||||||
|
|
||||||
items = eina_list_append(items, it);
|
GET_PLUGIN(parent, item->plugin);
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(parent->items, l, it2)
|
||||||
|
{
|
||||||
|
if (it2->ecat == it->ecat)
|
||||||
|
{
|
||||||
|
EVRY_ITEM_REF(it2);
|
||||||
|
p->items = eina_list_append(p->items, it2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return p;
|
|
||||||
|
return EVRY_PLUGIN(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evry_Plugin *
|
||||||
|
_begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
|
||||||
|
{
|
||||||
|
Plugin *p;
|
||||||
|
|
||||||
|
EVRY_PLUGIN_INSTANCE(p, plugin);
|
||||||
|
|
||||||
|
return EVRY_PLUGIN(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_fetch(Evry_Plugin *p, const char *input)
|
_fetch(Evry_Plugin *plugin, const char *input)
|
||||||
{
|
{
|
||||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
int len = input ? strlen(input) : 0;
|
||||||
|
|
||||||
if (!input) return 0;
|
|
||||||
|
|
||||||
return EVRY_PLUGIN_ITEMS_ADD(p, items, input, 1, 1);
|
GET_PLUGIN(p, plugin);
|
||||||
|
|
||||||
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||||
|
|
||||||
|
if (len < plugin->config->min_query)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!p->categories && !p->items)
|
||||||
|
{
|
||||||
|
Settings_Item *it;
|
||||||
|
Eina_List *l, *ll;
|
||||||
|
E_Configure_Cat *ecat;
|
||||||
|
E_Configure_It *eci;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||||
|
{
|
||||||
|
if ((ecat->pri < 0) || (!ecat->items)) continue;
|
||||||
|
if (!strcmp(ecat->cat, "system")) continue;
|
||||||
|
|
||||||
|
it = EVRY_ITEM_NEW(Settings_Item, p, ecat->label, _icon_get, NULL);
|
||||||
|
it->ecat = ecat;
|
||||||
|
EVRY_ITEM(it)->browseable = EINA_TRUE;
|
||||||
|
p->categories = eina_list_append(p->categories, it);
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(ecat->items, ll, eci)
|
||||||
|
{
|
||||||
|
if (eci->pri < 0) continue;
|
||||||
|
|
||||||
|
it = EVRY_ITEM_NEW(Settings_Item, p, eci->label, _icon_get, NULL);
|
||||||
|
it->eci = eci;
|
||||||
|
it->ecat = ecat;
|
||||||
|
EVRY_ITEM_DETAIL_SET(it, ecat->label);
|
||||||
|
|
||||||
|
p->items = eina_list_append(p->items, it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EVRY_PLUGIN_ITEMS_ADD(p, p->categories, input, 1, 1);
|
||||||
|
|
||||||
|
if (input || !p->categories)
|
||||||
|
return EVRY_PLUGIN_ITEMS_ADD(p, p->items, input, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_action_check(Evry_Action *act, const Evry_Item *item)
|
||||||
|
{
|
||||||
|
return !!(((Settings_Item*)item)->eci);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -112,16 +185,19 @@ _plugins_init(const Evry_API *_api)
|
||||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
p = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Settings"), "preferences-desktop",
|
E_SETTINGS = evry->type_register("E_SETTINGS");
|
||||||
evry->type_register("E_SETTINGS"),
|
|
||||||
|
p = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Settings"),
|
||||||
|
"preferences-desktop", E_SETTINGS,
|
||||||
_begin, _finish, _fetch, NULL);
|
_begin, _finish, _fetch, NULL);
|
||||||
|
p->browse = &_browse;
|
||||||
evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 10);
|
evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 10);
|
||||||
|
|
||||||
act = EVRY_ACTION_NEW(N_("Show Dialog"),
|
act = EVRY_ACTION_NEW(N_("Show Dialog"), E_SETTINGS, 0,
|
||||||
evry->type_register("E_SETTINGS"), 0,
|
"preferences-advanced", _action, _action_check);
|
||||||
"preferences-advanced", _action, NULL);
|
|
||||||
|
|
||||||
|
/* p->actions = eina_list_append(p->actions, act); */
|
||||||
|
|
||||||
evry->action_register(act, 0);
|
evry->action_register(act, 0);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -134,7 +210,7 @@ _plugins_shutdown(void)
|
||||||
|
|
||||||
EVRY_PLUGIN_FREE(p);
|
EVRY_PLUGIN_FREE(p);
|
||||||
|
|
||||||
evry->action_free(act);
|
EVRY_ACTION_FREE(act);
|
||||||
|
|
||||||
evry_module->active = EINA_FALSE;
|
evry_module->active = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,8 +131,17 @@ _get_borderlist(Plugin *p)
|
||||||
_border_item_add(p, bd);
|
_border_item_add(p, bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Evry_Plugin *
|
||||||
|
_begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
|
||||||
|
{
|
||||||
|
Plugin *p;
|
||||||
|
EVRY_PLUGIN_INSTANCE(p, plugin);
|
||||||
|
|
||||||
|
return EVRY_PLUGIN(p);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cleanup(Evry_Plugin *plugin)
|
_finish(Evry_Plugin *plugin)
|
||||||
{
|
{
|
||||||
Ecore_Event_Handler *h;
|
Ecore_Event_Handler *h;
|
||||||
Border_Item *bi;
|
Border_Item *bi;
|
||||||
|
@ -148,6 +157,8 @@ _cleanup(Evry_Plugin *plugin)
|
||||||
|
|
||||||
EINA_LIST_FREE(p->handlers, h)
|
EINA_LIST_FREE(p->handlers, h)
|
||||||
ecore_event_handler_del(h);
|
ecore_event_handler_del(h);
|
||||||
|
|
||||||
|
E_FREE(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -402,7 +413,7 @@ _plugins_init(const Evry_API *_api)
|
||||||
_plug = EVRY_PLUGIN_NEW(Plugin, N_("Windows"),
|
_plug = EVRY_PLUGIN_NEW(Plugin, N_("Windows"),
|
||||||
"preferences-system-windows",
|
"preferences-system-windows",
|
||||||
EVRY_TYPE_BORDER,
|
EVRY_TYPE_BORDER,
|
||||||
NULL, _cleanup, _fetch, NULL);
|
_begin, _finish, _fetch, NULL);
|
||||||
_plug->transient = EINA_TRUE;
|
_plug->transient = EINA_TRUE;
|
||||||
if (evry->plugin_register(_plug, EVRY_PLUGIN_SUBJECT, 2))
|
if (evry->plugin_register(_plug, EVRY_PLUGIN_SUBJECT, 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -374,6 +374,7 @@ EAPI void *e_modapi_init (E_Module *m);
|
||||||
EAPI int e_modapi_shutdown (E_Module *m);
|
EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save (E_Module *m);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI E_Config_Dialog *evry_config_dialog(E_Container *con, const char *params);
|
EAPI E_Config_Dialog *evry_config_dialog(E_Container *con, const char *params);
|
||||||
|
EAPI E_Config_Dialog *evry_collection_conf_dialog(E_Container *con, const char *params);
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
||||||
|
|
|
@ -1714,8 +1714,6 @@ evry_browse_item(Evry_Item *it)
|
||||||
{
|
{
|
||||||
if ((p->browse) && (pp = p->browse(p, it)))
|
if ((p->browse) && (pp = p->browse(p, it)))
|
||||||
{
|
{
|
||||||
printf("append %s\n", pp->name);
|
|
||||||
|
|
||||||
plugins = eina_list_append(plugins, pp);
|
plugins = eina_list_append(plugins, pp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1724,7 +1722,6 @@ evry_browse_item(Evry_Item *it)
|
||||||
if ((!(plugins) && (it->plugin->browse)) &&
|
if ((!(plugins) && (it->plugin->browse)) &&
|
||||||
(pp = it->plugin->browse(it->plugin, it)))
|
(pp = it->plugin->browse(it->plugin, it)))
|
||||||
{
|
{
|
||||||
printf("append 2%s\n", pp->name);
|
|
||||||
plugins = eina_list_append(plugins, pp);
|
plugins = eina_list_append(plugins, pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@ struct _Plugin_Page
|
||||||
int enabled;
|
int enabled;
|
||||||
int min_query;
|
int min_query;
|
||||||
Plugin_Config *cur;
|
Plugin_Config *cur;
|
||||||
|
|
||||||
|
Eina_Bool collection;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
|
@ -228,30 +230,31 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, int enabled __UNUSED__)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_plugin_move(Eina_List *plugins, Evas_Object *list, int dir)
|
_plugin_move(Plugin_Page *page, int dir)
|
||||||
{
|
{
|
||||||
|
Evas_Object *list;
|
||||||
int sel;
|
int sel;
|
||||||
Eina_List *l1, *l2;
|
Eina_List *plugins, *l1, *l2;
|
||||||
|
|
||||||
sel = e_widget_ilist_selected_get(list);
|
sel = e_widget_ilist_selected_get(page->list);
|
||||||
|
|
||||||
if ((sel >= 1 && dir > 0) || (sel >= 2 && dir < 0))
|
if ((page->collection) || (sel >= 1 && dir > 0) || (sel >= 2 && dir < 0))
|
||||||
{
|
{
|
||||||
Plugin_Config *pc;
|
Plugin_Config *pc;
|
||||||
int prio = 0;
|
int prio = 0;
|
||||||
|
|
||||||
l1 = eina_list_nth_list(plugins, sel);
|
l1 = eina_list_nth_list(page->configs, sel);
|
||||||
l2 = eina_list_nth_list(plugins, sel + dir);
|
l2 = eina_list_nth_list(page->configs, sel + dir);
|
||||||
|
|
||||||
if (!l1 || !l2) return;
|
if (!l1 || !l2) return;
|
||||||
pc = l1->data;
|
pc = l1->data;
|
||||||
l1->data = l2->data;
|
l1->data = l2->data;
|
||||||
l2->data = pc;
|
l2->data = pc;
|
||||||
|
|
||||||
_fill_list(plugins, list, 0);
|
_fill_list(page->configs, page->list, 0);
|
||||||
e_widget_ilist_selected_set(list, sel + dir);
|
e_widget_ilist_selected_set(page->list, sel + dir);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(plugins, l1, pc)
|
EINA_LIST_FOREACH(page->configs, l1, pc)
|
||||||
pc->priority = prio++;
|
pc->priority = prio++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,13 +262,13 @@ _plugin_move(Eina_List *plugins, Evas_Object *list, int dir)
|
||||||
static void
|
static void
|
||||||
_plugin_move_up_cb(void *data, void *data2)
|
_plugin_move_up_cb(void *data, void *data2)
|
||||||
{
|
{
|
||||||
_plugin_move(data2, data, -1);
|
_plugin_move(data, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_plugin_move_down_cb(void *data, void *data2)
|
_plugin_move_down_cb(void *data, void *data2)
|
||||||
{
|
{
|
||||||
_plugin_move(data2, data, 1);
|
_plugin_move(data, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -340,12 +343,14 @@ static void
|
||||||
_plugin_config_cb(void *data, void *data2)
|
_plugin_config_cb(void *data, void *data2)
|
||||||
{
|
{
|
||||||
Plugin_Page *page = data;
|
Plugin_Page *page = data;
|
||||||
if (!page->cur->plugin)
|
Evry_Plugin *p = page->cur->plugin;
|
||||||
return;
|
|
||||||
|
if (!p) return;
|
||||||
|
printf(" %s\n", p->name);
|
||||||
|
|
||||||
e_configure_registry_call(page->cur->plugin->config_path,
|
e_configure_registry_call(p->config_path,
|
||||||
e_container_current_get(e_manager_current_get()),
|
e_container_current_get(e_manager_current_get()),
|
||||||
NULL);
|
p->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -362,12 +367,12 @@ _create_plugin_page(E_Config_Dialog_Data *cfdata, Evas *e, Plugin_Page *page)
|
||||||
|
|
||||||
o = e_widget_button_add(e, _("Move Up"), NULL,
|
o = e_widget_button_add(e, _("Move Up"), NULL,
|
||||||
_plugin_move_up_cb,
|
_plugin_move_up_cb,
|
||||||
page->list, page->configs);
|
page, NULL);
|
||||||
e_widget_framelist_object_append(of, o);
|
e_widget_framelist_object_append(of, o);
|
||||||
|
|
||||||
o = e_widget_button_add(e, _("Move Down"), NULL,
|
o = e_widget_button_add(e, _("Move Down"), NULL,
|
||||||
_plugin_move_down_cb,
|
_plugin_move_down_cb,
|
||||||
page->list, page->configs);
|
page, NULL);
|
||||||
e_widget_framelist_object_append(of, o);
|
e_widget_framelist_object_append(of, o);
|
||||||
ob = e_widget_table_add(e, 0);
|
ob = e_widget_table_add(e, 0);
|
||||||
e_widget_table_object_append(ob, of, 0, 0, 1, 3, 1, 1, 1, 0);
|
e_widget_table_object_append(ob, of, 0, 0, 1, 3, 1, 1, 1, 0);
|
||||||
|
@ -597,36 +602,40 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdat
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void *_cat_create_data(E_Config_Dialog *cfd);
|
static void *_cat_create_data(E_Config_Dialog *cfd);
|
||||||
static void _cat_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static void _cat_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
static Evas_Object *_cat_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
static Evas_Object *_cat_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||||
static int _cat_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static int _cat_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
|
|
||||||
static E_Config_Dialog *
|
EAPI E_Config_Dialog *
|
||||||
evry_categories_conf_dialog(E_Container *con, const char *params)
|
evry_collection_conf_dialog(E_Container *con, const char *params)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd = NULL;
|
E_Config_Dialog *cfd = NULL;
|
||||||
E_Config_Dialog_View *v = NULL;
|
E_Config_Dialog_View *v = NULL;
|
||||||
char buf[4096];
|
Evry_Plugin *p;
|
||||||
|
char title[4096];
|
||||||
|
|
||||||
if (e_config_dialog_find(_config_path, _config_path))
|
if (!(p = evry_plugin_find(params)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (e_config_dialog_find(p->config_path, p->config_path))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
v = E_NEW(E_Config_Dialog_View, 1);
|
v = E_NEW(E_Config_Dialog_View, 1);
|
||||||
if (!v) return NULL;
|
if (!v) return NULL;
|
||||||
|
|
||||||
v->create_cfdata = _create_data;
|
v->create_cfdata = _cat_create_data;
|
||||||
v->free_cfdata = _free_data;
|
v->free_cfdata = _cat_free_data;
|
||||||
v->basic.create_widgets = _basic_create_widgets;
|
v->basic.create_widgets = _cat_basic_create_widgets;
|
||||||
v->basic.apply_cfdata = _basic_apply;
|
v->basic.apply_cfdata = _cat_basic_apply;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/e-module.edj", _conf->module->dir);
|
snprintf(title, sizeof(title), "%s: %s", _("Everything Collection"), p->name);
|
||||||
|
|
||||||
|
cfd = e_config_dialog_new(con, title, p->config_path, p->config_path,
|
||||||
|
EVRY_ITEM(p)->icon, 0, v, p);
|
||||||
|
|
||||||
cfd = e_config_dialog_new(con, _("Everything Categories"),
|
/* FIXME free dialogs on shutdown
|
||||||
_config_path, _config_path, buf, 0, v, NULL);
|
_conf->cfd = cfd; */
|
||||||
|
|
||||||
_conf->cfd = cfd;
|
|
||||||
return cfd;
|
return cfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,15 +643,11 @@ static void *
|
||||||
_cat_create_data(E_Config_Dialog *cfd)
|
_cat_create_data(E_Config_Dialog *cfd)
|
||||||
{
|
{
|
||||||
E_Config_Dialog_Data *cfdata = NULL;
|
E_Config_Dialog_Data *cfdata = NULL;
|
||||||
|
Evry_Plugin *p = cfd->data;
|
||||||
|
|
||||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||||
|
cfdata->page[0].collection = EINA_TRUE;
|
||||||
cfdata->page[0].configs = eina_list_clone(_conf->plugins);
|
cfdata->page[0].configs = eina_list_clone(p->config->plugins);
|
||||||
|
|
||||||
/* #define CP(_name) cfdata->_name = strdup(_conf->_name);
|
|
||||||
* #define C(_name) cfdata->_name = _conf->_name;
|
|
||||||
*
|
|
||||||
* #undef CP
|
|
||||||
* #undef C */
|
|
||||||
return cfdata;
|
return cfdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,7 +656,7 @@ _cat_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
if (cfdata->page[0].configs) eina_list_free(cfdata->page[0].configs);
|
if (cfdata->page[0].configs) eina_list_free(cfdata->page[0].configs);
|
||||||
|
|
||||||
_conf->cfd = NULL;
|
/* _conf->cfd = NULL; */
|
||||||
E_FREE(cfdata);
|
E_FREE(cfdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,8 +665,12 @@ _cat_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Plugin_Config *pc;
|
Plugin_Config *pc;
|
||||||
|
Evry_Plugin *p = cfd->data;
|
||||||
|
|
||||||
_conf->plugins = eina_list_clone(cfdata->page[0].configs);
|
if (p->config->plugins)
|
||||||
|
eina_list_free(p->config->plugins);
|
||||||
|
|
||||||
|
p->config->plugins = eina_list_clone(cfdata->page[0].configs);
|
||||||
|
|
||||||
pc = cfdata->page[i].cur;
|
pc = cfdata->page[i].cur;
|
||||||
|
|
||||||
|
@ -683,16 +692,6 @@ _cat_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
pc->min_query = cfdata->page[i].min_query;
|
pc->min_query = cfdata->page[i].min_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #define CP(_name) \
|
|
||||||
* if (_conf->_name) \
|
|
||||||
* eina_stringshare_del(_conf->_name); \
|
|
||||||
* _conf->_name = eina_stringshare_add(cfdata->_name);
|
|
||||||
* #define C(_name) _conf->_name = cfdata->_name;
|
|
||||||
*
|
|
||||||
* #undef CP
|
|
||||||
* #undef C */
|
|
||||||
|
|
||||||
e_config_domain_save(_config_domain, _conf_edd, _conf);
|
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -738,4 +737,3 @@ _cat_basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *c
|
||||||
|
|
||||||
return otb;
|
return otb;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item)
|
||||||
Evry_Plugin *pp;
|
Evry_Plugin *pp;
|
||||||
Plugin_Config *pc;
|
Plugin_Config *pc;
|
||||||
Evry_Item *it;
|
Evry_Item *it;
|
||||||
Plugin *p;
|
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
Plugin *p;
|
||||||
|
|
||||||
EVRY_PLUGIN_INSTANCE(p, plugin);
|
EVRY_PLUGIN_INSTANCE(p, plugin);
|
||||||
|
|
||||||
|
@ -103,9 +103,14 @@ evry_plug_collection_init(void)
|
||||||
Evry_Plugin *p;
|
Evry_Plugin *p;
|
||||||
Plugin_Config *pc, *pcc;
|
Plugin_Config *pc, *pcc;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
char path[4096];
|
||||||
|
char title[4096];
|
||||||
|
|
||||||
COLLECTION_PLUGIN = evry_type_register("COLLECTION_PLUGIN");
|
COLLECTION_PLUGIN = evry_type_register("COLLECTION_PLUGIN");
|
||||||
|
|
||||||
|
e_configure_registry_category_add
|
||||||
|
("extensions", 80, _("Extensions"), NULL, "preferences-extensions");
|
||||||
|
|
||||||
EINA_LIST_FOREACH(evry_conf->collections, l, pc)
|
EINA_LIST_FOREACH(evry_conf->collections, l, pc)
|
||||||
{
|
{
|
||||||
p = EVRY_PLUGIN_NEW(Evry_Plugin, N_(pc->name),
|
p = EVRY_PLUGIN_NEW(Evry_Plugin, N_(pc->name),
|
||||||
|
@ -118,6 +123,16 @@ evry_plug_collection_init(void)
|
||||||
{
|
{
|
||||||
p->config->aggregate = EINA_FALSE;
|
p->config->aggregate = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path), "extensions/everything-%s", p->name);
|
||||||
|
|
||||||
|
snprintf(title, sizeof(title), "Everything %s", p->name);
|
||||||
|
|
||||||
|
e_configure_registry_item_add
|
||||||
|
(path, 110, title, NULL, NULL/*icon*/, evry_collection_conf_dialog);
|
||||||
|
|
||||||
|
p->config_path = eina_stringshare_add(path);
|
||||||
|
|
||||||
plugins = eina_list_append(plugins, p);
|
plugins = eina_list_append(plugins, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +143,12 @@ void
|
||||||
evry_plug_collection_shutdown(void)
|
evry_plug_collection_shutdown(void)
|
||||||
{
|
{
|
||||||
Evry_Plugin *p;
|
Evry_Plugin *p;
|
||||||
|
|
||||||
EINA_LIST_FREE(plugins, p)
|
EINA_LIST_FREE(plugins, p)
|
||||||
EVRY_PLUGIN_FREE(p);
|
{
|
||||||
|
e_configure_registry_item_del(p->config_path);
|
||||||
|
eina_stringshare_del(p->config_path);
|
||||||
|
EVRY_PLUGIN_FREE(p);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,6 @@ evry_plugin_find(const char *name)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(evry_conf->conf_subjects, l, pc)
|
EINA_LIST_FOREACH(evry_conf->conf_subjects, l, pc)
|
||||||
{
|
{
|
||||||
if (!pc->enabled) continue;
|
|
||||||
if (!pc->plugin) continue;
|
if (!pc->plugin) continue;
|
||||||
if (pc->name == n)
|
if (pc->name == n)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -983,6 +983,9 @@ _view_update(Evry_View *view)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (v_it->selected && v_it->frame)
|
||||||
|
edje_object_signal_emit
|
||||||
|
(v_it->frame,"e,state,unselected", "e");
|
||||||
v_it->selected = EINA_FALSE;
|
v_it->selected = EINA_FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue