add upload dir action

Thu, 03 Oct 2024 18:24:13 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 03 Oct 2024 18:24:13 +0200
changeset 47
3ac472683246
parent 46
31bc86844659
child 48
ae61523bce20

add upload dir action

application/application.c file | annotate | diff | comparison | revisions
application/application.h file | annotate | diff | comparison | revisions
--- a/application/application.c	Thu Oct 03 18:08:29 2024 +0200
+++ b/application/application.c	Thu Oct 03 18:24:13 2024 +0200
@@ -94,7 +94,13 @@
     ui_toolbar_toggleitem("PreviewPane", .icon = UI_ICON_DOCK_RIGHT);
 
     ui_toolbar_appmenu() {
-        ui_menuitem("TODO", NULL);
+        ui_menuitem("New Window", .onclick = action_window_new);
+        ui_menuseparator();
+        ui_menuitem("Download", .onclick = action_download);
+        ui_menuitem("Upload Files", .onclick = action_upload_file);
+        ui_menuitem("Upload Directory", .onclick = action_upload_dir);
+        ui_menuseparator();
+        ui_menuitem("Settings", .onclick = action_open_settings);
     }
 
     //ui_toolbar_add_default("Home", UI_TOOLBAR_LEFT);
@@ -237,6 +243,10 @@
     ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL);
 }
 
+void action_upload_dir(UiEvent *event, void *data) {
+    ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_FOLDER|UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL);
+}
+
 void action_delete(UiEvent *event, void *data) {
     DavBrowser *browser = event->document;
     UiListSelection sel = ui_list_getselection(browser->resources);
@@ -291,3 +301,7 @@
             .button2_label = "Cancel",
             .result = newfolderdialog_result);
 }
+
+void action_open_settings(UiEvent *event, void *data) {
+    
+}
--- a/application/application.h	Thu Oct 03 18:08:29 2024 +0200
+++ b/application/application.h	Thu Oct 03 18:24:13 2024 +0200
@@ -111,12 +111,16 @@
 
 void action_upload_file(UiEvent *event, void *data);
 
+void action_upload_dir(UiEvent *event, void *data);
+
 void action_delete(UiEvent *event, void *data);
 
 void action_newfile(UiEvent *event, void *data);
 
 void action_mkcol(UiEvent *event, void *data);
 
+void action_open_settings(UiEvent *event, void *data);
+
 #ifdef    __cplusplus
 }
 #endif

mercurial