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

Fix Unclear function of preference “Default bibliography mode” #6539

Closed
wants to merge 13 commits into from
Closed

Fix Unclear function of preference “Default bibliography mode” #6539

wants to merge 13 commits into from

Conversation

LuckyOne09
Copy link
Contributor

For fixing #6470
I used the safe-delete in IDEA to help me delete the "Default bibliography mode" in preference dialog.
And I feel that there are no influence on other functionality in displaying result.
If you think there are something inappropriate in my PR, please let me know ^_^

The preference/general tab is like this screenshot now:
image

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • [x]Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member

Unfortunately, as I suspected it's still used in some contexts.
JabRefPreferences has a method which is used for things like the shared databse functionality

if you look at the usage of this method you will see that it's still used in many plaes.
public BibDatabaseMode getDefaultBibDatabaseMode(

=> So we have to just rename or clarify the option in the preferences

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment

@LuckyOne09
Copy link
Contributor Author

Unfortunately, as I suspected it's still used in some contexts.
JabRefPreferences has a method which is used for things like the shared databse functionality

if you look at the usage of this method you will see that it's still used in many plaes.
public BibDatabaseMode getDefaultBibDatabaseMode(

=> So we have to just rename or clarify the option in the preferences

Thank you for your suggestions.

But just in my opinion, I feel it is not a serious problem that there are some methods like getDefaultBibDatabaseMode(). Since there is always a default value for BibDatabaseMode. Therefore, it won't cause any exception at least.

And for the changing part in my PR. These codes are only related to general tab. Therefore, I feel it is enough to maintain correctness by guaranteeing the biblatexmode no change.

I don't know if I misunderstand something. If any, please let me know ^_^

@Siedlerchr
Copy link
Member

Okay, I will try to explain what I mean, it was maybe not that clear with all the preferences.

The value selected in the combobox is stored in the GeneralPreferences, part of JabRefPreferences under the key BIBLATEX_DEFAULT_MODE and converted to a boolean, true for biblatex, false for bibtex.
See storeGeneralPreferences.

The stored value is then converted from boolean getDefaultBibDatabaseMode to the Mode again.

This value is checked in several other , for example in the BibTexKeyPatternPanel to determine which fields to show.

Globals.entryTypesManager.getAllTypes(preferences.getDefaultBibDatabaseMode()),

It's also used to set the library mode when you connect to a shared SQL database. So if you set it to bibtex in the preferences and connect to a shared library , the library will be automatically in bibtex node.
And it's used to check when you open a bib file without JabRef-metadata and for custom entry types. see CheckForNewEntryTypesAction.
I fear if we remove this completely, we will make some users unhappy.

PS: Some History on the two modes:
The reason for these two modes is that back in the days when Tex was created there was only bibtex, it was created around 1988 and it was not further developed.
So some people decided to create biblatex meant to be the successor. However, still today many journals still only accept the plain old bibtex in their submissions. That's why JabRef has both.

@koppor koppor changed the title Attempt to fix issue#6470 Attempt to fix issue #6470 May 27, 2020
@@ -136,7 +132,7 @@ public void storeSettings() {

preferencesService.storeGeneralPreferences(new GeneralPreferences(
selectedEncodingProperty.getValue(),
selectedBiblatexModeProperty.getValue(),
((JabRefPreferences) preferencesService).getBoolean(JabRefPreferences.BIBLATEX_DEFAULT_MODE) ? BibDatabaseMode.BIBLATEX : BibDatabaseMode.BIBTEX,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the user have the possibility to change that value (JabRefPreferences.BIBLATEX_DEFAULT_MODE)? Is it more a constant now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the variable itself or the value it point to in JabRefPreferences.prefs? If you mean the variable itself, the access modifier for it is final, so I think it is a constant. If you mean the value it point to in JabRefPreferences.prefs, I think GeneralTabViewModel.storeSettings() does something to change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for your interest in preferences refactoring and simplifying. However, there are some architectural decisions we probably failed yet to communicate enough publicly.

Please do not use direct calls to JabRefPreferences::get etc. anymore. We are working in abstracting access to the preferences to modularize JabRef in the long run.
You can use preferences objects instead which can be received by calls to a PreferencesService. (getGeneralPreferences or similar)

Besides that, I agree with @Siedlerchr , there are some places and case scenarios, people will need to rely on bibtex mode instead of biblatex as default. So we shouldn't kill a feature in JabRef, without a strong necessity.

Thank you anyways. Don't hesitate to ask us about the roadmap of JabRef, about ideas you have and want to realize etc. The JabRef developer chat in gitter is open for discussion. Free software is meant for developers to discuss things and to help each other.

@LuckyOne09
Copy link
Contributor Author

Okay, I will try to explain what I mean, it was maybe not that clear with all the preferences.

The value selected in the combobox is stored in the GeneralPreferences, part of JabRefPreferences under the key BIBLATEX_DEFAULT_MODE and converted to a boolean, true for biblatex, false for bibtex.
See storeGeneralPreferences.

The stored value is then converted from boolean getDefaultBibDatabaseMode to the Mode again.

This value is checked in several other , for example in the BibTexKeyPatternPanel to determine which fields to show.

Globals.entryTypesManager.getAllTypes(preferences.getDefaultBibDatabaseMode()),

It's also used to set the library mode when you connect to a shared SQL database. So if you set it to bibtex in the preferences and connect to a shared library , the library will be automatically in bibtex node.
And it's used to check when you open a bib file without JabRef-metadata and for custom entry types. see CheckForNewEntryTypesAction.
I fear if we remove this completely, we will make some users unhappy.

PS: Some History on the two modes:
The reason for these two modes is that back in the days when Tex was created there was only bibtex, it was created around 1988 and it was not further developed.
So some people decided to create biblatex meant to be the successor. However, still today many journals still only accept the plain old bibtex in their submissions. That's why JabRef has both.

@Siedlerchr Thank you for your patience. I think I understand your worries. So how should I do now? Just change the name to "Default library type" or something else?

@Siedlerchr
Copy link
Member

Thank you for your patience. I think I understand your worries. So how should I do now? Just change the name to "Default library type" or something else?

@LuckyOne09 Yes, change it to Default library type and maybe a help tool tip like "Default library mode for shared or imported libraries"

@tobiasdiez
Copy link
Member

With view towards what we discussed in the last dev call, I would propose to use this preference option also for the "New library" command. That is, remove the submenus "Bibtex" and "Biblatex" which are currently shown and always create a new library with the option specified in the preferences.

@JabRef/developers what do you think?

@Siedlerchr
Copy link
Member

@tobiasdiez I'm strongly against removing this selection from the menu. I remember in the past we only had one button "New bibtex library" and then we added "New biblatex" as well. For me it's still important to have this selection at the beginning. Otherwise it requires extra work changing it in the library properties. And I guess this is a tradeoff vs pro users and normal users

@tobiasdiez
Copy link
Member

Mhhh...it's like 4 clicks to change the library type and then also only if it's not your usual default type. Given the fact that the discourse question concerning the difference of bibtex and biblatex is the one with the most hits, I guess quite a few users might be irritated what to choose - and this for the very first interaction with JabRef 😞
I really think we should streamline the process of creating a new library as much as possible.

@koppor
Copy link
Member

koppor commented May 29, 2020

+1 for streamling.

At a fresh installation, the format still should be "BibTeX". - Improved: If pdflatex.exe exists, choose BibTeX at first startup, otherwise BibLaTeX.

Since 5.0, we do not show the mode any more. I am working to reintroduce it at Fix setting of title (and remove obsolete comments) by koppor · Pull Request #6129 · JabRef/jabref
#6129.

@Siedlerchr
Copy link
Member

I would then vote to have biblatex as default mode. As it's the defacto modern foimat we should make it our default as well. Despite that, if you still need bibtex for some journals there are tools for an automatic conversion.
Refs: plk/biblatex#292
https://gitlab.com/Nickkolok/biblatex2bibitem

@koppor
Copy link
Member

koppor commented May 29, 2020

In the context of computer science, I have huge difficulties with BibLaTeX as default mode. In our main publishers: Springer and ACM, there is no proper BibLaTeX style. (BibLaTeX LNCS flawed, IEEE has one, for ACM there is a workaround)

Thus, the proposal for checking of presence of pdflatex.exe. The main latex users at PhD level will use bibtex (in the field of computer science and most likely also other natural science fields). The main latex users at student level will use biblatex. The non-latex users will use most likely happpy with BibLaTeX since they will use it with OpenOffice, Word, ...

This text is based on my 12+ years experience in research+teaching, publishing 100+ papers with different co-authors using LaTeX, and maintaining improved templates for LNCS, IEEE and contribution to Gesellschaft für Informatik e.V. (GI)'s template.

@koppor
Copy link
Member

koppor commented May 29, 2020

Despite that, if you still need bibtex for some journals there are tools for an automatic conversion.
Refs: plk/biblatex#292
gitlab.com/Nickkolok/biblatex2bibitem

Are these tools better than JabRef in their conversion? JabRef also offers a conversion! See Cleanup entries. Needs to be documented though.

@koppor
Copy link
Member

koppor commented May 29, 2020

Seems to be a topic for our next devcall!

@LuckyOne09
Copy link
Contributor Author

Thank you for your patience. I think I understand your worries. So how should I do now? Just change the name to "Default library type" or something else?

@LuckyOne09 Yes, change it to Default library type and maybe a help tool tip like "Default library mode for shared or imported libraries"

Thank you for your guidances.
I am trying to do this. But I found that I can not
change<Label text="%Default bibliography mode" GridPane.rowIndex="2"/> in GeneralTab.fxml
to <Label text="%Default library type" GridPane.rowIndex="2"/>
directly. IDEA ask me to change the content of build.property and I think it is inappropriate.

I found that I could write like this:

        <Label GridPane.rowIndex="2">
            <text>Default library type</text>
        </Label>

But I think it is inconsistent with other code.
So could you give me some hints for this, in fact, I did not use this kind of advanced syntax in JavaFX. Sorry for this.

And another question is that could you give me some samples/screenshots of help tool tips showed in jabref. I didn't find some sample for this, so I can't know what the help tool tip should look like.

@koppor
Copy link
Member

koppor commented Jun 9, 2020

DevCall decision: Remove sub menu at new database and create in default mode.

grafik

@Siedlerchr
Copy link
Member

@LuckyOne09 It would be really cool if you could implement the changes from our devCall decision.
So the preferences stay as they are and you just rename them to Default library type.
You then need to adjust the l10n/en.properties file

@koppor koppor changed the title Attempt to fix issue #6470 Fix Unclear function of preference “Default bibliography mode” Jun 16, 2020
@koppor koppor added the status: changes required Pull requests that are not yet complete label Jun 16, 2020
@koppor
Copy link
Member

koppor commented Jul 7, 2020

This is a good start. Since there was no activity since a few weeks and we would like to get this in, we take over at this point.

@LuckyOne09
Copy link
Contributor Author

LuckyOne09 commented Jul 7, 2020

This is a good start. Since there was no activity since a few weeks and we would like to get this in, we take over at this point.

Oh, I am so sorry about forgetting this issue totally. It is nice that you can take it over since you are much more professional. Thank you for your guidance again. Looking forward to new JabRef version 🥇 👍

@calixtus calixtus self-assigned this Aug 19, 2020
@calixtus calixtus mentioned this pull request Aug 19, 2020
5 tasks
@calixtus
Copy link
Member

Hi @LuckyOne09 I implemented the changes we have decided in the devcall, to clean up a bit in the PRs, but I did it in this case from a fresh start. I hope you don't mind. Thanks anyways for your work and interest in JabRef. Don't let this closed PR bring you down, maybe it's our fault, that we failed to communicate our roadmap and design principles for JabRef. Sorry.

We would be very happy, if you decide to think about working on another issue. Maybe you would like to take a look on the good first issues list again? https://github.com/JabRef/jabref/issues?q=is%3Aissue+is%3Aopen+good+label%3A%22good+first+issue%22 or here: https://github.com/koppor/jabref/issues?q=is%3Aissue+is%3Aopen+good+label%3A%22good+first+issue%22

@calixtus calixtus closed this Aug 19, 2020
@LuckyOne09
Copy link
Contributor Author

I don't mind absolutely, thank you for your guidance, I will take a look again and see what I can help for JabRef😁.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: changes required Pull requests that are not yet complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants