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 button for a user to reset the cite command to the default value. #10580

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

JonathanRech
Copy link
Contributor

Add button in ExternalTab.fxml and link it to a method in ExternalTabViewModel.java that sets the citeCommandProperty to the specified default value \cite{key1,key2}

  • Added new button
  • changed 3rd column prefWidth to align the button
  • The citeCommandProperty is set to the default value that ist stored in the PreferenceService

NewButton

Tooltip

Update CHANGELOG.md

Fixes #10569

In the documentation is a screenshot that doesnt feature the two buttons next zu cite Command. Also the option to reset the command is not mentioned. I'm not sure if that would be necessary though.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Add button in ExternalTab.fxml and link it to a method in ExternalTabViewModel.java that sets the citeCommandProperty to the specified default value
Update CHANGELOG.md
@calixtus
Copy link
Member

Thanks for your interest in JabRef. The corresponding issue is very new, we should discuss it before merging this PR. See my comment: #10569 (comment)

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Very nice and clean implementation.

+1 from my side. Just a minor thing.

Comment on lines 232 to 233
// Reset Cite Command

Copy link
Member

Choose a reason for hiding this comment

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

This comment can be removed, because the method name says the same.

// Reset Cite Command

public void resetCiteCommandToDefault() {
this.citeCommandProperty.setValue(preferences.getDefaults().get(JabRefPreferences.CITE_COMMAND).toString());
Copy link
Member

Choose a reason for hiding this comment

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

I would be better to have this encapsulated in the ExternalApplicationPreferences, e.g. a method
getDefaultCitecommand. Have a look at the PreviewPreferences to see how it's done there

Copy link
Member

Choose a reason for hiding this comment

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

Is probably not a blocker for this PR since this change will anyway be part of a future PR improving all the preferences objects carry their own defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just read this. I still changed both requested Changes

Delete redundant comment.
Encapsulate getDefaultCiteCommand in ExternalApplicationsPreferences and update JabRefPreferences accordingly
@Siedlerchr Siedlerchr added this pull request to the merge queue Oct 26, 2023
@Siedlerchr
Copy link
Member

Thanks, looks good to me now!

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 26, 2023
* upstream/Main:
  openrerwrite
  Update .github/PULL_REQUEST_TEMPLATE.md
  Update PULL_REQUEST_TEMPLATE.md
  Update .github/PULL_REQUEST_TEMPLATE.md
  Update PULL_REQUEST_TEMPLATE.md
  Replace "fixes" by "resolves"
  Change JavaDoc to annotation (JabRef#10571)
  Fix link (JabRef#10575)
  Enable collecting GitHub build artifacts for forks (JabRef#10574)
  Fix file field merging (JabRef#10573)
  Update .gitignore
@calixtus calixtus added this pull request to the merge queue Oct 26, 2023
Merged via the queue into JabRef:main with commit d6a0e59 Oct 26, 2023
17 checks passed
Siedlerchr added a commit to guipmenezes/jabref that referenced this pull request Nov 1, 2023
* upstream/main: (419 commits)
  Fix CHANGELOG.md
  Bump commons-cli:commons-cli from 1.5.0 to 1.6.0 (JabRef#10607)
  Fix issue JabRef#9306: Move "Open only one instance of JabRef" preference option to somewhere else (JabRef#10602)
  Update README.md (JabRef#10604)
  Bump me.champeau.jmh from 0.7.1 to 0.7.2
  Bump org.beryx.jlink from 3.0.0 to 3.0.1
  Bump com.dlsc.gemsfx:gemsfx from 1.82.0 to 1.84.0
  Bump org.apache.logging.log4j:log4j-to-slf4j from 2.21.0 to 2.21.1
  Synchronize scrollbars in the change resolver dialog (JabRef#10587)
  Add button for a user to reset the cite command to the default value. (JabRef#10580)
  openrerwrite
  Update .github/PULL_REQUEST_TEMPLATE.md
  Update PULL_REQUEST_TEMPLATE.md
  Update .github/PULL_REQUEST_TEMPLATE.md
  Update PULL_REQUEST_TEMPLATE.md
  Replace "fixes" by "resolves"
  Change JavaDoc to annotation (JabRef#10571)
  Fix link (JabRef#10575)
  Enable collecting GitHub build artifacts for forks (JabRef#10574)
  Fix file field merging (JabRef#10573)
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java
#	src/main/java/org/jabref/logic/importer/WebFetchers.java
Siedlerchr added a commit that referenced this pull request Nov 4, 2023
* upstream/main: (1565 commits)
  Enable journal information fetcher directly in popup (#10598)
  Make generate button wider (#10588)
  make openRewrite stable again
  Rename cleanup_pr.yml to cleanup-pr.yml
  Changelog
  Fix failing fetcher tests (#10613)
  ShortDoi
  Fix CHANGELOG.md
  Bump commons-cli:commons-cli from 1.5.0 to 1.6.0 (#10607)
  Fix issue #9306: Move "Open only one instance of JabRef" preference option to somewhere else (#10602)
  Update README.md (#10604)
  Bump me.champeau.jmh from 0.7.1 to 0.7.2
  Bump org.beryx.jlink from 3.0.0 to 3.0.1
  Bump com.dlsc.gemsfx:gemsfx from 1.82.0 to 1.84.0
  Bump org.apache.logging.log4j:log4j-to-slf4j from 2.21.0 to 2.21.1
  Synchronize scrollbars in the change resolver dialog (#10587)
  Add button for a user to reset the cite command to the default value. (#10580)
  openrerwrite
  Update .github/PULL_REQUEST_TEMPLATE.md
  Update PULL_REQUEST_TEMPLATE.md
  ...

# Conflicts:
#	.devcontainer/devcontainer.json
#	build.gradle
#	src/main/java/org/jabref/gui/DefaultInjector.java
#	src/main/java/org/jabref/gui/libraryproperties/general/GeneralProperties.fxml
#	src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java
#	src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java
#	src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java
#	src/main/java/org/jabref/logic/importer/util/MetaDataParser.java
#	src/main/java/org/jabref/model/metadata/MetaData.java
#	src/main/java/org/jabref/preferences/JabRefPreferences.java
Siedlerchr added a commit to liyou969/jabref that referenced this pull request Nov 4, 2023
* upstream/main: (44 commits)
  change codecov (JabRef#10616)
  Add entry based on ISSN number JabRef#10124 (JabRef#10178)
  Enable journal information fetcher directly in popup (JabRef#10598)
  Make generate button wider (JabRef#10588)
  make openRewrite stable again
  Rename cleanup_pr.yml to cleanup-pr.yml
  Changelog
  Fix failing fetcher tests (JabRef#10613)
  ShortDoi
  Fix CHANGELOG.md
  Bump commons-cli:commons-cli from 1.5.0 to 1.6.0 (JabRef#10607)
  Fix issue JabRef#9306: Move "Open only one instance of JabRef" preference option to somewhere else (JabRef#10602)
  Update README.md (JabRef#10604)
  Bump me.champeau.jmh from 0.7.1 to 0.7.2
  Bump org.beryx.jlink from 3.0.0 to 3.0.1
  Bump com.dlsc.gemsfx:gemsfx from 1.82.0 to 1.84.0
  Bump org.apache.logging.log4j:log4j-to-slf4j from 2.21.0 to 2.21.1
  Synchronize scrollbars in the change resolver dialog (JabRef#10587)
  Add button for a user to reset the cite command to the default value. (JabRef#10580)
  openrerwrite
  ...
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.

Add "reset to default" button for "Cite command"
4 participants