Bug 124474 - [EFL] Implement download directory selector on Minibrowser
Summary: [EFL] Implement download directory selector on Minibrowser
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-17 17:30 PST by Jongwoo Choi
Modified: 2017-03-11 10:38 PST (History)
4 users (show)

See Also:


Attachments
Patch (8.07 KB, patch)
2013-11-17 17:34 PST, Jongwoo Choi
no flags Details | Formatted Diff | Diff
Patch (8.12 KB, patch)
2013-11-17 18:45 PST, Jongwoo Choi
no flags Details | Formatted Diff | Diff
Patch (7.98 KB, patch)
2013-11-20 16:19 PST, Jongwoo Choi
no flags Details | Formatted Diff | Diff
Patch (7.01 KB, patch)
2013-11-20 20:39 PST, Jongwoo Choi
no flags Details | Formatted Diff | Diff
Patch (6.63 KB, patch)
2013-11-21 16:21 PST, Jongwoo Choi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jongwoo Choi 2013-11-17 17:30:52 PST
EFL Minibrowser doesn't implement download directory selector.
To select destination download directory by user, Implement download directory selector on Minibrowser using existent fileselector API.
Comment 1 Jongwoo Choi 2013-11-17 17:34:28 PST
Created attachment 217164 [details]
Patch
Comment 2 Jongwoo Choi 2013-11-17 18:45:22 PST
Created attachment 217166 [details]
Patch
Comment 3 Gyuyoung Kim 2013-11-20 02:20:39 PST
Comment on attachment 217166 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217166&action=review

Currently, MiniBrowser doesn't work on my environment. Let me review this patch further after fixing my problem.

> Tools/MiniBrowser/efl/main.c:615
> +    evas_object_event_callback_del(ds_data->parent->elm_window, EVAS_CALLBACK_DEL, on_directorypicker_parent_deletion);

Should we deregister this callback here ? If not, we can add close_director_picker() as close_file_picker(), then I think it is better to reuse the same function instead of duplicating code.

> Tools/MiniBrowser/efl/main.c:644
> +    ecore_main_loop_quit();

Why should we finish download job in on_download_progress though there is on_download_finished ?
Comment 4 Jongwoo Choi 2013-11-20 16:19:20 PST
Created attachment 217494 [details]
Patch
Comment 5 Ryuan Choi 2013-11-20 16:28:36 PST
Comment on attachment 217494 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217494&action=review

> Tools/MiniBrowser/efl/main.c:679
> +    elm_fileselector_expandable_set(directory_selector, EINA_FALSE);

If I remember correctly, we don't need this because default value is EINA_FALSE.

> Tools/MiniBrowser/efl/main.c:680
> +    elm_fileselector_buttons_ok_cancel_set(directory_selector, EINA_FALSE);

