Skip to content

Commit

Permalink
Fixed review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Dec 2, 2024
1 parent 83ca8ff commit 3089819
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
12 changes: 0 additions & 12 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1887,19 +1887,11 @@ We want to have a look that matches our icons in the tool-bar */
-fx-background-color: -fx-control-inner-background;
}

#entryEditor #related-articles-tab * {
-fx-fill: -fx-text-background-color;
}

#entryEditor .ai-tab {
-fx-padding: 20 20 20 20;
-fx-background-color: -fx-control-inner-background;
}

#entryEditor .ai-tab * {
-fx-fill: -fx-text-background-color;
}

#entryEditor .gdpr-notice {
-fx-border-color: -jr-warn;
-fx-border-insets: 5;
Expand All @@ -1909,10 +1901,6 @@ We want to have a look that matches our icons in the tool-bar */
-fx-font-size: 1.3em;
}

#entryEditor .gdpr-notice * {
-fx-fill: -fx-text-background-color;
}

#entryEditor .recommendation-item {
-fx-padding: 0 0 0 20;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
<fx:root type="ScrollPane" styleClass="ai-tab"
xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="org.jabref.gui.ai.components.privacynotice.PrivacyNoticeComponent">
<VBox spacing="20.0" styleClass="gdpr-notice" fx:id="text">
<Label wrapText="true" text="%Privacy notice" styleClass="heading" />
<Text text="%JabRef uses AI providers to enable AI functionality (chatting with attached file(s) and summarization). AI provider is an external service. To enable processing of attached file(s), their contents need to be shared with the currently selected AI provider. As soon as you ask a question, the text content of all PDFs attached to the entry are sent to external service. By using this service you agree to the privacy police of the selected AI provider."/>
<Text text="%This setting may be changed in preferences at any time."/>
<TextFlow fx:id="aiPolicies" />
<GridPane fx:id="aiPolicies" hgap="4" vgap="4" />
<Text fx:id="embeddingModelText" text="%Additionally, we use Deep Java Library (DJL) embedding models for both chatting and summarization. The embedding model will be downloaded in background (size %0) from Deep Java Library servers anonymously." />
<Hyperlink wrapText="true" onAction="#onDjlPrivacyPolicyClick" styleClass="embeddedHyperlink" text="%You find information about the privacy policy here." />
<Button onAction="#onIAgreeButtonClick" text="%I agree"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import javafx.beans.binding.DoubleBinding;
import javafx.fxml.FXML;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;

import org.jabref.gui.DialogService;
import org.jabref.gui.desktop.os.NativeDesktop;
Expand All @@ -25,7 +26,7 @@ public class PrivacyNoticeComponent extends ScrollPane {
private final Logger LOGGER = LoggerFactory.getLogger(PrivacyNoticeComponent.class);

@FXML private VBox text;
@FXML private TextFlow aiPolicies;
@FXML private GridPane aiPolicies;
@FXML private Text embeddingModelText;

private final AiPreferences aiPreferences;
Expand Down Expand Up @@ -68,18 +69,16 @@ private void initialize() {
embeddingModelText.wrappingWidthProperty().bind(textWidth);
}

private void addPrivacyHyperlink(TextFlow textFlow, AiProvider aiProvider) {
Text text = new Text(aiProvider.getLabel() + "\t");
text.wrappingWidthProperty().bind(this.widthProperty());
textFlow.getChildren().addLast(text);
private void addPrivacyHyperlink(GridPane gridPane, AiProvider aiProvider) {
int row = gridPane.getRowCount();
Label aiName = new Label(aiProvider.getLabel());
gridPane.add(aiName, 0, row);

Hyperlink hyperlink = new Hyperlink(aiProvider.getApiUrl());
hyperlink.setWrapText(true);
hyperlink.setFont(text.getFont());
// hyperlink.setFont(aiName.getFont());
hyperlink.setOnAction(event -> openBrowser(aiProvider.getApiUrl()));
textFlow.getChildren().addLast(hyperlink);

textFlow.getChildren().addLast(new Text("\n"));
gridPane.add(hyperlink, 1, row);
}

@FXML
Expand Down

0 comments on commit 3089819

Please sign in to comment.