void gui_browser_init ( void   ) 

Initialize the filebrowser window.

Definition at line 113 of file gui_browser.c.

00114 {
00115         const char *defdir;
00116         char *cwd;
00117 
00118         win_dirname = newwin(1, 0, GUI_SIZE_BROWSER_DIRNAME_TOP, 0);
00119         clearok(win_dirname, TRUE);
00120         if (gui_draw_colors)
00121                 wbkgdset(win_dirname, COLOR_PAIR(GUI_COLOR_BAR));
00122         else
00123                 wbkgdset(win_dirname, A_REVERSE);
00124 
00125         win_browser = gui_vfslist_new(0);
00126         gui_vfslist_setfocus(win_browser, 1);
00127         gui_vfslist_setcallback(win_browser, gui_browser_dirname_refresh);
00128         gui_browser_dirname_refresh();
00129 
00130         defdir = config_getopt("gui.browser.defaultpath");
00131         if (defdir[0] != '\0') {
00132                 /* Open predefined directory */
00133                 vr_curdir = vfs_lookup(defdir, NULL, NULL, 0);
00134         } else {
00135                 /* Open current directory */
00136                 cwd = g_get_current_dir();
00137                 vr_curdir = vfs_lookup(cwd, NULL, NULL, 1);
00138                 g_free(cwd);
00139         }
00140 
00141         if (vr_curdir != NULL) {
00142                 vfs_populate(vr_curdir);
00143                 gui_vfslist_setlist(win_browser, vfs_population(vr_curdir));
00144         } else {
00145                 gui_msgbar_warn(_("Unable to open initial directory."));
00146         }
00147         gui_vfslist_move(win_browser, 0, GUI_SIZE_BROWSER_TOP,
00148             COLS, GUI_SIZE_BROWSER_HEIGHT);
00149 }

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:21 2010 for herrie by  doxygen 1.6.3