3 * (C) 2008 Vladimir Nadvornik
5 * Author: Laurent Monin
7 * This software is released under the GNU General Public License (GNU GPL).
8 * Please read the included file COPYING for more information.
9 * This software comes with no warranty of any kind, use at your own risk!
15 #include "view_dir_list.h"
16 #include "view_dir_tree.h"
18 GtkRadioActionEntry menu_view_dir_radio_entries[] = {
19 { "FolderList", NULL, N_("List"), "<meta>L", NULL, DIRVIEW_LIST },
20 { "FolderTree", NULL, N_("Tr_ee"), "<control>T", NULL, DIRVIEW_TREE },
23 ViewDir *vd_new(DirViewType type, const gchar *path)
29 case DIRVIEW_LIST: vd = vdlist_new(path); break;
30 case DIRVIEW_TREE: vd = vdtree_new(path); break;
36 void vd_set_select_func(ViewDir *vd,
37 void (*func)(ViewDir *vd, const gchar *path, gpointer data), gpointer data)
39 vd->select_func = func;
40 vd->select_data = data;
43 void vd_set_layout(ViewDir *vd, LayoutWindow *layout)
48 gint vd_set_path(ViewDir *vd, const gchar *path)
54 case DIRVIEW_LIST: ret = vdlist_set_path(vd, path); break;
55 case DIRVIEW_TREE: ret = vdtree_set_path(vd, path); break;
61 void vd_refresh(ViewDir *vd)
65 case DIRVIEW_LIST: return vdlist_refresh(vd);
66 case DIRVIEW_TREE: return vdtree_refresh(vd);
70 const gchar *vd_row_get_path(ViewDir *vd, gint row)
72 const gchar *ret = NULL;
76 case DIRVIEW_LIST: ret = vdlist_row_get_path(vd, row); break;
77 case DIRVIEW_TREE: ret = vdtree_row_get_path(vd, row); break;