DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.25k stars 40 forks source link

CID: Set title for file dialog #241

Closed sonic2kk closed 1 year ago

sonic2kk commented 1 year ago

Minor QOL change I thought to make when messing around with the file picker dialog. Instead of just saying "Find Directory" it is now a little bit more descriptive (which is good for users who are like me and might forget what they opened the dialog to do...)

Before: image

After: image

Note: I'm not sure what this might do on Flatpak, because when running the Flatpak, ProtonUp-Qt appears to use xdg-portals to open the file dialog. Portals are, in short and in this instance, a way to have consistent cross-desktop file dialog behaviour by basically telling the desktop to "plug in" it's file dialog in place of one an application might use as a fallback, i.e. use a GTK file picker on GNOME. Portals can be used in other ways (such as for audio/screen sharing afaik) but the file picker is what we are concerned with here. There is some information on GitHub but it's still a little vague in my opinion :sweat_smile:

The install dialog on ProtonUp-Qt Flatpak says "Select Folder - Portal", and at least in my testing (i.e. on Firefox), Portals usually have consistent names such as "Open File", "Save As", etc. Originally, I actually started messing around with the custom install dialog to see if there was a way to get it to use Portals when running from source but I was unsuccessful (I don't run Firefox Flatpak for example, but it still uses Portals).

DavidoTek commented 1 year ago

Thanks! :tada:

Instead of just saying "Find Directory" it is now a little bit more descriptive (which is good for users who are like me and might forget what they opened the dialog to do...)

Sounds like a good idea.

I'm not sure what this might do on Flatpak, because when running the Flatpak, ProtonUp-Qt appears to use xdg-portals

Did a quick test, that seems to work. Also, the portal includes a variable called title (fyi https://github.com/flatpak/xdg-desktop-portal/blob/dbe8633d08dd9f790216df3e8104d82fb555c16f/data/org.freedesktop.impl.portal.FileChooser.xml#L139)

[...] get it to use Portals when running from source

What you can do for testing is running flatpak run --command=python3 net.davidotek.pupgui2 and do the testing from there. At least that's how I did it.