Skip to content

Commit

Permalink
Fix the requested changes.
Browse files Browse the repository at this point in the history
Delete redundant comment.
Encapsulate getDefaultCiteCommand in ExternalApplicationsPreferences and update JabRefPreferences accordingly
  • Loading branch information
Jonathan Rech committed Oct 25, 2023
1 parent e65a203 commit 656f566
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.model.strings.StringUtil;
import org.jabref.preferences.ExternalApplicationsPreferences;
import org.jabref.preferences.JabRefPreferences;
import org.jabref.preferences.PreferencesService;
import org.jabref.preferences.PushToApplicationPreferences;

Expand Down Expand Up @@ -229,9 +228,7 @@ public StringProperty customFileBrowserCommandProperty() {
return this.customFileBrowserCommandProperty;
}

// Reset Cite Command

public void resetCiteCommandToDefault() {
this.citeCommandProperty.setValue(preferences.getDefaults().get(JabRefPreferences.CITE_COMMAND).toString());
this.citeCommandProperty.setValue(preferences.getExternalApplicationsPreferences().getDefaultCiteCommand());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class ExternalApplicationsPreferences {
private final BooleanProperty shouldAutoOpenEmailAttachmentsFolder;
private final StringProperty citeCommand;

private final StringProperty defaultCiteCommand;

private final BooleanProperty useCustomTerminal;
private final StringProperty customTerminalCommand;
private final BooleanProperty useCustomFileBrowser;
Expand All @@ -20,6 +22,7 @@ public class ExternalApplicationsPreferences {
public ExternalApplicationsPreferences(String eMailSubject,
boolean shouldAutoOpenEmailAttachmentsFolder,
String citeCommand,
String defaultCiteCommand,
boolean useCustomTerminal,
String customTerminalCommand,
boolean useCustomFileBrowser,
Expand All @@ -29,6 +32,7 @@ public ExternalApplicationsPreferences(String eMailSubject,
this.eMailSubject = new SimpleStringProperty(eMailSubject);
this.shouldAutoOpenEmailAttachmentsFolder = new SimpleBooleanProperty(shouldAutoOpenEmailAttachmentsFolder);
this.citeCommand = new SimpleStringProperty(citeCommand);
this.defaultCiteCommand = new SimpleStringProperty(defaultCiteCommand);
this.useCustomTerminal = new SimpleBooleanProperty(useCustomTerminal);
this.customTerminalCommand = new SimpleStringProperty(customTerminalCommand);
this.useCustomFileBrowser = new SimpleBooleanProperty(useCustomFileBrowser);
Expand Down Expand Up @@ -131,4 +135,8 @@ public StringProperty kindleEmailProperty() {
public void setKindleEmail(String kindleEmail) {
this.kindleEmail.set(kindleEmail);
}

public String getDefaultCiteCommand() {
return defaultCiteCommand.getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,7 @@ public ExternalApplicationsPreferences getExternalApplicationsPreferences() {
get(EMAIL_SUBJECT),
getBoolean(OPEN_FOLDERS_OF_ATTACHED_FILES),
get(CITE_COMMAND),
(String) defaults.get(CITE_COMMAND),
!getBoolean(USE_DEFAULT_CONSOLE_APPLICATION), // mind the !
get(CONSOLE_COMMAND),
!getBoolean(USE_DEFAULT_FILE_BROWSER_APPLICATION), // mind the !
Expand Down

0 comments on commit 656f566

Please sign in to comment.