86 } |
86 } |
87 ui_toolbar_item("NewFolder", .icon = "NewFolder"); |
87 ui_toolbar_item("NewFolder", .icon = "NewFolder"); |
88 ui_toolbar_item("NewFile", .icon = "Add"); |
88 ui_toolbar_item("NewFile", .icon = "Add"); |
89 ui_toolbar_item("Upload", .label = "Upload", .icon = "Upload", .onclick = action_upload_file); |
89 ui_toolbar_item("Upload", .label = "Upload", .icon = "Upload", .onclick = action_upload_file); |
90 ui_toolbar_item("Download", .icon = "SaveLocal"); |
90 ui_toolbar_item("Download", .icon = "SaveLocal"); |
91 ui_toolbar_item("Remove", .icon = "Delete"); |
91 ui_toolbar_item("Remove", .icon = "Delete", .onclick = action_delete ); |
92 ui_toolbar_toggleitem("LocalBrowser", .icon = "DockLeft", .label = "Local Browser"); |
92 ui_toolbar_toggleitem("LocalBrowser", .icon = "DockLeft", .label = "Local Browser"); |
93 ui_toolbar_toggleitem("PreviewPane", .icon = "DockRight"); |
93 ui_toolbar_toggleitem("PreviewPane", .icon = "DockRight"); |
94 |
94 |
95 ui_toolbar_appmenu() { |
95 ui_toolbar_appmenu() { |
96 ui_menuitem("TODO", NULL); |
96 ui_menuitem("TODO", NULL); |
175 } |
175 } |
176 |
176 |
177 void action_upload_file(UiEvent *event, void *data) { |
177 void action_upload_file(UiEvent *event, void *data) { |
178 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL); |
178 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL); |
179 } |
179 } |
|
180 |
|
181 void action_delete(UiEvent *event, void *data) { |
|
182 DavBrowser *browser = event->document; |
|
183 UiListSelection sel = ui_list_getselection(browser->resources); |
|
184 if (sel.count > 0) { |
|
185 davbrowser_delete(event->obj, browser, sel); |
|
186 } |
|
187 ui_listselection_free(sel); |
|
188 } |