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

Changing settings in "Options" > "Manage external file types" has no effect #5846

Closed
systemoperator opened this issue Jan 19, 2020 · 3 comments · Fixed by #5894
Closed

Changing settings in "Options" > "Manage external file types" has no effect #5846

systemoperator opened this issue Jan 19, 2020 · 3 comments · Fixed by #5894

Comments

@systemoperator
Copy link
Contributor

I'm using JabRef 5 master build (JabRef-5.0-portable_linux.tar.gz, JabRef 5.0-beta.342--2020-01-15--58709e7, Linux 4.4.0-171-generic amd64 Java 13.0.2) on Ubuntu 16.04.

Steps to reproduce the behavior:

  1. Click "Options"
  2. Click "Manage external file types"
  3. Click pencil edit icon
  4. change some values
  5. Click "OK"
  6. Result: The changed settings are lost.

Whenever changing some settings in step 4 and clicking "OK", the settings will not be stored: The shown table is not being updated and when clicking the same pencil edit icon once again, the original, unchanged settings appear once again.

In my case, I especially wanted to assign a specific pdf reader/editor solely for JabRef (which should be different to the default pdf reader on my system), but setting a different one could not be accomplished.

At this point I would like to reference an already mentioned issue, which is related to setting a different pdf reader/editor: "Open PDF options" #5529 Nevertheless, this referenced issue is about a different dialog in JabRef.

In my opinion, it should really be possible to assign user-specific programs to given file types and not relying on the system's settings. This allows important program-specific personalization.

@systemoperator
Copy link
Contributor Author

systemoperator commented Jan 28, 2020

I have looked into this issue for quite some time now. Maybe someone can give me some hints in the code.

When I click Options > Manage external file types, then

    ViewLoader.view(this)
              .load()
              .setAsDialogPane(this);

gets called in CustomizeExternalFileTypesDialog.java.

When some settings get submitted by clicking the OK button, then

    this.setResultConverter(button -> {
        if (button == ButtonType.OK) {
            viewModel.storeSettings();
        }
        return null;
    });

gets called in the same file.

My questions are:

  1. How can I refresh the content of the table, after editing an existing default file type?
  2. Where exactly are the default file types stored, when a different program gets associated?
    2.1. Changing some settings of the default file types will currently not being stored in prefs.xml. This is an issue, right?
  3. Where is the code for saving all settings to ~/.java/.userPrefs/org/jabref/prefs.xml?

Maybe someone can give me some hints in general about this issue.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 29, 2020

Hi,
thanks for your ongoing interest in JabRef
I will try to answer your questions:
3. ) org.jabref.preferences JabRefPreferences/PreferencesService: Jabref uses the java Preferences mechanism. On Windows it will store the settings in the registry, on linux in that path.

1+ 2.) You probably need to return the edited item from the EditExternalFileTypeEntryDialog in the class
CustomizeExternalFileTypesViewModel and add it to the ObservableList. As the name implies, the ObservableList is a speciality in JavaFX, it automatically notifies any subscribers of new content. As the table is bound (aka subsribed) to the list, it wil be updated automatically.

Edit// In our devdocs we have some further information on how JavaFX dialogs are implemented in JabRef https://devdocs.jabref.org/javafx

The method for showing the dialog is showEditDialog and it doesn't return the modified object.
And from a quick look it seems like you are right, modifications are nowhere saved.

@tobiasdiez
Copy link
Member

This should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.

koppor pushed a commit that referenced this issue Jan 17, 2022
0237ae7 Update journal-fur-kulturpflanzen-journal-of-cultivated-plants.csl (#5848)
ca87cf0 Use container-title for newspaper/magazine articles w/o author (#5847)
1455165 add medium to IEEE (#5846)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 0237ae7
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 a pull request may close this issue.

3 participants