diff -r 915131bc3233 -r 40d6af793c1a application/application.c --- a/application/application.c Thu Feb 08 10:35:07 2024 +0100 +++ b/application/application.c Fri Feb 09 16:50:23 2024 +0100 @@ -88,7 +88,7 @@ ui_toolbar_item("NewFile", .icon = "Add"); ui_toolbar_item("Upload", .label = "Upload", .icon = "Upload", .onclick = action_upload_file); ui_toolbar_item("Download", .icon = "SaveLocal"); - ui_toolbar_item("Remove", .icon = "Delete"); + ui_toolbar_item("Remove", .icon = "Delete", .onclick = action_delete ); ui_toolbar_toggleitem("LocalBrowser", .icon = "DockLeft", .label = "Local Browser"); ui_toolbar_toggleitem("PreviewPane", .icon = "DockRight"); @@ -177,3 +177,12 @@ void action_upload_file(UiEvent *event, void *data) { ui_openfiledialog(event->obj, 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); + if (sel.count > 0) { + davbrowser_delete(event->obj, browser, sel); + } + ui_listselection_free(sel); +}