Closed fforneck closed 4 years ago
Thanks for the ticket, but this text is not set by KSE.
Your screenshot shows the file chooser dialog of VAqua. If you use the default look and feel, the same dialog looks like this:
Maybe @lhaeger who added the VAqua laf to KSE knows a trick to change the text.
What is the default laf for Mac? I doubt the laf has been changed, but I'll confirm with my co-worker.
Just confirmed with my co-worker, the laf had not been changed. He was using whatever was selected out-of-the-box, which was "macOS (VAqua)" and not "Mac OS X".
VAqua is the default laf when it is available according to this: https://github.com/kaikramer/keystore-explorer/blob/afdfcf0c4c7930293f2136920b7707ba3723e69d/kse/src/org/kse/gui/LnfUtil.java#L97-L130
I'm having the same issue here. Basically all open dialogs are "Save As" dialogs. This leads to a few more errors. E.g if you try to import a certificate a dialog opens where you can select your certificate. However it is actually a save as dialog:
If you now press "Import" you will get an error message that there is no certificate named "Untitled" in the path. I have this same issue for every open file dialog.
KSE 5.4.3 on OSX 10.15.3.
There is no question that the default look&feel should not show this weird behavior. Unless @lhaeger knows how to fix this, I'll change the default l&f back to the standard Java one with the next release.
I have no time to look into this short term, so please revert as suggested.
Maybe the VAqua author Alan Snyder @cbfiddle has an idea.
Until this can be addressed, there are currently two workarounds for this:
@kaikramer, here's a patch that I think addresses this issue:
diff --git a/kse/src/org/kse/gui/actions/ExamineFileAction.java b/kse/src/org/kse/gui/actions/ExamineFileAction.java
index 7b26109..1f98f94 100644
--- a/kse/src/org/kse/gui/actions/ExamineFileAction.java
+++ b/kse/src/org/kse/gui/actions/ExamineFileAction.java
@@ -314,8 +314,9 @@ public class ExamineFileAction extends KeyStoreExplorerAction {
chooser.setCurrentDirectory(CurrentDirectory.get());
chooser.setDialogTitle(res.getString("ExamineFileAction.ExamineFile.Title"));
chooser.setMultiSelectionEnabled(false);
+ chooser.setApproveButtonText(res.getString("ExamineFileAction.ExamineFile.button"));
- int rtnValue = chooser.showDialog(frame, res.getString("ExamineFileAction.ExamineFile.button"));
+ int rtnValue = chooser.showOpenDialog(frame);
if (rtnValue == JFileChooser.APPROVE_OPTION) {
File openFile = chooser.getSelectedFile();
CurrentDirectory.updateForFile(openFile);
On a Mac, clicking on the "Examine file" button opens a dialog that resembles more a "Save" dialog than an "Open" one (see screenshot below). I say it resembles more a "Save" dialog than an "Open" one because it has a "Save as" field on the very top. I first experienced this on a client's machine and then confirmed it on a colleague's.
Steps to reproduce the behavior:
Expected behavior When opening any file, the user shouldn't be asked to choose a file name to "Save As"
Screenshots
Environment