application/window.c

changeset 77
5de33c2d94c6
parent 68
79a9aadf1c70
child 78
ad7ced6cf00b
equal deleted inserted replaced
76:641dcc79e0ef 77:5de33c2d94c6
115 DavResourceViewer *doc = data; 115 DavResourceViewer *doc = data;
116 doc->window_closed = TRUE; 116 doc->window_closed = TRUE;
117 if(doc->loaded) { 117 if(doc->loaded) {
118 dav_resourceviewer_destroy(doc); 118 dav_resourceviewer_destroy(doc);
119 } 119 }
120
121 if (doc->tmp_file) {
122 unlink(doc->tmp_file);
123 free(doc->tmp_file);
124 }
120 } 125 }
121 126
122 void resourceviewer_new(DavBrowser *browser, const char *path, DavResourceViewType type) { 127 void resourceviewer_new(DavBrowser *browser, const char *path, DavResourceViewType type) {
123 const char *name = util_resource_name(path); 128 const char *name = util_resource_name(path);
124 UiObject *win = ui_simple_window(name, NULL); 129 UiObject *win = ui_simple_window(name, NULL);
130 ui_window_size(win, 600, 600);
125 131
126 DavResourceViewer *doc = dav_resourceviewer_create(browser->sn, path, type); 132 DavResourceViewer *doc = dav_resourceviewer_create(browser->sn, path, type);
127 ui_attach_document(win->ctx, doc); 133 ui_attach_document(win->ctx, doc);
128 ui_context_closefunc(win->ctx, resourceviewer_close, doc); 134 ui_context_closefunc(win->ctx, resourceviewer_close, doc);
129 135

mercurial