-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Handling resetting of PushToApplicationPreferences #14691
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
Closed
Hamza-Azeem
wants to merge
11
commits into
JabRef:main
from
Hamza-Azeem:enable-resetting-of-push-to-application-notification
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
62303f0
Handling resetting of PushToApplicationPreferences
Hamza-Azeem 2d0f027
removing low level api from high level implementaions addressing feed…
Hamza-Azeem 4cf0d9d
Handling resetting of PushToApplicationPreferences
Hamza-Azeem b171c12
removing low level api from high level implementaions addressing feed…
Hamza-Azeem 6cefbfd
addressing code review comments
Hamza-Azeem fae10a3
Merge branch 'enable-resetting-of-push-to-application-notification' o…
Hamza-Azeem c6e5a64
Merge branch 'main' into enable-resetting-of-push-to-application-noti…
Hamza-Azeem e8dc609
Merge branch 'JabRef:main' into enable-resetting-of-push-to-applicati…
Hamza-Azeem d110ae3
Fix submodules
Hamza-Azeem 896cba3
Fix checkstyle
Hamza-Azeem 7029a35
Fix submodules
Hamza-Azeem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package org.jabref.logic.push; | ||
|
|
||
| import java.io.File; | ||
| import java.util.Map; | ||
|
|
||
| import javafx.beans.property.MapProperty; | ||
|
|
@@ -9,6 +10,11 @@ | |
| import javafx.beans.property.SimpleStringProperty; | ||
| import javafx.beans.property.StringProperty; | ||
| import javafx.collections.FXCollections; | ||
| import javafx.collections.ObservableMap; | ||
|
|
||
| import org.jabref.logic.os.OS; | ||
|
|
||
| import static com.google.common.base.StandardSystemProperty.USER_HOME; | ||
|
|
||
| public class PushToApplicationPreferences { | ||
| private final StringProperty activeApplicationName; | ||
|
|
@@ -19,6 +25,39 @@ public class PushToApplicationPreferences { | |
| private final ObjectProperty<CitationCommandString> citeCommand; | ||
| private final ObjectProperty<CitationCommandString> defaultCiteCommand; | ||
|
|
||
| private PushToApplicationPreferences() { | ||
| this.activeApplicationName = new SimpleStringProperty("Texmaker"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ObservableMap<String, String> commands = FXCollections.observableHashMap(); | ||
| commands.put("Texmaker", OS.detectProgramPath("texmaker", "Texmaker")); | ||
| commands.put("WinEdt", OS.detectProgramPath("WinEdt", "WinEdt Team\\WinEdt")); | ||
| commands.put("TeXstudio", OS.detectProgramPath("texstudio", "TeXstudio")); | ||
| commands.put("TeXworks", OS.detectProgramPath("texworks", "TeXworks")); | ||
| commands.put("Sublime Text", OS.detectProgramPath("subl", "Sublime")); | ||
| commands.put("LyX/Kile", USER_HOME + File.separator + ".lyx/lyxpipe"); | ||
| commands.put("VScode", OS.detectProgramPath("Code", "Microsoft VS Code")); | ||
| commands.put("Vim", "vim"); | ||
| commands.put("Emacs", OS.WINDOWS ? "emacsclient.exe" : "emacsclient"); | ||
| this.commandPaths = new SimpleMapProperty<>(commands); | ||
|
|
||
| this.emacsArguments = new SimpleStringProperty("-n -e"); | ||
| this.vimServer = new SimpleStringProperty("vim"); | ||
| this.citeCommand = new SimpleObjectProperty<>(CitationCommandString.from("\\cite{key1,key2}")); | ||
| this.defaultCiteCommand = new SimpleObjectProperty<>(CitationCommandString.from("\\cite{key1,key2}")); | ||
| } | ||
|
|
||
| public static PushToApplicationPreferences getDefault() { | ||
| return new PushToApplicationPreferences(); | ||
| } | ||
|
|
||
| public void setAll(PushToApplicationPreferences preferences) { | ||
| this.activeApplicationName.set(preferences.activeApplicationName.get()); | ||
| this.commandPaths.set(preferences.commandPaths); | ||
| this.vimServer.set(preferences.getVimServer()); | ||
| this.emacsArguments.set(preferences.getEmacsArguments()); | ||
| this.citeCommand.set(preferences.getCiteCommand()); | ||
| this.defaultCiteCommand.set(preferences.getDefaultCiteCommand()); | ||
| } | ||
|
|
||
| public PushToApplicationPreferences(String activeApplicationName, | ||
| Map<String, String> commandPaths, | ||
| String emacsArguments, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be modified.