#define EVRY_ASYNC_UPDATE_ADD 0
#define EVRY_ASYNC_UPDATE_CLEAR 1
+#define EVRY_ASYNC_UPDATE_REFRESH 2
extern int _e_module_evry_log_dom;
const char *trigger;
- /* whether the plugin uses evry_async_update to add new items */
- int async_fetch;
-
/* list of items visible for everything */
Eina_List *items;
Evas_Object *(*config_page) (Evry_Plugin *p);
void (*config_apply) (Evry_Plugin *p);
+ /* show in aggregator. default is TRUE */
+ Eina_Bool aggregate;
+
+ /* whether the plugin uses evry_async_update to add new
+ items. default is FALSE */
+ Eina_Bool async_fetch;
+
/* not to be set by plugin! */
Plugin_Config *config;
};
/* use icon name from theme */
const char *icon;
+ void *data;
+
int priority;
};
static Eina_Bool list_cb(Eina_Module *m, void *data)
{
- if (eina_module_load(m))
- return EINA_TRUE;
+ int err;
+
+ if ((err = eina_module_load(m)))
+ {
+ return EINA_TRUE;
+ }
+ ERR("loading failed (%d), %s", err, eina_module_file_get(m));
return EINA_FALSE;
}
evry_conf->scroll_animate = 0;
evry_conf->scroll_speed = 0.08;
evry_conf->hide_input = 0;
- evry_conf->hide_list = 1;
+ evry_conf->hide_list = 0;
evry_conf->quick_nav = 1;
evry_conf->conf_subjects = NULL;
evry_conf->conf_actions = NULL;
p->action = action;
p->config_page = config_page;
p->config_apply = config_apply;
-
+ p->aggregate = EINA_TRUE;
+ p->async_fetch = EINA_FALSE;
+
return p;
}
{
Evry_State *s = (Evry_State *)state;
+ if (!s && it && selector && selector->state)
+ {
+ s = selector->state;
+ if (s->plugin != it->plugin)
+ return;
+ }
+
s->plugin_auto_selected = EINA_FALSE;
s->item_auto_selected = EINA_FALSE;
+
_evry_item_sel(s, it);
_evry_selector_update(selector);
}
}
/* update aggregator */
- if (eina_list_count(s->cur_plugins) > 0)
+ if ((eina_list_count(s->cur_plugins) > 1 ) ||
+ /* add aggregator for actions */
+ (selector == selectors[1] &&
+ (eina_list_count(s->cur_plugins) > 0 )))
{
/* add aggregator */
if (!(s->cur_plugins->data == agg))
_evry_view_update(s, NULL);
}
- else if (action == EVRY_ASYNC_UPDATE_CLEAR)
+ else if (action == EVRY_ASYNC_UPDATE_REFRESH)
{
-
+ _evry_view_clear(s);
+ _evry_view_update(s, NULL);
}
}
{
EINA_LIST_FOREACH(lp, l, pp)
{
+ if (!pp->aggregate) continue;
+
EINA_LIST_FOREACH(pp->items, ll, it)
{
if (!it->fuzzy_match)
{
EINA_LIST_FOREACH(lp, l, pp)
{
+ if (!pp->aggregate) continue;
+
for (cnt = 0, ll = pp->items; ll && cnt < 50; ll = ll->next, cnt++)
{
if (!eina_list_data_find_list(items, ll->data))
EINA_LIST_FOREACH(lp, l, pp)
{
+ if (!pp->aggregate) continue;
+
EINA_LIST_FOREACH(pp->items, ll, it)
{
if (evry_history_item_usage_set(p->selector->history, it, input, context) &&
if (lp && ((eina_list_count(lp) == 2) || (!EVRY_PLUGIN(p)->items)))
{
pp = lp->data;
- EINA_LIST_FOREACH(pp->items, l, it)
+
+ if (pp->aggregate)
{
- if (!eina_list_data_find_list(items, it))
+ EINA_LIST_FOREACH(pp->items, l, it)
{
- evry_item_ref(it);
- it->fuzzy_match = 0;
- EVRY_PLUGIN_ITEM_APPEND(p, it);
+ if (!eina_list_data_find_list(items, it))
+ {
+ evry_item_ref(it);
+ it->fuzzy_match = 0;
+ EVRY_PLUGIN_ITEM_APPEND(p, it);
+ }
}
}
}
if (it_file)
{
ITEM_FILE(file, it_file);
- int len;
- len = strlen(app->file) + strlen(file->uri) + 2;
+ /* files = eina_list_append(files, file->uri);
+ *
+ * e_exec(zone, NULL, app->file, files, NULL);
+ *
+ * if (files)
+ * eina_list_free(files); */
+
+ char *tmp;
+ int len;
+ tmp = eina_str_escape(file->uri);
+ len = strlen(app->file) + strlen(tmp) + 2;
exe = malloc(len);
- snprintf(exe, len, "%s %s", app->file, file->uri);
+ snprintf(exe, len, "%s %s", app->file, tmp);
e_exec(zone, NULL, exe, NULL, NULL);
- free(exe);
+ E_FREE(exe);
+ E_FREE(tmp);
}
else
{
"accessories-dictionary", TRIGGER,
NULL, _cleanup, _fetch, NULL, NULL, NULL, NULL);
+ EVRY_PLUGIN(p)->aggregate = EINA_FALSE;
+
evry_plugin_register(EVRY_PLUGIN(p), 100);
plugin = p;
p1 = evry_plugin_new(NULL, "Calculator", type_subject, NULL, "TEXT", 1, "accessories-calculator", "=",
_begin, _cleanup, _fetch, _action, NULL, NULL, NULL);
+ p1->aggregate = EINA_FALSE;
+
evry_plugin_register(p1, 0);
return EINA_TRUE;
Item *it;
_clear_items(v->span);
+ if (sd->items) eina_list_free(sd->items);
+ sd->items = NULL;
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
sd->idle_enter = ecore_idle_enterer_before_add(_e_smart_reconfigure_do, v->span);
Eina_List *l, *ll, *p_items, *v_remove = NULL, *v_items = NULL;
int pos, last_pos, last_vis = 0, first_vis = 0;
Eina_Bool update = EINA_FALSE;
-
+
if (!v->state->plugin)
{
_view_clear(view);