97 ui_menuitem("New Window", .onclick = action_window_new); |
97 ui_menuitem("New Window", .onclick = action_window_new); |
98 ui_menuseparator(); |
98 ui_menuseparator(); |
99 ui_menuitem("Download", .onclick = action_download); |
99 ui_menuitem("Download", .onclick = action_download); |
100 ui_menuitem("Upload Files", .onclick = action_upload_file); |
100 ui_menuitem("Upload Files", .onclick = action_upload_file); |
101 ui_menuitem("Upload Directory", .onclick = action_upload_dir); |
101 ui_menuitem("Upload Directory", .onclick = action_upload_dir); |
|
102 ui_menuitem("Open Properties", .onclick = action_open_properties); |
|
103 ui_menuitem("Open as Text File", .onclick = action_open_properties, .onclickdata = "text/plain"); |
102 ui_menuseparator(); |
104 ui_menuseparator(); |
103 ui_menuitem("Settings", .onclick = action_open_settings); |
105 ui_menuitem("Settings", .onclick = action_open_settings); |
104 } |
106 } |
105 |
107 |
106 //ui_toolbar_add_default("Home", UI_TOOLBAR_LEFT); |
108 //ui_toolbar_add_default("Home", UI_TOOLBAR_LEFT); |
234 if (initialFileName) { |
236 if (initialFileName) { |
235 ui_savefiledialog(event->obj, initialFileName, download_location_selected, first); |
237 ui_savefiledialog(event->obj, initialFileName, download_location_selected, first); |
236 } else { |
238 } else { |
237 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_FOLDER, download_location_selected, first); |
239 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_FOLDER, download_location_selected, first); |
238 } |
240 } |
|
241 |
|
242 ui_listselection_free(sel); |
239 } |
243 } |
240 } |
244 } |
241 |
245 |
242 void action_upload_file(UiEvent *event, void *data) { |
246 void action_upload_file(UiEvent *event, void *data) { |
243 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL); |
247 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_MULTI, file_selected, NULL); |
303 } |
307 } |
304 |
308 |
305 void action_open_settings(UiEvent *event, void *data) { |
309 void action_open_settings(UiEvent *event, void *data) { |
306 |
310 |
307 } |
311 } |
|
312 |
|
313 void action_open_properties(UiEvent *event, void *data) { |
|
314 char *type = data; |
|
315 DavBrowser *browser = event->document; |
|
316 |
|
317 UiListSelection sel = ui_list_getselection(browser->resources); |
|
318 for(int i=0;i<sel.count;i++) { |
|
319 DavResource *res = ui_list_get(browser->resources, sel.rows[i]); |
|
320 if(res) { |
|
321 davbrowser_open_resource(event->obj, browser, res, type); |
|
322 } |
|
323 } |
|
324 ui_listselection_free(sel); |
|
325 } |