Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_filedialog.c 


Log Message:
- add show favorites and show dot files to the filedialog menu.
- don't use show favorites as it dosen't have anything in it yet.
  just getting it setup

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filedialog.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_filedialog.c    12 Apr 2006 00:29:04 -0000      1.17
+++ ewl_filedialog.c    12 Apr 2006 01:26:59 -0000      1.18
@@ -10,6 +10,9 @@
 static void ewl_filedialog_cb_icon_view(Ewl_Widget *w, void *ev, void *data);
 static void ewl_filedialog_cb_list_view(Ewl_Widget *w, void *ev, void *data);
 
+static void ewl_filedialog_cb_show_dot(Ewl_Widget *w, void *ev, void *data);
+static void ewl_filedialog_cb_show_favorites(Ewl_Widget *w, void *ev, void 
*data);
+
 /**
  * @return Returns a new open filedialog if successful, NULL on failure.
  * @brief Create a new open filedialog
@@ -62,7 +65,7 @@
 int
 ewl_filedialog_init(Ewl_Filedialog *fd)
 {
-       Ewl_Widget *w, *o;
+       Ewl_Widget *w, *menu, *o;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("fd", fd, FALSE);
@@ -108,20 +111,39 @@
        ewl_container_child_append(EWL_CONTAINER(fd->menu_float), fd->menu);
        ewl_widget_show(fd->menu);
 
+       menu = ewl_menu_new();
+       ewl_button_label_set(EWL_BUTTON(menu), "View");
+       ewl_container_child_append(EWL_CONTAINER(fd->menu), menu);
+       ewl_widget_show(menu);
+
        o = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(o), "Icon view");
-       ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
+       ewl_container_child_append(EWL_CONTAINER(menu), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_filedialog_cb_icon_view, fd);
        ewl_widget_show(o);
 
        o = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(o), "List view");
-       ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
+       ewl_container_child_append(EWL_CONTAINER(menu), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_filedialog_cb_list_view, fd);
        ewl_widget_show(o);
 
+       o = ewl_menu_item_new();
+       ewl_button_label_set(EWL_BUTTON(o), "Show Dot Files");
+       ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
+       ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+                               ewl_filedialog_cb_show_dot, fd);
+       ewl_widget_show(o);
+
+       o = ewl_menu_item_new();
+       ewl_button_label_set(EWL_BUTTON(o), "Show Favorites");
+       ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
+       ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+                               ewl_filedialog_cb_show_favorites, fd);
+       ewl_widget_show(o);
+
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
 
@@ -500,6 +522,38 @@
        fd = data;
        ewl_filedialog_list_view_set(fd, ewl_filelist_list_view_get());
        ewl_widget_hide(fd->menu_float);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static void
+ewl_filedialog_cb_show_dot(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, 
+                                                               void *data)
+{
+       Ewl_Filedialog *fd;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("data", data);
+
+       fd = data;
+       ewl_filedialog_show_dot_files_set(fd,
+                       !ewl_filedialog_show_dot_files_get(fd));
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static void
+ewl_filedialog_cb_show_favorites(Ewl_Widget *w __UNUSED__, 
+                                       void *ev __UNUSED__, void *data)
+{
+       Ewl_Filedialog *fd;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("data", data);
+
+       fd = data;
+       ewl_filedialog_show_favorites_set(fd,
+                       !ewl_filedialog_show_favorites_get(fd));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to