-
-
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
Add switch to change from biblatex to bibtex and vice versa (fi… #5565
Conversation
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.
I would really prefer if you could try to add the option in the library properties. As @Siedlerchr said in the issue, you normally don't switch between modes so a menu item is not the "correct" way to add the feature.
If the label is really the problem, you can also rename the button to "Reset to recommended" (which actually is a better name anyway). Would be nice if you could try to implement it that way. Thanks!
97de30c
to
f7e6f77
Compare
@Siedlerchr and @tobiasdiez I've now added another combo box to the library properties pane. However, now there is reset and Reset to recommended. Isn't it a bit confusing for the user? |
I would suggest renaming "Reset" to "clear" to avoid confusion. I personally would have expected a radio box for switching between biblatex and bibtex but a combox is fine, too. |
I would have expected a toggle switch - or a slider with two settings only. https://controlsfx.bitbucket.io/org/controlsfx/control/ToggleSwitch.html Keeping as is (drop down) is very fine for me. +1 for renaming "Reset" to "Clear"! |
I'm also in favor of renaming @koppor Toggle switches are for boolean values and not to switch between two options. The radio button would put a bit more emphasize on this option (as it would take more space) and would allow the user to immediately see the options. But the dropdown should be also fine. |
I would then suggest to also change the order of the buttons to keep clearing actions (remove selected and remove all) together. How about having Reset to recommended - Remove selected - Remove all |
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.
A bit of code nitpicking...apart from this it looks very good.
src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialogView.java
Outdated
Show resolved
Hide resolved
@@ -33,6 +34,7 @@ | |||
|
|||
@FXML private VBox contentVbox; | |||
@FXML private ComboBox<Charset> encoding; | |||
@FXML private ComboBox<String> databaseMode; |
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.
If you use ComboBox<BibDatabaseMode>
here (and propagate the change), then you don't have to constantly convert between formatted values and parsed modes.
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.
If I do so, the names are not formatted anymore. Also, the view would have knowledge about the model.
I normally always try to avoid that by converting the model to non model datatypes. So I would suggest to leave it this way, what do you think?
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.
You can get the proper display quite easily using similar code as the one below:
jabref/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java
Lines 174 to 177 in a76b8f3
new ViewModelListCellFactory<Formatter>() | |
.withText(Formatter::getName) | |
.withStringTooltip(Formatter::getDescription) | |
.install(formattersCombobox); |
You are right, one should usually not use model classes directly in the ui. So here the "correct" solution would be to wrap the DatabaseMode
in a DatabaseModeViewModel
which exposes the getFormattedName
method. I feel like this is however overkill for this particular situation.
Before this PR is getting merged, I want to discuss the following: |
Hi, Ka0o0. |
Hi @calixtus, |
I think this would be a neat addition! |
Okay, great. I will create an issue for this then. |
@Ka0o0 I currently see following checklist at the PR description: Could you update this regarding what is missing? - Background: We go through the PRs and check for the status. It would be very helpful if the checklist was modified w.r.t. the status. - No over-engineering here. If you just have to work again, you can prefix the PR title with |
@Ka0o0 While resolving the conflicts, I saw that a new string "Database mode" was inserted to the language file. We decided to use "Library" instead of "Database". See #2095 (refs #2748). We use |
550b0fd
to
2f6c288
Compare
@koppor @tobiasdiez sorry for my late reply. I was on holiday this we. |
@Ka0o0 Thank you for following up 🎉 |
Thanks for your work on this issue, and I'm sorry that you came under friendly crossfire on how to best implement this feature which made the whole progress a bit longer than it needed be. I promise the next one will be more straightforward ;-) |
Hi,
this PR adds an additional menu item to switch from biblatex to bibtex and vice versa. As discussed in the issue, I first wanted to add another combobox to the library properties pane but I noticed that in the save actions was a button which depended on the selected.
To keep things simple for 5.0 I rather adopted the way things used to work in Jabref 4.x by adding another menu item.
Any suggestions on this solution?
All the best
Updated Sreen: