mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
Change gui_file_gadget_interface to pass gui_window not browser_window, add GTK implementation that of course does not work.
This commit is contained in:
parent
0d7f1cfc93
commit
550c8cd73c
@ -5138,7 +5138,7 @@ void ami_gui_splash_close(Object *win_obj)
|
||||
if(win_obj) DisposeObject(win_obj);
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
@ -1098,7 +1098,7 @@ static void gui_init2(int argc, char** argv)
|
||||
toolbar_init();
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
@ -1165,7 +1165,7 @@ bool path_add_part(char *path, int length, const char *newpart)
|
||||
return true;
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
@ -324,7 +324,7 @@ void gui_401login_open(nsurl *url, const char *realm,
|
||||
cb( false, cbpw );
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
@ -1564,7 +1564,7 @@ static nserror browser_window_callback(hlcache_handle *c,
|
||||
|
||||
case CONTENT_MSG_GADGETCLICK:
|
||||
if (event->data.gadget_click.gadget->type == GADGET_FILE) {
|
||||
gui_file_gadget_open(bw, c,
|
||||
gui_file_gadget_open(bw->window, c,
|
||||
event->data.gadget_click.gadget);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection);
|
||||
void gui_start_selection(struct gui_window *g);
|
||||
void gui_clear_selection(struct gui_window *g);
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget);
|
||||
|
||||
/**
|
||||
|
@ -681,13 +681,6 @@ void gui_quit(void)
|
||||
gtk_fetch_filetype_fin();
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
/* browser_window_set_gadget_filename(bw, gadget, "plinth"); */
|
||||
}
|
||||
|
||||
static void nsgtk_select_menu_clicked(GtkCheckMenuItem *checkmenuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
32
gtk/window.c
32
gtk/window.c
@ -1162,3 +1162,35 @@ void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
|
||||
LOG(("width: %i", *width));
|
||||
LOG(("height: %i", *height));
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
LOG(("Awooga."));
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new("Select File",
|
||||
nsgtk_scaffolding_window(g->scaffold),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
LOG(("*** open dialog: %p", dialog));
|
||||
|
||||
int ret = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
LOG(("*** return value: %d", ret));
|
||||
if (ret == GTK_RESPONSE_ACCEPT) {
|
||||
char *filename;
|
||||
|
||||
filename = gtk_file_chooser_get_filename(
|
||||
GTK_FILE_CHOOSER(dialog));
|
||||
|
||||
browser_window_set_gadget_filename(g->bw, gadget, filename);
|
||||
|
||||
g_free(filename);
|
||||
}
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ gui_window_save_link(struct gui_window *g, const char *url,
|
||||
g->win_num, url, title);
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_browser *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
@ -2424,7 +2424,7 @@ bool path_add_part(char *path, int length, const char *newpart)
|
||||
return true;
|
||||
}
|
||||
|
||||
void gui_file_gadget_open(struct browser_window *bw, hlcache_handle *hl,
|
||||
void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG(("File open dialog rquest for %p/%p", bw, gadget));
|
||||
|
Loading…
Reference in New Issue
Block a user