File picker
Closed, ResolvedPublic

Description

The file picker should be Kirigami-based.

@jbbgameich and @lnj worked on this already (based on the xdg-desktop-portal-kde):
https://invent.kde.org/jbbgameich/xdg-desktop-portal-kirigami

lnj created this task.Feb 9 2020, 3:05 PM

Other approach (using qpa): https://invent.kde.org/lnj/plasma-integration/-/tree/feature/mobile-kirigami-ui

(I prefer xdg portals, because I don't want to maintain this twice for sandboxed and non-sandboxed apps)

@davidedmundson I'm mentioning you here because I think you had the idea to base the PlaMo file dialog on xdg-desktop-portal. I have been working on this approach for some time. Now I wonder where to best put the code. I began by forking xdg-desktop-portal-kde, but it would be probably better to integrate it into the exisiting portal.

My current approach is to put the QML part into kirigami-addons in D29168: WIP: Import filepicker from xdg-desktop-portal-kirigami and fix various issues, as other people where interested in using it in their applications. xdg-desktop-portal-kde would then choose the correct file dialog to open based on either environment variables or kirigami tablet mode. A thin KFileWidget like c++ wrapper around the QML would have to be added to xdg-desktop-portal for that. What do you think?

bshah added a comment.Apr 28 2020, 6:47 AM

@davidedmundson @jbbgameich alternate idea is to simply put the QML file dialog in the plasma-integration, AFAIU, portal ultimately ends up using the dialog in plasma-integration?

No, the portal uses the KFileWidget directly. After posting this I also had the idea of implementing this in KIO directly.

@jgrulich, since you are working on xdg-desktop-portal-kde, do you have an opionion on where the mobile file picker ui should go?
Options are basically:

  • everything into xdg-desktop-portal-kde
  • KIO (would still need special handling in the portal)
  • put actual gui code in Kirigami-addons and call it from the portal
  • create a new portal for mobile
  1. I don't mind having it directly in xdg-desktop-portal-kde, but if it's something that might be re-used, it might be better to put it into some framework.

2-3) Kirigami-addons will be probably my preference. It sounds like something that can be re-used so why not write it that way. Then in xdg-desktop-portal-kde we will just check if it's running on mobile and create a dialog based on that.

  1. This might complicate it a bit, because you either would need to implement all the other portals which are same for both the desktop and mobile, or you would need to set different value to XDG_CURRENT_DESKTOP so xdg-desktop-portal first loads your portal implementation for some portals and then xdg-desktop-portal-kde as fallback for the rest.
EspiDev moved this task from PM 1.0 to Done on the Plasma: Mobile board.Dec 9 2020, 4:06 AM
EspiDev edited projects, added Plasma: Mobile; removed Plasma: Mobile (PM 1.0).
bshah closed this task as Resolved.Mar 29 2021, 7:42 AM
bshah claimed this task.