#include <sys/stat.h>
#include <cx/array_list.h>
+#include <cx/printf.h>
FileBrowser* filebrowser_new(const char *url) {
memset(section, 0, sizeof(FilesSection));
section->files = op->result;
section->parent_url = op->url;
- op->result = NULL;
- op->url = NULL;
// update_grid takes ownership of section
if(browser->update_grid) {
ui_list_append(browser->list_files, file);
}
browser->list_files_parent = op->url;
- op->url = NULL;
ui_list_update(browser->list_files);
- op->result = NULL;
}
+
+ op->result = NULL;
+ op->url = NULL;
} else {
- // TODO: error msg
+ cxmutstr errormsg = cx_asprintf("Cannot open directory: %s", strerror(op->error));
+
+ ui_dialog(browser->window->obj,
+ .title = "Error",
+ .content = errormsg.ptr,
+ .closebutton_label = "OK");
+
+ free(errormsg.ptr);
}
cxListFree(op->result);
mz_update_files_view((MzFilesView*)win->files_gridview, sections, numsections);
}
-#ifdef UI_LIBADWAITA
-
-void libadwaita_headerbar_add() {
-
-}
-
-#endif
-
UiObject* window_create(const char *url) {
// toplevel window object
UiObject *obj = ui_sidebar_window("Mizunara");