Skip to content

Commit

Permalink
Add contributors to about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Jan 8, 2021
1 parent efdbdc7 commit 7e15ba3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 19 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ processResources {
filesMatching("build.properties") {
expand(version: project.findProperty('projVersionInfo') ?: '100.0.0',
"year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)),
"developers": new File('DEVELOPERS').readLines().findAll { !it.startsWith("#") }.join(", "),
"maintainers": new File('MAINTAINERS').readLines().findAll { !it.startsWith("#") }.join(", "),
"azureInstrumentationKey": System.getenv('AzureInstrumentationKey'),
"springerNatureAPIKey": System.getenv('SpringerNatureAPIKey'),
"astrophysicsDataSystemAPIKey": System.getenv('AstrophysicsDataSystemAPIKey'),
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/help/AboutDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
-fx-padding: 5px;
}

.contrib-section {
-fx-padding: 5 5 10 5;
}

.logo-pane {
fx-fill: transparent;
}
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/org/jabref/gui/help/AboutDialog.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.SVGPath?>
<DialogPane prefHeight="600.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.help.AboutDialogView">
<DialogPane prefWidth="530.0" prefHeight="540.0" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.help.AboutDialogView">
<content>
<VBox alignment="CENTER_LEFT" BorderPane.alignment="CENTER">
<HBox alignment="CENTER_LEFT">
Expand Down Expand Up @@ -83,13 +83,11 @@
</bottom>
</BorderPane>
</HBox>
<Label styleClass="sub-heading" text="%Developers"/>
<Label alignment="CENTER" styleClass="info-sections" text="${controller.viewModel.developers}" textAlignment="JUSTIFY" wrapText="true"/>
<Label styleClass="sub-heading" text="%Authors"/>
JabRef would not have been possible without the help of our contributors.
<Label styleClass="sub-heading" text="%Maintainers"/>
<Label alignment="CENTER" styleClass="info-sections" text="${controller.viewModel.maintainers}" textAlignment="JUSTIFY" wrapText="true"/>
<Label styleClass="sub-heading" text="%Contributors"/>
<HBox alignment="CENTER_LEFT">
<Label styleClass="space-after" text="${controller.viewModel.license}" wrapText="true"/>
<Hyperlink onAction="#openContributors" text="contributors"/>
<Hyperlink styleClass="contrib-section" onAction="#openContributors" text="${controller.viewModel.contributors}" wrapText="true"/>
</HBox>
<TextArea fx:id="textAreaVersions" editable="false" prefHeight="100.0" prefWidth="200.0" styleClass="info-sections"/>
</VBox>
Expand Down
22 changes: 16 additions & 6 deletions src/main/java/org/jabref/gui/help/AboutDialogViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public class AboutDialogViewModel extends AbstractViewModel {
private final ReadOnlyStringWrapper environmentInfo = new ReadOnlyStringWrapper();
private final Logger logger = LoggerFactory.getLogger(AboutDialogViewModel.class);
private final ReadOnlyStringWrapper heading = new ReadOnlyStringWrapper();
private final ReadOnlyStringWrapper developers = new ReadOnlyStringWrapper();
private final ReadOnlyStringWrapper maintainers = new ReadOnlyStringWrapper();
private final ReadOnlyStringWrapper license = new ReadOnlyStringWrapper();
private final ReadOnlyStringWrapper contributors = new ReadOnlyStringWrapper();
private final ReadOnlyBooleanWrapper isDevelopmentVersion = new ReadOnlyBooleanWrapper();
private final DialogService dialogService;
private final ReadOnlyStringWrapper developmentVersion = new ReadOnlyStringWrapper();
Expand All @@ -54,8 +55,9 @@ public AboutDialogViewModel(DialogService dialogService, ClipBoardManager clipBo
Collectors.joining("--"));
developmentVersion.set(dev);
}
developers.set(buildInfo.developers);
maintainers.set(buildInfo.maintainers);
license.set(Localization.lang("License") + ":");
contributors.set(Localization.lang("JabRef would not have been possible without the help of our contributors."));
changelogUrl = buildInfo.version.getChangelogUrl();
versionInfo = String.format("JabRef %s%n%s %s %s %nJava %s %nJavaFX %s", buildInfo.version, BuildInfo.OS,
BuildInfo.OS_VERSION, BuildInfo.OS_ARCH, BuildInfo.JAVA_VERSION, BuildInfo.JAVAFX_VERSION);
Expand All @@ -81,12 +83,12 @@ public String getVersionInfo() {
return versionInfo;
}

public ReadOnlyStringProperty developersProperty() {
return developers.getReadOnlyProperty();
public ReadOnlyStringProperty maintainersProperty() {
return maintainers.getReadOnlyProperty();
}

public String getDevelopers() {
return developers.get();
public String getMaintainers() {
return maintainers.get();
}

public ReadOnlyStringProperty headingProperty() {
Expand All @@ -105,6 +107,14 @@ public String getLicense() {
return license.get();
}

public ReadOnlyStringProperty contributorsProperty() {
return contributors.getReadOnlyProperty();
}

public String getContributors() {
return contributors.get();
}

public String getEnvironmentInfo() {
return environmentInfo.get();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/logic/util/BuildInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class BuildInfo {


public final Version version;
public final String developers;
public final String maintainers;
public final String year;
public final String azureInstrumentationKey;
public final String springerNatureAPIKey;
Expand Down Expand Up @@ -48,7 +48,7 @@ public BuildInfo(String path) {

version = Version.parse(properties.getProperty("version"));
year = properties.getProperty("year", "");
developers = properties.getProperty("developers", "");
maintainers = properties.getProperty("maintainers", "");
azureInstrumentationKey = BuildInfo.getValue(properties, "azureInstrumentationKey", "");
springerNatureAPIKey = BuildInfo.getValue(properties, "springerNatureAPIKey", "118d90a519d0fc2a01ee9715400054d4");
astrophysicsDataSystemAPIKey = BuildInfo.getValue(properties, "astrophysicsDataSystemAPIKey", "tAhPRKADc6cC26mZUnAoBt3MAjCvKbuCZsB4lI3c");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/build.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=${version}
year=${year}
developers=${developers}
maintainers=${maintainers}
azureInstrumentationKey=${azureInstrumentationKey}
springerNatureAPIKey=${springerNatureAPIKey}
astrophysicsDataSystemAPIKey=${astrophysicsDataSystemAPIKey}
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,10 @@ character=character
word=word
Show\ symmetric\ diff=Show symmetric diff
Copy\ Version=Copy Version
Developers=Developers
Authors=Authors
Maintainers=Maintainers
Contributors=Contributors
License=License
JabRef\ would\ not\ have\ been\ possible\ without\ the\ help\ of\ our\ contributors.=JabRef would not have been possible without the help of our contributors.

HTML\ encoded\ character\ found=HTML encoded character found
booktitle\ ends\ with\ 'conference\ on'=booktitle ends with 'conference on'
Expand Down

0 comments on commit 7e15ba3

Please sign in to comment.