Skip to content

Commit

Permalink
fix(gui): disable shell folders in file open dialog (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Oct 26, 2022
1 parent 1a9cb83 commit 2bace2b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.filechooser.FileNameExtensionFilter;

import jadx.api.plugins.utils.CommonFileUtils;
Expand All @@ -22,10 +23,16 @@

class CustomFileChooser extends JFileChooser {

static {
// disable left shortcut panel, can crush in "Win32ShellFolderManager2.getNetwork()" or similar call
UIManager.put("FileChooser.noPlacesBar", Boolean.TRUE);
}

private final FileDialogWrapper data;

public CustomFileChooser(FileDialogWrapper data) {
super(data.getCurrentDir() == null ? CommonFileUtils.CWD : data.getCurrentDir().toFile());
putClientProperty("FileChooser.useShellFolder", Boolean.FALSE);
this.data = data;
}

Expand Down

0 comments on commit 2bace2b

Please sign in to comment.