forked from enlightenment/enlightenment
'everything'
added simpler history sort modes SVN revision: 42687
This commit is contained in:
parent
ad6f5a29e3
commit
0961d2c507
|
@ -191,6 +191,7 @@ _config_init()
|
||||||
E_CONFIG_VAL(D, T, view_mode, INT);
|
E_CONFIG_VAL(D, T, view_mode, INT);
|
||||||
E_CONFIG_VAL(D, T, view_zoom, INT);
|
E_CONFIG_VAL(D, T, view_zoom, INT);
|
||||||
E_CONFIG_VAL(D, T, cycle_mode, INT);
|
E_CONFIG_VAL(D, T, cycle_mode, INT);
|
||||||
|
E_CONFIG_VAL(D, T, history_sort_mode, INT);
|
||||||
E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd);
|
E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd);
|
||||||
E_CONFIG_LIST(D, T, conf_actions, conf_item_edd);
|
E_CONFIG_LIST(D, T, conf_actions, conf_item_edd);
|
||||||
E_CONFIG_LIST(D, T, conf_objects, conf_item_edd);
|
E_CONFIG_LIST(D, T, conf_objects, conf_item_edd);
|
||||||
|
@ -227,6 +228,7 @@ _config_init()
|
||||||
evry_conf->view_mode = 0;
|
evry_conf->view_mode = 0;
|
||||||
evry_conf->view_zoom = 0;
|
evry_conf->view_zoom = 0;
|
||||||
evry_conf->cycle_mode = 0;
|
evry_conf->cycle_mode = 0;
|
||||||
|
evry_conf->history_sort_mode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: remove - fix old configs */
|
/* TODO: remove - fix old configs */
|
||||||
|
|
|
@ -39,6 +39,8 @@ struct _Config
|
||||||
int view_mode;
|
int view_mode;
|
||||||
int view_zoom;
|
int view_zoom;
|
||||||
|
|
||||||
|
int history_sort_mode;
|
||||||
|
|
||||||
/* use up/down keys for prev/next in thumb view */
|
/* use up/down keys for prev/next in thumb view */
|
||||||
int cycle_mode;
|
int cycle_mode;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@ struct _E_Config_Dialog_Data
|
||||||
int view_mode;
|
int view_mode;
|
||||||
int view_zoom;
|
int view_zoom;
|
||||||
int cycle_mode;
|
int cycle_mode;
|
||||||
|
|
||||||
|
int history_sort_mode;
|
||||||
|
|
||||||
Evas_Object *l_subject;
|
Evas_Object *l_subject;
|
||||||
Evas_Object *l_action;
|
Evas_Object *l_action;
|
||||||
|
@ -73,6 +75,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
C(view_mode);
|
C(view_mode);
|
||||||
C(view_zoom);
|
C(view_zoom);
|
||||||
C(cycle_mode);
|
C(cycle_mode);
|
||||||
|
C(history_sort_mode);
|
||||||
#undef C
|
#undef C
|
||||||
|
|
||||||
EINA_LIST_FOREACH(evry_conf->plugins, l, p)
|
EINA_LIST_FOREACH(evry_conf->plugins, l, p)
|
||||||
|
@ -134,6 +137,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
C(view_mode);
|
C(view_mode);
|
||||||
C(view_zoom);
|
C(view_zoom);
|
||||||
C(cycle_mode);
|
C(cycle_mode);
|
||||||
|
C(history_sort_mode);
|
||||||
#undef C
|
#undef C
|
||||||
|
|
||||||
evry_conf->plugins = eina_list_sort(evry_conf->plugins, -1,
|
evry_conf->plugins = eina_list_sort(evry_conf->plugins, -1,
|
||||||
|
@ -254,7 +258,19 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
ob = e_widget_check_add(evas, _("Up/Down select next item in icon view"),
|
ob = e_widget_check_add(evas, _("Up/Down select next item in icon view"),
|
||||||
&(cfdata->cycle_mode));
|
&(cfdata->cycle_mode));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("History Sort"), 0);
|
||||||
|
rg = e_widget_radio_group_new(&cfdata->history_sort_mode);
|
||||||
|
ob = e_widget_radio_add(evas, "By usage", 0, rg);
|
||||||
|
e_widget_radio_toggle_set(ob, (cfdata->history_sort_mode == 0));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, "Most used", 1, rg);
|
||||||
|
e_widget_radio_toggle_set(ob, (cfdata->history_sort_mode == 1));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, "Last used", 2, rg);
|
||||||
|
e_widget_radio_toggle_set(ob, (cfdata->history_sort_mode == 2));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Commands"), 0);
|
of = e_widget_framelist_add(evas, _("Commands"), 0);
|
||||||
|
|
|
@ -275,7 +275,9 @@ evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, c
|
||||||
{
|
{
|
||||||
if (hi->plugin != it->plugin->name)
|
if (hi->plugin != it->plugin->name)
|
||||||
continue;
|
continue;
|
||||||
|
if (evry_conf->history_sort_mode == 0)
|
||||||
|
{
|
||||||
|
|
||||||
if (!input || !hi->input)
|
if (!input || !hi->input)
|
||||||
{
|
{
|
||||||
it->usage += hi->usage * hi->count;
|
it->usage += hi->usage * hi->count;
|
||||||
|
@ -297,6 +299,16 @@ evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, c
|
||||||
if (hi->context == ctxt)
|
if (hi->context == ctxt)
|
||||||
it->usage += hi->usage * hi->count * 2;
|
it->usage += hi->usage * hi->count * 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (evry_conf->history_sort_mode == 1)
|
||||||
|
{
|
||||||
|
it->usage = hi->count * (hi->last_used / 10000000000.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (evry_conf->history_sort_mode == 2)
|
||||||
|
{
|
||||||
|
it->usage = hi->last_used;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it->usage > 0.0)
|
if (it->usage > 0.0)
|
||||||
|
|
Loading…
Reference in New Issue