Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ft.FilePicker does not work on some Linux distros like KDE #3296

Open
redromnon opened this issue May 15, 2024 · 5 comments
Open

ft.FilePicker does not work on some Linux distros like KDE #3296

redromnon opened this issue May 15, 2024 · 5 comments

Comments

@redromnon
Copy link

Description

Looks to me like the FilePicker component works on GNOME (tested on Pop OS 22.04 and Ubuntu 24.04) and opens up the native folder application to select a folder. But it doesn't do anything on KDE Plasma 5 and 6 (Tested on Kubuntu 24.04 and Arch Linux).

Code example to reproduce the issue:

folder_picker = ft.FilePicker(on_result=folder_dialog_result)

select_folder_icon = ft.IconButton(
        icon=ft.icons.FOLDER_ROUNDED, tooltip="Select folder location", 
        on_click=lambda e: folder_picker.get_directory_path()
)

def folder_dialog_result(self, e: ft.FilePickerResultEvent):
        
    print(e.path)

page.add(folder_picker)
page.add(select_folder_icon)

Describe the results you received:

Nothing happens after I click the folder icon. Got this error in journalctl when I clicked on the folder icon:

xdp-kde-settings: Namespace  "org.gnome.desktop.interface"  is not supported

Describe the results you expected:
The native folder app should open and allow me to select a folder.

Additional information you deem important (e.g. issue happens only occasionally):
None

Flet version (pip show flet):

Version: 0.19.0

Operating system:
Kubuntu 24.04 LTS

Additional environment details:
KDE Plasma Version: 5.27.11
KDE Frameworks Version 5.115.0
Qt Version: 5.15.13
Graphics Platform: X11

@vindevoy
Copy link

This is not because of the distribution, in your case Kubuntu. Kubuntu, with default KDE installed, also has the possibility to install the Gnome libraries.

See this article, for example:
https://www.reddit.com/r/Ubuntu/comments/m8q1qz/how_do_i_get_gnome_on_kubuntu/

So basically, when you install gnome via "apt install gnome" or "sudo apt install gnome" according to your rights on the system, you will be able to run the application and use the file picker.

@redromnon
Copy link
Author

Thanks for responding.

Basically, Flet will only work with GNOME File Picker and not with any other DE File Picker?

@sidviny
Copy link

sidviny commented May 16, 2024

Looking at the class it seems to be missing, no. At least, that's how I see it, but it's up to others who wrote the code to tell you exactly.

@redromnon
Copy link
Author

I believe Flet internally uses Flutter packages. @sidviny Are you referring to the Dart or the Python side of this module's implementation?

@redromnon
Copy link
Author

The Flet docs also mention installing zenity as a pre-requisite for File Picker to work. If I run zenity --file-selection on Kubuntu, it works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants