Changes between Initial Version and Version 4 of Ticket #6350


Ignore:
Timestamp:
Oct 31, 2021, 11:33:19 AM (3 years ago)
Author:
Langbart
Comment:

Adding some additional information to the ticket about the implementation of copy/open buttons.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6350

    • Property Owner set to Langbart
    • Property PatchPhab:D4296
  • Ticket #6350 – Description

    initial v4  
    11Currently the path to the file name is displayed in a readonly input field. This has been introduced with [20075] so that you can select and copy the file path.
    22
    3 **(1)** Either add an option to disable the blinking cursor in the input field
     3~~ **(1)** Either add an option to disable the blinking cursor in the input field and maybe add some color. Right now the way the filename path is displayed is too merged with the replay list, it should look a bit more differentiated. [25976]
    44
    5 OR
     5OR/ AND
    66
    77**(2)** Turn it back into a text type field and add a "Copy" button and even an "Open" button to it.
    88[[Image(ticket:6350:buttons_are_great.jpg, 600px, center)]]
    99
    10 Either way, the word "path" should be added and maybe some color. Right now the way the filename path is displayed is too merged with the replay list, it should look a bit more differentiated.
     10Some info about the implementation of the `copy/open` button:
     11> [19:04:05] elexis so an idea to make such a button could be that one introduces (A) a GUI accessible JS function in C++ that takes 1 string argument and writes this string into clipboard, then (B) is only adding a conventional button that calls this function\\
     12> [19:04:29] elexis I find this:\\
     13> [19:04:29] elexis gui/ObjectTypes/CInput.cpp:            SDL_SetClipboardText(text.ToUTF8().c_str());\\
     14> [19:06:52] elexis and such a function would be added somewhere in source/gui/Scripting/ScriptFunctions.cpp,  I guess in source/gui/Scripting/JSInterface_GUIManager.cpp\\
     15> [19:07:46] elexis there are 3 calls to SDL_SetClipboardText already, so it seems such a C++ patch would be something like 5 lines of code\\
     16
     17> [18:52:20] elexis (00:53:43) elexis: it calls sys_open_url\\
     18> [18:52:20] elexis (00:54:44) vladislav: It uses xdg-open\\
     19> [18:52:44] elexis "If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type."\\
     20> [18:52:48] elexis https://linux.die.net/man/1/xdg-open\\
     21> [18:56:13] elexis important to notice that if there is a security concern with OpenURL, then it has been there since years