Do you have any reason to use custom ok / cancel instead of builtin ?
Comment 6 Jongwoo Choi 2013-11-20 16:52:34 PST
(In reply to comment #3)
> (From update of attachment 217166 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217166&action=review
> 
> Currently, MiniBrowser doesn't work on my environment. Let me review this patch further after fixing my problem.
> 
> > Tools/MiniBrowser/efl/main.c:615
> > +    evas_object_event_callback_del(ds_data->parent->elm_window, EVAS_CALLBACK_DEL, on_directorypicker_parent_deletion);
> 
> Should we deregister this callback here ? If not, we can add close_director_picker() as close_file_picker(), then I think it is better to reuse the same function instead of duplicating code.
> 
> > Tools/MiniBrowser/efl/main.c:644
> > +    ecore_main_loop_quit();
> 
> Why should we finish download job in on_download_progress though there is on_download_finished ?

I made close_directory_picker() similar to close_file_picker() and merged these two codes to reuse same function.

To avoid duplication, I moved deregister callback and ecore_main_loop_quit() from on_directorypicker_deletion() and on_download_progress() to close_directory_picker().
Comment 7 Jongwoo Choi 2013-11-20 20:38:38 PST
(In reply to comment #5)
> (From update of attachment 217494 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217494&action=review
> 
> > Tools/MiniBrowser/efl/main.c:679
> > +    elm_fileselector_expandable_set(directory_selector, EINA_FALSE);
> 
> If I remember correctly, we don't need this because default value is EINA_FALSE.

After built with exclude elm_fileselector_expandable_set(directory_selector, EINA_FALSE); line, directory selector set to tree view. I think that default value is EINA_TRUE.

> 
> > Tools/MiniBrowser/efl/main.c:680
> > +    elm_fileselector_buttons_ok_cancel_set(directory_selector, EINA_FALSE);
> 
> Do you have any reason to use custom ok / cancel instead of builtin ?

Maybe I didn't have fully knowledge about smartcallback when i first made this code.
Now, I understand this part and fixed it using built-in ok/cancel button.
To use built-in button, on_download_request() was changed to on_directoryselector_done() function.
Comment 8 Jongwoo Choi 2013-11-20 20:39:59 PST
Created attachment 217515 [details]
Patch
Comment 9 Gyuyoung Kim 2013-11-21 02:06:19 PST
Comment on attachment 217515 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217515&action=review

BTW, how can I see this directory picker ? Could you let me know an example ?

> Tools/MiniBrowser/efl/main.c:133
> +    Browser_Window* parent;

Wrong * place.

> Tools/MiniBrowser/efl/main.c:190
> +static void quit_event_loop(void *user_data, Evas_Object *obj, void *event_info);

Where is this function used ?

> Tools/MiniBrowser/efl/main.c:598
> +

Unneeded line.

> Tools/MiniBrowser/efl/main.c:599
> +static void on_directorypicker_parent_deletion(void *user_data, Evas *evas, Evas_Object *elm_window, void *event_info);

To be sync with other function, please use on_directory_picker_parent_deletion(...)

> Tools/MiniBrowser/efl/main.c:638
> +            char unique_path[] = "downloaded-file.XXXXXX";

Can't we support new name if there is already "downloaded-file.XXXXXX" in /tmp ? For instance, if there is downloaded-file-1.XXX, next no name file will be saved as download-file-2.XXX.
Comment 10 Jongwoo Choi 2013-11-21 16:18:50 PST
(In reply to comment #9)
> (From update of attachment 217515 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217515&action=review
> 
> BTW, how can I see this directory picker ? Could you let me know an example ?
> 
> > Tools/MiniBrowser/efl/main.c:133
> > +    Browser_Window* parent;
> 
> Wrong * place.
> 
> > Tools/MiniBrowser/efl/main.c:190
> > +static void quit_event_loop(void *user_data, Evas_Object *obj, void *event_info);
> 
> Where is this function used ?
> 
> > Tools/MiniBrowser/efl/main.c:598
> > +
> 
> Unneeded line.
> 
> > Tools/MiniBrowser/efl/main.c:599
> > +static void on_directorypicker_parent_deletion(void *user_data, Evas *evas, Evas_Object *elm_window, void *event_info);
> 
> To be sync with other function, please use on_directory_picker_parent_deletion(...)
> 
> > Tools/MiniBrowser/efl/main.c:638
> > +            char unique_path[] = "downloaded-file.XXXXXX";
> 
> Can't we support new name if there is already "downloaded-file.XXXXXX" in /tmp ? For instance, if there is downloaded-file-1.XXX, next no name file will be saved as download-file-2.XXX.

Download picker, can be seen at the following address.
http://www.w3.org/TR/2000/REC-ATAG10-20000203/atag10.tgz

Filename consist with XXX(six or more'X') will be replaced unique file name  after mktemp(unique_path). For example, download-file.
Comment 11 Jongwoo Choi 2013-11-21 16:21:56 PST
Created attachment 217625 [details]
Patch
Comment 12 Jongwoo Choi 2013-11-21 16:28:15 PST
> Filename consist with XXX(six or more'X') will be replaced unique file name  after mktemp(unique_path). For example, download-file.

Sorry I missed example file name
after mktemp(), file name will be 
downloaded-file.ie7Ksm 
downloaded-file.aUFQUU 
downloaded-file.ADckXL
....
Comment 13 Gyuyoung Kim 2014-05-07 02:53:50 PDT
Is this patch still valid ?
Comment 14 Gyuyoung Kim 2014-06-23 00:58:52 PDT
Comment on attachment 217625 [details]
Patch

Cleared review? from attachment 217625 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug or this bug again.
Comment 15 Michael Catanzaro 2017-03-11 10:38:25 PST
Closing this bug because the EFL port has been removed from trunk.

If you feel this bug applies to a different upstream WebKit port and was closed in error, please either update the title and reopen the bug, or leave a comment to request this.