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

[feature] please use a gui file picker that isnt abysmal #1213

Open
Directory opened this issue Jul 24, 2021 · 11 comments
Open

[feature] please use a gui file picker that isnt abysmal #1213

Directory opened this issue Jul 24, 2021 · 11 comments

Comments

@Directory
Copy link

in the gui (on windows) the file picker is nothing short of absolute trash. it takes forever to travel my pc's directory tree. why cant it just be the default windows file picker that any other application uses. who asked for this garbage.

@jpstotz
Copy link
Collaborator

jpstotz commented Jul 24, 2021

Jadx is a Java based application and Java does not use native file picker at all as those components are platform specific and Java is a multi-platform system.

I am not sure if and how a Java file picker can be configured or changed but that requires to have a detailed problem report, not just a rant about something you don't like. So please enhance your feature request with a detailed description what and how in your opinion the file-picker should be changed.

@skylot
Copy link
Owner

skylot commented Jul 25, 2021

I made a separate branch: file-dialog with java.awt.FileDialog which use platform native file open dialog.
Unfortunately, it just crashes JVM on my machine (Linux) but working fine on Windows, so I enable it only on Windows.

@Directory, @jpstotz can you check this branch?
Also, it will be cool if someone check it on other platforms like macOs or Linux with different DE (don't forget to change condition to enable FileDialog, see 7f35db1 commit)

Edit: it also works on Linux with Java 8 showing GTK file open dialog, but Java 11 and 16 just crash 😕

@jpstotz
Copy link
Collaborator

jpstotz commented Jul 25, 2021

@skylot The branch and it's open file dialog works fine for me on Windows 10 using Adopt OpenJDK 8/11/16.
The difference to the dialog used before is from my perspective mainly the context menu of the shown files and folders. The other parts seems to me nearly identical.

I will check it on an Intel based Mac the next days.

@skylot
Copy link
Owner

skylot commented Jul 25, 2021

The branch and it's open file dialog works fine for me on Windows 10 using Adopt OpenJDK 8/11/16.

@jpstotz thanks!

The difference to the dialog used before is from my perspective mainly the context menu of the shown files and folders

Yeah, I also don't see much difference.
Also, looks like FileDialog don't support file filters by extension, it has filtering method, but it doesn't work for me.

@jpstotz
Copy link
Collaborator

jpstotz commented Jul 25, 2021

The question how to filter files in Awt FileDialog seems to as old as Java, I found this question multiple times, the first one dated 2001 but never with any working solution.

If you have tested the FilenameFilter feature then it seems like there is a known problem with it on Windows:

Filename filters do not function in Sun's reference implementation for Microsoft Windows.
https://docs.oracle.com/javase/8/docs/api/java/awt/FileDialog.html#setFilenameFilter-java.io.FilenameFilter-

@alissonlauffer
Copy link
Contributor

I made a separate branch: file-dialog with java.awt.FileDialog which use platform native file open dialog.
Unfortunately, it just crashes JVM on my machine (Linux) but working fine on Windows, so I enable it only on Windows.

Well, I tested under Gnome on Arch Linux and it is working fine here. Tested with Java 8, 11 and 16.

@skylot
Copy link
Owner

skylot commented Jul 25, 2021

Well, I tested under Gnome on Arch Linux and it is working fine here. Tested with Java 8, 11 and 16

@alissonlauffer great! Thanks!

So, it's working in most common DEs and platforms. What about usability? I think we need to wait @Directory opinion.
And as I see it now, we can make it configurable with default to FileDialog and possible fallback to JFileChooser in case of issues.

@alissonlauffer
Copy link
Contributor

What about usability?

Here, using the GTK file chooser is much better than the Java file chooser, although the files are not filtered, as mentioned above.

But unfortunately, it seems that the JVM is randomly crashing when opening Jadx: Sometimes it opens just fine, sometimes not.

@MrIkso
Copy link
Contributor

MrIkso commented Aug 2, 2021

Maybe use FlatLaf or Darklaf for good gui, and dark theme support:)

@skylot
Copy link
Owner

skylot commented Aug 2, 2021

Maybe use FlatLaf or Darklaf for good gui, and dark theme support:)

@MrIkso this is not actually related to using native file dialog.
But I added FlatLaf to master branch, so it is possible to change themes now 🎉

@MrIkso
Copy link
Contributor

MrIkso commented Aug 2, 2021

But I added FlatLaf to master branch, so it is possible to change themes now

Ok, it remains to update the icons to normal svg from idea, which is what I'm doing right now :).

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

No branches or pull requests

5 participants