forked from enlightenment/enlightenment
double click on open - with items in ilist or fm2 list and e will auto-open
SVN revision: 26818
This commit is contained in:
parent
974650ba81
commit
6dccf5b119
|
@ -19,7 +19,14 @@ static void _e_fwin_menu_extend(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_I
|
||||||
static void _e_fwin_parent(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _e_fwin_parent(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
static void _e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file);
|
static void _e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file);
|
||||||
|
|
||||||
static void _e_fwin_cb_ilist_change(void *data, Evas_Object *obj);
|
static void _e_fwin_cb_ilist_change(void *data);
|
||||||
|
static void _e_fwin_cb_ilist_selected(void *data, Evas_Object *obj, void *event_info);
|
||||||
|
static void _e_fwin_cb_fm_selection_change(void *data, Evas_Object *obj, void *event_info);
|
||||||
|
static void _e_fwin_cb_fm_selected(void *data, Evas_Object *obj, void *event_info);
|
||||||
|
static void _e_fwin_cb_open(void *data, E_Dialog *dia);
|
||||||
|
static void _e_fwin_cb_close(void *data, E_Dialog *dia);
|
||||||
|
static void _e_fwin_cb_dialog_free(void *obj);
|
||||||
|
static Evas_Bool _e_fwin_cb_hash_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||||
static void _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files);
|
static void _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files);
|
||||||
|
|
||||||
/* local subsystem globals */
|
/* local subsystem globals */
|
||||||
|
@ -145,6 +152,11 @@ e_fwin_new(E_Container *con, const char *dev, const char *path)
|
||||||
static void
|
static void
|
||||||
_e_fwin_free(E_Fwin *fwin)
|
_e_fwin_free(E_Fwin *fwin)
|
||||||
{
|
{
|
||||||
|
if (fwin->fad)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(fwin->fad->dia));
|
||||||
|
fwin->fad = NULL;
|
||||||
|
}
|
||||||
e_object_del(E_OBJECT(fwin->win));
|
e_object_del(E_OBJECT(fwin->win));
|
||||||
fwins = evas_list_remove(fwins, fwin);
|
fwins = evas_list_remove(fwins, fwin);
|
||||||
free(fwin);
|
free(fwin);
|
||||||
|
@ -229,7 +241,8 @@ _e_fwin_parent(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
e_fm2_parent_go(data);
|
e_fm2_parent_go(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* KILL: this func will die as soon as ecore_desktops's cmd thing works
|
||||||
|
* perfectly */
|
||||||
static void
|
static void
|
||||||
_e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file)
|
_e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file)
|
||||||
{
|
{
|
||||||
|
@ -291,24 +304,8 @@ _e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file)
|
||||||
e_zone_exec(fwin->win->border->zone, buf);
|
e_zone_exec(fwin->win->border->zone, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _E_Fwin_Apps_Dialog E_Fwin_Apps_Dialog;
|
|
||||||
|
|
||||||
struct _E_Fwin_Apps_Dialog
|
|
||||||
{
|
|
||||||
E_Dialog *dia;
|
|
||||||
E_Fwin *fwin;
|
|
||||||
char *app1, *app2;
|
|
||||||
Evas_Object *o_ilist, *o_fm;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_fwin_cb_ilist_change(void *data, Evas_Object *obj)
|
_e_fwin_cb_ilist_change(void *data)
|
||||||
{
|
{
|
||||||
E_Fwin_Apps_Dialog *fad;
|
E_Fwin_Apps_Dialog *fad;
|
||||||
|
|
||||||
|
@ -317,6 +314,15 @@ _e_fwin_cb_ilist_change(void *data, Evas_Object *obj)
|
||||||
if (fad->o_fm) e_fm2_select_set(fad->o_fm, NULL, 0);
|
if (fad->o_fm) e_fm2_select_set(fad->o_fm, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_fwin_cb_ilist_selected(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
E_Fwin_Apps_Dialog *fad;
|
||||||
|
|
||||||
|
fad = data;
|
||||||
|
_e_fwin_cb_open(fad, fad->dia);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_fwin_cb_fm_selection_change(void *data, Evas_Object *obj, void *event_info)
|
_e_fwin_cb_fm_selection_change(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -337,6 +343,15 @@ _e_fwin_cb_fm_selection_change(void *data, Evas_Object *obj, void *event_info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_fwin_cb_fm_selected(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
E_Fwin_Apps_Dialog *fad;
|
||||||
|
|
||||||
|
fad = data;
|
||||||
|
_e_fwin_cb_open(fad, fad->dia);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_fwin_cb_open(void *data, E_Dialog *dia)
|
_e_fwin_cb_open(void *data, E_Dialog *dia)
|
||||||
{
|
{
|
||||||
|
@ -366,6 +381,10 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
|
||||||
for (l = selected; l; l = l->next)
|
for (l = selected; l; l = l->next)
|
||||||
{
|
{
|
||||||
ici = l->data;
|
ici = l->data;
|
||||||
|
/* this snprintf is silly - but it's here in case i really do
|
||||||
|
* need to provide full paths (seems silly since we chdir
|
||||||
|
* into the dir)
|
||||||
|
*/
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
if (!((ici->link) && (ici->mount)))
|
if (!((ici->link) && (ici->mount)))
|
||||||
{
|
{
|
||||||
|
@ -401,7 +420,7 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
|
||||||
}
|
}
|
||||||
chdir(pcwd);
|
chdir(pcwd);
|
||||||
}
|
}
|
||||||
e_object_del(fad->dia);
|
e_object_del(E_OBJECT(fad->dia));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -410,7 +429,7 @@ _e_fwin_cb_close(void *data, E_Dialog *dia)
|
||||||
E_Fwin_Apps_Dialog *fad;
|
E_Fwin_Apps_Dialog *fad;
|
||||||
|
|
||||||
fad = data;
|
fad = data;
|
||||||
e_object_del(fad->dia);
|
e_object_del(E_OBJECT(fad->dia));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -423,6 +442,7 @@ _e_fwin_cb_dialog_free(void *obj)
|
||||||
fad = dia->data;
|
fad = dia->data;
|
||||||
E_FREE(fad->app1);
|
E_FREE(fad->app1);
|
||||||
E_FREE(fad->app2);
|
E_FREE(fad->app2);
|
||||||
|
fad->fwin->fad = NULL;
|
||||||
free(fad);
|
free(fad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +473,12 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
int need_dia = 0;
|
int need_dia = 0;
|
||||||
Evas_Hash *mimes = NULL;
|
Evas_Hash *mimes = NULL;
|
||||||
Evas_List *mlist = NULL;
|
Evas_List *mlist = NULL;
|
||||||
|
|
||||||
|
if (fwin->fad)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(fwin->fad->dia));
|
||||||
|
fwin->fad = NULL;
|
||||||
|
}
|
||||||
for (l = files; l; l = l->next)
|
for (l = files; l; l = l->next)
|
||||||
{
|
{
|
||||||
ici = l->data;
|
ici = l->data;
|
||||||
|
@ -523,10 +548,6 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
* are multiple or no previously used app for this mime - then open
|
* are multiple or no previously used app for this mime - then open
|
||||||
* dialog
|
* dialog
|
||||||
*/
|
*/
|
||||||
/* FIXME: double click on fm2 or ilist entry shoudl implicitly be
|
|
||||||
* open. need to add callback for fm2 and make ilist handle double
|
|
||||||
* click stuff
|
|
||||||
*/
|
|
||||||
|
|
||||||
fad = E_NEW(E_Fwin_Apps_Dialog, 1);
|
fad = E_NEW(E_Fwin_Apps_Dialog, 1);
|
||||||
dia = e_dialog_new(fwin->win->border->zone->container,
|
dia = e_dialog_new(fwin->win->border->zone->container,
|
||||||
|
@ -540,6 +561,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
|
|
||||||
fad->dia = dia;
|
fad->dia = dia;
|
||||||
fad->fwin = fwin;
|
fad->fwin = fwin;
|
||||||
|
fwin->fad = fad;
|
||||||
dia->data = fad;
|
dia->data = fad;
|
||||||
e_object_free_attach_func_set(E_OBJECT(dia), _e_fwin_cb_dialog_free);
|
e_object_free_attach_func_set(E_OBJECT(dia), _e_fwin_cb_dialog_free);
|
||||||
|
|
||||||
|
@ -566,6 +588,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
e_widget_min_size_set(o, 160, 240);
|
e_widget_min_size_set(o, 160, 240);
|
||||||
e_widget_framelist_object_append(of, o);
|
e_widget_framelist_object_append(of, o);
|
||||||
e_widget_list_object_append(ocon, of, 1, 1, 0.5);
|
e_widget_list_object_append(ocon, of, 1, 1, 0.5);
|
||||||
|
evas_object_smart_callback_add(o, "selected",
|
||||||
|
_e_fwin_cb_ilist_selected, fad);
|
||||||
}
|
}
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("All Applications"), 0);
|
of = e_widget_framelist_add(evas, _("All Applications"), 0);
|
||||||
|
@ -592,6 +616,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
e_fm2_config_set(mt, &fmc);
|
e_fm2_config_set(mt, &fmc);
|
||||||
evas_object_smart_callback_add(mt, "selection_change",
|
evas_object_smart_callback_add(mt, "selection_change",
|
||||||
_e_fwin_cb_fm_selection_change, fad);
|
_e_fwin_cb_fm_selection_change, fad);
|
||||||
|
evas_object_smart_callback_add(mt, "selected",
|
||||||
|
_e_fwin_cb_fm_selected, fad);
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all", e_user_homedir_get());
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all", e_user_homedir_get());
|
||||||
e_fm2_path_set(mt, buf, "/");
|
e_fm2_path_set(mt, buf, "/");
|
||||||
o = e_widget_scrollframe_pan_add(evas, mt,
|
o = e_widget_scrollframe_pan_add(evas, mt,
|
||||||
|
@ -606,6 +632,5 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
|
||||||
e_widget_min_size_get(ocon, &mw, &mh);
|
e_widget_min_size_get(ocon, &mw, &mh);
|
||||||
e_dialog_content_set(dia, ocon, mw, mh);
|
e_dialog_content_set(dia, ocon, mw, mh);
|
||||||
|
|
||||||
/* FIXME: store fad in fwin (on fwin delete close fad. on fad close, delete from fwin) */
|
|
||||||
e_dialog_show(dia);
|
e_dialog_show(dia);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#ifdef E_TYPEDEFS
|
#ifdef E_TYPEDEFS
|
||||||
|
|
||||||
typedef struct _E_Fwin E_Fwin;
|
typedef struct _E_Fwin E_Fwin;
|
||||||
|
typedef struct _E_Fwin_Apps_Dialog E_Fwin_Apps_Dialog;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#ifndef E_FWIN_H
|
#ifndef E_FWIN_H
|
||||||
|
@ -19,6 +20,15 @@ struct _E_Fwin
|
||||||
Evas_Object *scrollframe_obj;
|
Evas_Object *scrollframe_obj;
|
||||||
Evas_Object *fm_obj;
|
Evas_Object *fm_obj;
|
||||||
Evas_Object *bg_obj;
|
Evas_Object *bg_obj;
|
||||||
|
E_Fwin_Apps_Dialog *fad;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _E_Fwin_Apps_Dialog
|
||||||
|
{
|
||||||
|
E_Dialog *dia;
|
||||||
|
E_Fwin *fwin;
|
||||||
|
char *app1, *app2;
|
||||||
|
Evas_Object *o_ilist, *o_fm;
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI int e_fwin_init (void);
|
EAPI int e_fwin_init (void);
|
||||||
|
|
|
@ -440,6 +440,8 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
||||||
|
evas_object_smart_callback_call(si->sd->smart_obj, "selected", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -23,6 +23,7 @@ static void _e_wid_focus_hook(Evas_Object *obj);
|
||||||
static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
static void _e_wid_cb_item_sel(void *data, void *data2);
|
static void _e_wid_cb_item_sel(void *data, void *data2);
|
||||||
static void _e_wid_cb_item_hilight(void *data, void *data2);
|
static void _e_wid_cb_item_hilight(void *data, void *data2);
|
||||||
|
static void _e_wid_cb_selected(void *data, Evas_Object *obj, void *event_info);
|
||||||
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
|
@ -55,6 +56,8 @@ e_widget_ilist_add(Evas *evas, int icon_w, int icon_h, char **value)
|
||||||
e_scrollframe_child_set(wd->o_scrollframe, o);
|
e_scrollframe_child_set(wd->o_scrollframe, o);
|
||||||
e_widget_sub_object_add(obj, o);
|
e_widget_sub_object_add(obj, o);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
evas_object_smart_callback_add(o, "selected", _e_wid_cb_selected, obj);
|
||||||
|
|
||||||
|
|
||||||
evas_object_resize(obj, 32, 32);
|
evas_object_resize(obj, 32, 32);
|
||||||
e_widget_min_size_set(obj, 32, 32);
|
e_widget_min_size_set(obj, 32, 32);
|
||||||
|
@ -352,6 +355,12 @@ _e_wid_cb_item_hilight(void *data, void *data2)
|
||||||
e_scrollframe_child_region_show(wd->o_scrollframe, x, y, w, h);
|
e_scrollframe_child_region_show(wd->o_scrollframe, x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_wid_cb_selected(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
evas_object_smart_callback_call(data, "selected", event_info);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue