Skip to content
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

Merged
merged 5 commits into from
Nov 13, 2019

Conversation

Ka0o0
Copy link
Contributor

@Ka0o0 Ka0o0 commented Nov 4, 2019

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


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one

Updated Sreen:

Screen Shot 2019-11-06 at 18 21 11

Copy link
Member

@tobiasdiez tobiasdiez left a 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!

@Ka0o0 Ka0o0 force-pushed the fix-5550-biblatex-bibtex-switch branch from 97de30c to f7e6f77 Compare November 6, 2019 17:38
@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 6, 2019

@Siedlerchr and @tobiasdiez I've now added another combo box to the library properties pane.
I've also changed the name of the button to "Reset to recommended".

However, now there is reset and Reset to recommended. Isn't it a bit confusing for the user?

Screen Shot 2019-11-06 at 18 21 11

@Ka0o0 Ka0o0 requested a review from tobiasdiez November 6, 2019 17:42
@Siedlerchr
Copy link
Member

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.

@koppor
Copy link
Member

koppor commented Nov 7, 2019

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"!

@tobiasdiez
Copy link
Member

tobiasdiez commented Nov 8, 2019

I'm also in favor of renaming Reset to Clear. But then also the behavior needs to be changed to really clear the list. (The current behavior is strange anyway...why do we have to different sets of recommended/default actions.)

@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.

@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 8, 2019

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

Copy link
Member

@tobiasdiez tobiasdiez left a 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.

@@ -33,6 +34,7 @@

@FXML private VBox contentVbox;
@FXML private ComboBox<Charset> encoding;
@FXML private ComboBox<String> databaseMode;
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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:

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.

@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 8, 2019

Before this PR is getting merged, I want to discuss the following:
Should we consider updating the save actions if the user changes the database mode and he still has the default/recommended save actions set?

@calixtus
Copy link
Member

calixtus commented Nov 8, 2019

Hi, Ka0o0.
About the buttons: since I saw that iconbuttons were used in some places, I implemented them also in the preferences dialog. Maybe this an idea here too? You could also implement the "remove selected" button in an action column on the right. Just an idea, so the ui would be a bit more consistent.

@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 8, 2019

Hi @calixtus,
yes but I think, we should try to keep this PR small and discuss this separately. Maybe you can create another suggestion issue then?

@tobiasdiez
Copy link
Member

Should we consider updating the save actions if the user changes the database mode and he still has the default/recommended save actions set?

I think this would be a neat addition!

@koppor
Copy link
Member

koppor commented Nov 8, 2019

@Ka0o0 +1 for changing the default save actions. This would IMHO be very intuitive. - Only pro users change the save actions.

Refs #2051

Refs #2601 - follow-up-issue: #3644

@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 9, 2019

Okay, great. I will create an issue for this then.

@koppor
Copy link
Member

koppor commented Nov 9, 2019

@Ka0o0 I currently see following checklist at the PR description:

grafik

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 [WIP] . So we know, the token is on your side - and not on ours to check review comments. I am aware that the PR title then changes often - however, it is more easy to manage (at least for me).

@koppor
Copy link
Member

koppor commented Nov 11, 2019

@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 %0 mode, New %0 library. We have Library properties, so it is IMHO OK to add Library mode. Could you please change that @Ka0o0? This is IMHO the last thing TODO here, right @tobiasdiez?

@koppor koppor mentioned this pull request Nov 11, 2019
@Ka0o0 Ka0o0 force-pushed the fix-5550-biblatex-bibtex-switch branch from 550b0fd to 2f6c288 Compare November 13, 2019 17:03
@Ka0o0
Copy link
Contributor Author

Ka0o0 commented Nov 13, 2019

@koppor @tobiasdiez sorry for my late reply. I was on holiday this we.
I have changed the strings now. Does this PR need anything else?

@koppor koppor changed the title Add switch to change from biblatex to bibtex and vice versa (fix #5550) Add switch to change from biblatex to bibtex and vice versa (fi… Nov 13, 2019
@koppor koppor merged commit 7236581 into JabRef:master Nov 13, 2019
@koppor
Copy link
Member

koppor commented Nov 13, 2019

@Ka0o0 Thank you for following up 🎉

@Ka0o0 Ka0o0 deleted the fix-5550-biblatex-bibtex-switch branch November 13, 2019 18:44
@tobiasdiez
Copy link
Member

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 ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants