-
-
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
Added preset for new entry keybindings and reintroduced defaults #7705
Changes from 8 commits
2f11418
e358264
a628236
6ad98a9
46a7c6f
bf001e1
bb52b54
055da20
0c1954c
ffa0d60
29053d9
6920fad
b961f92
37f8bc8
8c6ab3c
f865e28
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.jabref.gui.preferences.keybindings.presets; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.jabref.gui.keyboard.KeyBinding; | ||
|
||
public class NewEntryBindingPreset implements KeyBindingPreset { | ||
|
||
private static final Map<KeyBinding, String> KEY_BINDINGS = new HashMap<>(); | ||
calixtus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
static { | ||
// Clear conflicting default presets | ||
KEY_BINDINGS.put(KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE, ""); | ||
KEY_BINDINGS.put(KeyBinding.COPY_PREVIEW, ""); | ||
|
||
// Add new entry presets | ||
KEY_BINDINGS.put(KeyBinding.NEW_ARTICLE, "Ctrl+shift+A"); | ||
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. to be consistent with the other keybindings, please lowercase the Ctrl |
||
KEY_BINDINGS.put(KeyBinding.NEW_BOOK, "Ctrl+shift+B"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_ENTRY, "Ctrl+N"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_ENTRY_FROM_PLAIN_TEXT, "Ctrl+shift+N"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_INBOOK, "Ctrl+shift+I"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_INPROCEEDINGS, "Ctrl+shift+C"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_MASTERSTHESIS, "Ctrl+shift+M"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_PHDTHESIS, "Ctrl+shift+T"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_PROCEEDINGS, "Ctrl+shift+P"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_TECHREPORT, "Ctrl+shift+R"); | ||
KEY_BINDINGS.put(KeyBinding.NEW_UNPUBLISHED, "Ctrl+shift+U"); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "New Entries"; | ||
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. I find "new entries" a bit confusing, maybe something longer that better explains the purpose? Should be localized as well. 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. Please make a suggestion. We did not come up with something better yet. 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. New Entry types ? 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. Something like "Bindings for creating all entry types"? 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. A long text would just repeat information the user already has and would be imho extremely annoying. 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. Yeah, I couldn't find a nice formulation that doesn't include "Bindings". But with "New entries" or "New entry types" it's really not clear what this is doing. |
||
} | ||
|
||
@Override | ||
public Map<KeyBinding, String> getKeyBindings() { | ||
return KEY_BINDINGS; | ||
} | ||
} |
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.
Are these defaults really necessary? They were removed in a recent PR on purpose (because they are not often used). Users can still set keybindings themselves, right?
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.
Carl and me discussed this in length yesterday, too.
I like convention over configuration. If I start a tool, I want to have it behaving "well". It should require configuration only for certain special cases.
In the concrete case, the key bindings are NOT used for some other cases (except the pull from shared database). Thus, I have a strong vote to add the non-conflicting key bindings back as default.
The other option is that I write a lengthy manual on key bindings and explain each (power) user why they have to configure key bindings. - IMHO JabRef should not require much documentation. Only for the hard cases.
See also #7439 and #7346. Thus, there are multiple users used to the key bindings.
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.
There are too many entry types, especially if you use biblatex, to have keybindings for all types. Thus you need to make a cutoff somewhere, and in my opinion it should be sufficient to have bindings for the 5 most commonly used types. This would also be consistent with the "new entry" dialog where the following types are treated specially:
jabref/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java
Line 446 in d9964c6
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.
The "most commonly used types" are for me the ones where keybindings existed for more than a decade. IMHO there is no need to remove functionality in this case.
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.
From this perspective, we shouldn't have changed the new entry dialog as well...