-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix issue #9306: Move "Open only one instance of JabRef" preference option to somewhere else #10602
Changes from 3 commits
25409d9
1590aee
8871338
cc086b1
23234b1
2a80d39
f648e50
ab974d6
67af5e5
bf9ec9d
f0af57e
14f9421
e7b96c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.CheckBox?> | ||
<?import javafx.scene.control.ComboBox?> | ||
<?import javafx.scene.control.Hyperlink?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.Spinner?> | ||
<?import javafx.scene.control.TextField?> | ||
|
@@ -13,7 +14,6 @@ | |
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
<?import org.jabref.gui.icon.JabRefIconView?> | ||
<?import javafx.scene.control.Hyperlink?> | ||
<fx:root spacing="10.0" type="VBox" | ||
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" | ||
fx:controller="org.jabref.gui.preferences.general.GeneralTab"> | ||
|
@@ -52,7 +52,7 @@ | |
|
||
<CheckBox fx:id="fontOverride" text="%Override default font settings" | ||
GridPane.rowIndex="4" GridPane.columnIndex="0"/> | ||
<HBox alignment="CENTER_LEFT" spacing="4.0" disable="${!fontOverride.selected}" | ||
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. Is there a reason why this was deleted? If not then revert 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. It's my negligence. I'm sorry to cause you trouble! 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. No worries, you are here to learn something by contributing to a real open source project and it's part of our mission statement to guide students PS: May I ask from which class/university etc you are? 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.
Thank you. I am a student from NEU of China. I found the test failed and I'm fixing it now. |
||
<HBox alignment="CENTER_LEFT" spacing="4.0" | ||
GridPane.rowIndex="4" GridPane.columnIndex="1"> | ||
<Label text="%Size"/> | ||
<Spinner fx:id="fontSize" styleClass="fontsizeSpinner" editable="true"/> | ||
|
@@ -70,6 +70,13 @@ | |
<CheckBox fx:id="confirmDelete" text="%Show confirmation dialog when deleting entries"/> | ||
<CheckBox fx:id="collectTelemetry" text="%Collect and share telemetry data to help improve JabRef"/> | ||
|
||
<Label styleClass="sectionHeader" text="%Single instance" /> | ||
<HBox alignment="CENTER_LEFT" spacing="10.0"> | ||
<CheckBox fx:id="remoteServer" text="%Enforce single JabRef instance (and allow remote operations) using port" /> | ||
<TextField fx:id="remotePort" maxWidth="100.0" HBox.hgrow="ALWAYS" /> | ||
<Button fx:id="remoteHelp" prefWidth="20.0" /> | ||
</HBox> | ||
|
||
<Label styleClass="sectionHeader" text="%Libraries"/> | ||
<GridPane hgap="10.0" vgap="4.0"> | ||
<columnConstraints> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import javafx.scene.control.TextFormatter; | ||
import javafx.util.converter.IntegerStringConverter; | ||
|
||
import org.jabref.gui.Globals; | ||
import org.jabref.gui.actions.ActionFactory; | ||
import org.jabref.gui.actions.StandardActions; | ||
import org.jabref.gui.help.HelpAction; | ||
|
@@ -25,10 +26,13 @@ | |
import org.jabref.logic.l10n.Language; | ||
import org.jabref.logic.l10n.Localization; | ||
import org.jabref.model.database.BibDatabaseMode; | ||
import org.jabref.model.entry.BibEntryTypesManager; | ||
import org.jabref.model.util.FileUpdateMonitor; | ||
|
||
import com.airhacks.afterburner.views.ViewLoader; | ||
import com.tobiasdiez.easybind.EasyBind; | ||
import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; | ||
import jakarta.inject.Inject; | ||
|
||
public class GeneralTab extends AbstractPreferenceTabView<GeneralTabViewModel> implements PreferencesTab { | ||
|
||
|
@@ -49,6 +53,11 @@ public class GeneralTab extends AbstractPreferenceTabView<GeneralTabViewModel> i | |
@FXML private Button autosaveLocalLibrariesHelp; | ||
@FXML private CheckBox createBackup; | ||
@FXML private TextField backupDirectory; | ||
@FXML private CheckBox remoteServer; | ||
@FXML private TextField remotePort; | ||
@FXML private Button remoteHelp; | ||
@Inject private FileUpdateMonitor fileUpdateMonitor; | ||
Siedlerchr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Inject private BibEntryTypesManager entryTypesManager; | ||
|
||
private final ControlsFxVisualizer validationVisualizer = new ControlsFxVisualizer(); | ||
|
||
|
@@ -74,7 +83,7 @@ public String getTabName() { | |
} | ||
|
||
public void initialize() { | ||
this.viewModel = new GeneralTabViewModel(dialogService, preferencesService); | ||
this.viewModel = new GeneralTabViewModel(dialogService, preferencesService, fileUpdateMonitor, entryTypesManager); | ||
|
||
new ViewModelListCellFactory<Language>() | ||
.withText(Language::getDisplayName) | ||
|
@@ -127,10 +136,18 @@ public void initialize() { | |
backupDirectory.textProperty().bindBidirectional(viewModel.backupDirectoryProperty()); | ||
backupDirectory.disableProperty().bind(viewModel.createBackupProperty().not()); | ||
|
||
ActionFactory actionFactory1 = new ActionFactory(Globals.getKeyPrefs()); | ||
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. You can remove this, as there is already an instance of ActionFactory 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. OK!:) |
||
actionFactory1.configureIconButton(StandardActions.HELP, new HelpAction(HelpFile.REMOTE, dialogService, preferencesService.getFilePreferences()), remoteHelp); | ||
|
||
Platform.runLater(() -> { | ||
validationVisualizer.initVisualization(viewModel.remotePortValidationStatus(), remotePort); | ||
validationVisualizer.initVisualization(viewModel.fontSizeValidationStatus(), fontSize); | ||
validationVisualizer.initVisualization(viewModel.customPathToThemeValidationStatus(), customThemePath); | ||
}); | ||
|
||
remoteServer.selectedProperty().bindBidirectional(viewModel.remoteServerProperty()); | ||
remotePort.textProperty().bindBidirectional(viewModel.remotePortProperty()); | ||
remotePort.disableProperty().bind(remoteServer.selectedProperty().not()); | ||
} | ||
|
||
@FXML | ||
|
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.