-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix menu bar gone on macOS #10967
Fix menu bar gone on macOS #10967
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -40,7 +40,6 @@ | |||
import org.jabref.gui.Globals; | ||||
import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode; | ||||
import org.jabref.gui.autocompleter.AutoCompletePreferences; | ||||
import org.jabref.gui.desktop.JabRefDesktop; | ||||
import org.jabref.gui.duplicationFinder.DuplicateResolverDialog; | ||||
import org.jabref.gui.entryeditor.EntryEditorPreferences; | ||||
import org.jabref.gui.externalfiletype.ExternalFileType; | ||||
|
@@ -710,7 +709,6 @@ private JabRefPreferences() { | |||
defaults.put(WARN_BEFORE_OVERWRITING_KEY, Boolean.TRUE); | ||||
defaults.put(CONFIRM_DELETE, Boolean.TRUE); | ||||
defaults.put(CONFIRM_LINKED_FILE_DELETE, Boolean.TRUE); | ||||
defaults.put(TRASH_INSTEAD_OF_DELETE, JabRefDesktop.moveToTrashSupported()); | ||||
defaults.put(DEFAULT_CITATION_KEY_PATTERN, "[auth][year]"); | ||||
defaults.put(UNWANTED_CITATION_KEY_CHARACTERS, "-`ʹ:!;?^+"); | ||||
defaults.put(RESOLVE_STRINGS_FOR_FIELDS, "author;booktitle;editor;editora;editorb;editorc;institution;issuetitle;journal;journalsubtitle;journaltitle;mainsubtitle;month;publisher;shortauthor;shorteditor;subtitle;titleaddon"); | ||||
|
@@ -2204,7 +2202,8 @@ public FilePreferences getFilePreferences() { | |||
// We choose the data directory, because a ".bak" file should survive cache cleanups | ||||
getPath(BACKUP_DIRECTORY, OS.getNativeDesktop().getBackupDirectory()), | ||||
getBoolean(CONFIRM_LINKED_FILE_DELETE), | ||||
getBoolean(TRASH_INSTEAD_OF_DELETE)); | ||||
// We make use of the fallback, because we need AWT being initialized, which is not the case at the constructor JabRefPreferences() | ||||
getBoolean(TRASH_INSTEAD_OF_DELETE, OS.getNativeDesktop().moveToTrashSupported())); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong. Can this be enabled in the preferences even though it is not supported? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was already wrong before the chris change. 😉 isSupported is logic, not a preferences option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevertheless, the preference should not be true if it is not supported system-wide. I thought, in #10591 I implemented it as: "default = supported by OS" and then "disabled/enabled = supported by OS". Maybe an additional line: if (!OS.getNativeDesktop().moveToTrashSupported()) {
moveToTrash.setValue(false)
} to ensure that it is both disabled and false if trash is not supported. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was in defaults. but this broke the system menu bar in macOS. This is why i removed it in defaults and just added it as fallback value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which part exactly broke the menu bar? The issue did not show any exception, so I cannot understand the root cause. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion would be just to make true the default, but it's greyed out in the preferences and where moveToTrash is used, there is an additional check, if this is supported. Check could go to JabRefDesktop#moveToTrash or sthg and then delete instead. |
||||
|
||||
EasyBind.listen(getInternalPreferences().getUserAndHostProperty(), (obs, oldValue, newValue) -> filePreferences.getUserAndHostProperty().setValue(newValue)); | ||||
EasyBind.listen(filePreferences.mainFileDirectoryProperty(), (obs, oldValue, newValue) -> put(MAIN_FILE_DIRECTORY, newValue)); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there a
true
be put?OK, what if the OS does not support move to trash?
This were my thoughts. Therefore, I made the default rely on the current OS's capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly this line broke the menu bar! That's why I moved the check. I guess it has something to do with the initalization order of javafx <-> awt because we are here in a static context early at startup. That's why I moved the check down where the value is first read