[webkit-gtk] Implement runOpenPanel in WebKit2GTK+

Simon Schampijer simon at schampijer.de
Tue Feb 14 10:10:21 PST 2012


Hi Mario & others,

thanks a lot for your work on this track! This is the missing piece for 
the path I took. I think it will work very well to pass the 
WebKitFileChooserRequest request with the signal and then the app can 
handle that, similar to the 'WebKitDownload' object that is passed with 
"download-requested".

So, about the signal naming, 'upload-requested' talks most to me so far, 
at least in WebKit1 in WebKit2 that part seem to be a bit different. 
'run-filechooser' would be ok as well, I guess. In any case, happy to 
see this moving forward.

Regards,
    Simon


On 02/13/2012 07:06 PM, Mario Sanchez Prada wrote:
> On Mon, 2012-02-13 at 11:12 -0200, Gustavo Noronha Silva wrote:
>> +1 on Carlos' API suggestions
>
> Thank you for all the provided feedback (including Martin's here as
> well). I have already incorporated all of these suggestions in my local
> branch and have filed a new bug to properly tracking work done on this:
>
> https://bugs.webkit.org/show_bug.cgi?id=78491
>
> If everything goes fine, tomorrow I'll work on properly documenting (and
> polishing) the code, as well as writing unit tests for this new API,
> which at the moment is looking like this:
>
>> From WebKitFileChooserRequest.h:
> ================================
> gboolean
> webkit_file_chooser_request_allows_multiple_files(WebKitFileChooserRequest*);
>
> gchar**
> webkit_file_chooser_request_accepted_mime_types(WebKitFileChooserRequest*);
>
> GtkFileFilter*
> webkit_file_chooser_request_get_file_filter(WebKitFileChooserRequest*);
>
> void
> webkit_file_chooser_request_choose_files(WebKitFileChooserRequest*,
>                                           GSList*);
> gchar**
> webkit_file_chooser_request_selected_files(WebKitFileChooserRequest*);
>
> void
> webkit_file_chooser_request_cancel(WebKitFileChooserRequest*);
>
>
>> From WebKitWebView.h:
> =====================
>
> [...]
> gboolean (* run_file_chooser) (WebKitWebView            *web_view,
>                                 WebKitFileChooserRequest *request);
> [...]
>
>
> As you can see I added an _accepted_mime_types() function besides the
> one suggested by Carlos (_get_file_filter()), because I thought under
> some scenarios it could be interesting to have easy access to the list
> of accepted mime types (as in an array of char*), and extracting that
> list from a GtkFileFilter instance is not trivial at all.
>
> Again, attaching the new patch together with this mail for you to be
> able to take a look if interested, just bear in mind is not a final one
> (new functions not even tested, will do while writing the unit tests).
>
> Thanks,
> Mario
>
>
>
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk



More information about the webkit-gtk mailing list