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

Refactor file preferences #6779

Merged
merged 17 commits into from
Sep 1, 2020
Merged

Refactor file preferences #6779

merged 17 commits into from
Sep 1, 2020

Conversation

calixtus
Copy link
Member

@calixtus calixtus commented Aug 23, 2020

This PR is going to refactor some parts of the code in relationship with the FilePreferences. It's going to be rather big again, since FilePreferences and other Preferences objects are not clearly distinguishable and this will take probably some time for me to contemplate how to resort them.

Work in progress, but here for you to preview and to comment, if you have some good ideas.

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • 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.

@github-actions
Copy link
Contributor

The JabRef maintainers will add the following name to the AUTHORS file. In case you want to use a different one, please comment here and adjust your name in your git configuration for future commits.

hemantgs
Rolf Green

@calixtus calixtus force-pushed the RefactorFilePreferences branch from d04a14a to 4147133 Compare August 23, 2020 21:59
@github-actions
Copy link
Contributor

The JabRef maintainers will add the following name to the AUTHORS file. In case you want to use a different one, please comment here and adjust your name in your git configuration for future commits.

Nils Streijffert

@calixtus
Copy link
Member Author

grafik
grafik

@calixtus calixtus marked this pull request as ready for review August 31, 2020 20:38
@calixtus calixtus changed the title [WIP] Refactor file preferences Refactor file preferences Aug 31, 2020
switch (initialAutoLinkPreferences.getCitationKeyDependency()) {
case START -> autolinkFileStartsBibtexProperty.setValue(true);
case EXACT -> autolinkFileExactBibtexProperty.setValue(true);
case REGEX -> autolinkUseRegexProperty.setValue(true);
Copy link
Member

Choose a reason for hiding this comment

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

default missing?

@mlep
Copy link
Contributor

mlep commented Aug 31, 2020

@calixtus
I am a bit puzzled by the new import and export window: for me, its content is not about importing and exporting a library, but about the actions taking place when opening and saving a library.
If this content is called import and export, I guess it will be confused with custom import and export, and with the menus file -> import and file -> export.

Note 1: in the new import and export window, the file reformatting section use both save and export, adding to my confusion. My guess is that only save should be used.
Note 2: In Jabref 5.1, in the menu Library -> Library properties, Save is used. Except for the title, which is Export sort order. Confusing. I guess the title should beSave sort order.

@calixtus
Copy link
Member Author

grafik

@calixtus
Copy link
Member Author

@mlep I reworded the tab again to FileTab.
We talked here at JabCon about the difference between SaveSortOrder in LibraryProperties and ExportSortOrder in the PreferencesTab: ExportSortOrder in the Preferences takes effect probably in the custom exporters, while SaveSortOrder has only effect on saving the bib file.

@mlep
Copy link
Contributor

mlep commented Sep 1, 2020

@calixtus Thank for clarifying.
So, if we go with " Options -> Preferences is for default behavior, and Library -> Library properties menu is for a specific file " (as I wrote here: https://docs.jabref.org/setup), I am wondering where to define the default saving order for the library in the Preferences.

In the future, will Options -> Manage custom exports and Options -> Manage custom imports integrate the preferences window? In such a case, an Import and export page in the Preferences will need to be created (and will likely contain the Export sort order).

Happy JabCon20!

@calixtus
Copy link
Member Author

calixtus commented Sep 1, 2020

Yes, thanks for that thought. Refactoring the preferences is a lengthy process I'm working on since some time now and especially here I was pretty clueless about how to reorder them.
It's exactly as you have described it, the options-menu should present all the general and default options for jabref, the library menu the library-specific options which override the general options.
Obviously, the default SaveSortOrder was abolished in favor of an alphabetical SortOrder, which can be adjusted for every single library via library properties, some time ago.
My plan is to integrate all the options dialogues into one grup-d and also in the more further future to integrate all the library properties dialogs into an unified library properties dialog, so we can abolish the "options" menu at all and move the options->preferences menucommand into another menu (like file).

@mlep
Copy link
Contributor

mlep commented Sep 1, 2020

Thank you for your explanation.
I am recognizing your huge effort in improving JabRef and do not want to be disturbing.

@calixtus
Copy link
Member Author

calixtus commented Sep 1, 2020

Thank you for your explanation.
I am recognizing your huge effort in improving JabRef and do not want to be disturbing.

The opposite is the case, I'm thankful for critics, feedback and people thinking about the future in this matter.

@tobiasdiez tobiasdiez merged commit 5ab494e into master Sep 1, 2020
@tobiasdiez tobiasdiez deleted the RefactorFilePreferences branch September 1, 2020 12:20
Siedlerchr added a commit that referenced this pull request Sep 1, 2020
* upstream/master:
  Enable Merging of BibDatabases (#6689)
  Refactor file preferences (#6779)
  Interrupt all running tasks during shutdown (#6118)
  Fixes #6705 , added icon for multiple identifiers (#6809)
  Apply css files correctly to dialogs (#6828)
  Fix link
  Make template more explicit
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.

4 participants