application/application.c

changeset 26
40d6af793c1a
parent 23
cdcb20412dd4
child 27
c254ed644edf
equal deleted inserted replaced
25:915131bc3233 26:40d6af793c1a
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 }

mercurial