Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_fm.c e_fm.h e_test.c e_widget_list.c
Log Message:
more fm work - fix list append too
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- e_fm.c 17 Jul 2006 19:51:37 -0000 1.9
+++ e_fm.c 19 Jul 2006 19:38:29 -0000 1.10
@@ -185,22 +185,28 @@
if (sd->config) _e_fm2_config_free(sd->config);
sd->config = E_NEW(E_Fm2_Config, 1);
if (!sd->config) return;
- sd->config->view.mode = E_FM2_VIEW_MODE_ICONS;
-// sd->config->view.mode = E_FM2_VIEW_MODE_LIST;
+// sd->config->view.mode = E_FM2_VIEW_MODE_ICONS;
+ sd->config->view.mode = E_FM2_VIEW_MODE_LIST;
+ sd->config->view.open_dirs_in_place = 1;
+ sd->config->view.selector = 1;
+ sd->config->view.single_click = 0;
+ sd->config->view.no_subdir_jump = 0;
sd->config->icon.icon.w = 64;
sd->config->icon.icon.h = 64;
sd->config->icon.list.w = 24;
sd->config->icon.list.h = 24;
- sd->config->icon.fixed.w = 0;
+ sd->config->icon.fixed.w = 1;
sd->config->icon.fixed.h = 1;
- sd->config->list.sort.no_case = 1;
sd->config->icon.extension.show = 0;
+ sd->config->list.sort.no_case = 1;
sd->config->list.sort.dirs.first = 1;
sd->config->list.sort.dirs.last = 1;
sd->config->selection.single = 0;
sd->config->selection.windows_modifiers = 0;
- sd->config->view.open_dirs_in_place = 0;
- sd->config->view.selector = 0;
+ sd->config->theme.background = NULL;
+ sd->config->theme.frame = NULL;
+ sd->config->theme.icons = NULL;
+ sd->config->theme.fixed = 0;
_e_fm2_scan_stop(obj);
_e_fm2_queue_free(obj);
@@ -215,6 +221,7 @@
sd->realpath = _e_fm2_dev_path_map(sd->dev, sd->path);
printf("FM: %s\n", sd->realpath);
_e_fm2_scan_start(obj);
+ evas_object_smart_callback_call(obj, "changed", NULL);
}
EAPI void
@@ -232,29 +239,41 @@
if (path) *path = sd->path;
}
-/*
EAPI int
-e_fm2_parent_go(Evas_Object *obj)
+e_fm2_has_parent_get(Evas_Object *obj)
{
E_Fm2_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
- if (!sd) return; // safety
- if (!evas_object_type_get(obj)) return; // safety
- if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
+ if (!sd) return 0; // safety
+ if (!evas_object_type_get(obj)) return 0; // safety
+ if (strcmp(evas_object_type_get(obj), "e_fm")) return 0; // safety
+ if (!sd->path) return 0;
+ if ((sd->path[0] == 0) || (!strcmp(sd->path, "/"))) return 0;
+ return 1;
}
-EAPI int
-e_fm2_has_parent_get(Evas_Object *obj)
+EAPI void
+e_fm2_parent_go(Evas_Object *obj)
{
E_Fm2_Smart_Data *sd;
+ char *path, *dev = NULL, *p;
sd = evas_object_smart_data_get(obj);
if (!sd) return; // safety
if (!evas_object_type_get(obj)) return; // safety
if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
+ if (!sd->path) return;
+ path = strdup(sd->path);
+ if (sd->dev) dev = strdup(sd->dev);
+ p = strrchr(path, '/');
+ if (p) *p = 0;
+ e_fm2_path_set(obj, dev, path);
+ E_FREE(dev);
+ E_FREE(path);
}
+/*
EAPI void
e_fm2_config_set(Evas_Object *obj, E_Fm2_Config *cfg)
{
@@ -1242,6 +1261,23 @@
{
/* if its a directory && open dirs in-place is set then change the dir
* to be the dir + file */
+ if ((S_ISDIR(ic->st.st_mode)) &&
+ (ic->sd->config->view.open_dirs_in_place) &&
+ (!ic->sd->config->view.no_subdir_jump) &&
+ (!ic->sd->config->view.single_click)
+ )
+ {
+ char buf[4096], *dev = NULL;
+
+ if (ic->sd->dev) dev = strdup(ic->sd->dev);
+ snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->file);
+ e_fm2_path_set(ic->sd->obj, dev, buf);
+ E_FREE(dev);
+ }
+ else
+ {
+ evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
+ }
/* if its in file selector mode then signal that a selection has
* taken place and dont do anything more */
@@ -1328,6 +1364,12 @@
_e_fm2_icon_deselect(ic);
else
_e_fm2_icon_select(ic);
+ if (!(S_ISDIR(ic->st.st_mode)) &&
+ (ic->sd->config->view.single_click)
+ )
+ {
+ evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
+ }
}
else if (ev->button == 3)
{
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_fm.h 17 Jul 2006 10:31:50 -0000 1.4
+++ e_fm.h 19 Jul 2006 19:38:29 -0000 1.5
@@ -28,6 +28,8 @@
E_Fm2_View_Mode mode;
unsigned char open_dirs_in_place;
unsigned char selector;
+ unsigned char single_click;
+ unsigned char no_subdir_jump;
} view;
/* display of icons */
struct {
@@ -84,7 +86,9 @@
EAPI Evas_Object *e_fm2_add(Evas *evas);
EAPI void e_fm2_path_set(Evas_Object *obj, char *dev, char
*path);
EAPI void e_fm2_path_get(Evas_Object *obj, const char **dev,
const char **path);
-
+EAPI int e_fm2_has_parent_get(Evas_Object *obj);
+EAPI void e_fm2_parent_go(Evas_Object *obj);
+
EAPI void e_fm2_pan_set(Evas_Object *obj, Evas_Coord x,
Evas_Coord y);
EAPI void e_fm2_pan_get(Evas_Object *obj, Evas_Coord *x,
Evas_Coord *y);
EAPI void e_fm2_pan_max_get(Evas_Object *obj, Evas_Coord *x,
Evas_Coord *y);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_test.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_test.c 16 Jul 2006 17:27:21 -0000 1.52
+++ e_test.c 19 Jul 2006 19:38:29 -0000 1.53
@@ -586,24 +586,55 @@
}
#elif 0
static void
+_e_test_cb_button(void *data1, void *data2)
+{
+ e_fm2_parent_go(data1);
+}
+
+static void
+_e_test_cb_changed(void *data, Evas_Object *obj, void *event_info)
+{
+ if (!e_fm2_has_parent_get(obj)) e_widget_disabled_set(data, 1);
+ else e_widget_disabled_set(data, 0);
+}
+
+static void
+_e_test_cb_selected(void *data, Evas_Object *obj, void *event_info)
+{
+ printf("SELECTED!\n");
+}
+
+static void
_e_test_internal(E_Container *con)
{
E_Dialog *dia;
- Evas_Object *o, *o2;
+ Evas_Object *o, *o2, *o3;
dia = e_dialog_new(con);
e_dialog_title_set(dia, "A Test Dialog");
-
+
o = e_fm2_add(dia->win->evas);
e_fm2_path_set(o, "~/", "/pix/bg");
- evas_object_show(o);
+ o3 = e_widget_list_add(dia->win->evas, 0, 0);
+
+ o2 = e_widget_button_add(dia->win->evas, "Up a directory", NULL,
+ _e_test_cb_button, o, NULL);
+ evas_object_show(o2);
+ e_widget_list_object_append(o3, o2, 1, 0, 0.5);
+
+ evas_object_smart_callback_add(o, "changed", _e_test_cb_changed, o2);
+ evas_object_smart_callback_add(o, "selected", _e_test_cb_selected, NULL);
+
+ evas_object_show(o);
o2 = e_scrollframe_add(dia->win->evas);
evas_object_show(o2);
e_scrollframe_extern_pan_set(o2, o,
e_fm2_pan_set, e_fm2_pan_get,
e_fm2_pan_max_get, e_fm2_pan_child_size_get);
- e_dialog_content_set(dia, o2, 64, 64);
+ e_widget_list_object_append(o3, o2, 1, 1, 0.5);
+
+ e_dialog_content_set(dia, o3, 128, 128);
e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
e_dialog_resizable_set(dia, 1);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_list.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_widget_list.c 7 Jan 2006 10:39:45 -0000 1.4
+++ e_widget_list.c 19 Jul 2006 19:38:29 -0000 1.5
@@ -46,6 +46,7 @@
wd = e_widget_data_get(obj);
e_box_pack_end(wd->o_box, sobj);
+ mw = mh = 0;
e_widget_min_size_get(sobj, &mw, &mh);
if (e_box_orientation_get(wd->o_box) == 1)
e_box_pack_options_set(sobj,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs