Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_filelist.c ewl_filelist.h ewl_filelist_column.c
Log Message:
- change the column file list to show when selecting multiple files instead
of always showing the last selected file information (bug 57)
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_filelist.c 23 Aug 2007 05:26:51 -0000 1.35
+++ ewl_filelist.c 10 Nov 2007 04:16:38 -0000 1.36
@@ -446,6 +446,33 @@
}
/**
+ * @param fl: The filelist to work with
+ * @return Return the widget to display
+ * @brief Sets up a widget to display when multiple files selected
+ */
+Ewl_Widget *
+ewl_filelist_multi_select_preview_get(Ewl_Filelist *fl)
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("fl", fl, NULL);
+ DCHECK_TYPE_RET("fl", fl, EWL_FILELIST_TYPE, NULL);
+
+ Ewl_Widget *box, *icon;
+
+ box = ewl_vbox_new();
+ ewl_widget_show(box);
+
+ icon = ewl_icon_simple_new();
+ ewl_box_orientation_set(EWL_BOX(icon),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_icon_label_set(EWL_ICON(icon), "Multiple files selected");
+ ewl_container_child_append(EWL_CONTAINER(box), icon);
+ ewl_widget_show(icon);
+
+ DRETURN_PTR(box, DLEVEL_STABLE);
+}
+
+/**
* @param fl: The filelist to set the selected files into
* @param files: The Ecore_List of files to set
* @return Returns no value.
@@ -490,6 +517,8 @@
DCHECK_TYPE_RET("fl", fl, EWL_FILELIST_TYPE, NULL);
selected = ecore_list_new();
+ ecore_list_free_cb_set(selected, free);
+
ecore_list_first_goto(fl->selected);
while ((item = ecore_list_next(fl->selected)))
{
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_filelist.h 23 Aug 2007 05:26:51 -0000 1.18
+++ ewl_filelist.h 10 Nov 2007 04:16:38 -0000 1.19
@@ -118,6 +118,8 @@
char *ewl_filelist_modtime_get(time_t modtime);
Ewl_Widget *ewl_filelist_selected_file_preview_get(Ewl_Filelist *fl,
const char *path);
+Ewl_Widget *ewl_filelist_multi_select_preview_get(Ewl_Filelist *fl);
+
void ewl_filelist_selected_files_set(Ewl_Filelist *fl,
Ecore_List *files);
Ecore_List *ewl_filelist_selected_files_get(Ewl_Filelist *fl);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_column.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_filelist_column.c 23 Aug 2007 05:26:51 -0000 1.36
+++ ewl_filelist_column.c 10 Nov 2007 04:16:38 -0000 1.37
@@ -414,6 +414,7 @@
char path[PATH_MAX];
Ewl_Widget *parent;
Ewl_Container *dir_parent;
+ Ecore_List *selected;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -447,12 +448,20 @@
"icon,select", "icon,unselect");
if (fl->preview) ewl_widget_destroy(fl->preview);
- fl->preview = ewl_filelist_selected_file_preview_get(EWL_FILELIST(data),
-
ewl_icon_label_get(EWL_ICON(w)));
+
+ selected = ewl_filelist_selected_files_get(EWL_FILELIST(fl));
+ if (ecore_list_count(selected) == 1)
+ fl->preview =
ewl_filelist_selected_file_preview_get(EWL_FILELIST(data),
+
ewl_icon_label_get(EWL_ICON(w)));
+ else
+ fl->preview =
ewl_filelist_multi_select_preview_get(EWL_FILELIST(data));
+
ewl_object_fill_policy_set(EWL_OBJECT(fl->preview),
EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
ewl_container_child_append(EWL_CONTAINER(fl), fl->preview);
ewl_widget_show(fl->preview);
+
+ ecore_list_destroy(selected);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs