-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
164 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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
95 changes: 95 additions & 0 deletions
95
...lug-client/src/main/java/com/owlplug/core/controllers/dialogs/DonateDialogController.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* OwlPlug | ||
* Copyright (C) 2021 Arthur <[email protected]> | ||
* | ||
* This file is part of OwlPlug. | ||
* | ||
* OwlPlug is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 | ||
* as published by the Free Software Foundation. | ||
* | ||
* OwlPlug is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with OwlPlug. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.owlplug.core.controllers.dialogs; | ||
|
||
|
||
import com.owlplug.core.components.LazyViewRegistry; | ||
import com.owlplug.core.utils.PlatformUtils; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.Node; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.Label; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
|
||
@Controller | ||
public class DonateDialogController extends AbstractDialogController { | ||
|
||
@Autowired | ||
private LazyViewRegistry lazyViewRegistry; | ||
@FXML | ||
private Button donateButton; | ||
@FXML | ||
private Button roadmapButton; | ||
@FXML | ||
private Button featureRequestButton; | ||
@FXML | ||
private Button aboutButton; | ||
@FXML | ||
private Button cancelButton; | ||
|
||
DonateDialogController() { | ||
super(550, 480); | ||
this.setOverlayClose(false); | ||
} | ||
|
||
/** | ||
* FXML initialize. | ||
*/ | ||
public void initialize() { | ||
|
||
donateButton.setOnAction(e -> { | ||
PlatformUtils.openDefaultBrowser(this.getApplicationDefaults().getEnvProperty("owlplug.donate.url")); | ||
this.close(); | ||
this.getDialogManager() | ||
.newSimpleInfoDialog("Thank you !", "Thank you so much for contributing to OwlPlug development.\nYour donation will help me to release new versions, stay tuned !") | ||
.show(); | ||
}); | ||
|
||
roadmapButton.setOnAction(e -> { | ||
PlatformUtils.openDefaultBrowser(this.getApplicationDefaults().getEnvProperty("owlplug.roadmap.url")); | ||
}); | ||
|
||
featureRequestButton.setOnAction(e -> { | ||
PlatformUtils.openDefaultBrowser(this.getApplicationDefaults().getEnvProperty("owlplug.github.issues.url")); | ||
}); | ||
|
||
aboutButton.setOnAction(e -> { | ||
PlatformUtils.openDefaultBrowser(this.getApplicationDefaults().getEnvProperty("owlplug.about.url")); | ||
}); | ||
|
||
cancelButton.setOnAction(e -> { | ||
this.close(); | ||
}); | ||
|
||
} | ||
|
||
@Override | ||
protected Node getBody() { | ||
return lazyViewRegistry.get(LazyViewRegistry.DONATE_VIEW); | ||
} | ||
|
||
@Override | ||
protected Node getHeading() { | ||
Label title = new Label("Owlplug is free !"); | ||
title.getStyleClass().add("heading-3"); | ||
return title; | ||
} | ||
|
||
} |
This file contains 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 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
40 changes: 40 additions & 0 deletions
40
owlplug-client/src/main/resources/fxml/dialogs/DonateView.fxml
This file contains 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.*?> | ||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
|
||
<VBox prefWidth="500.0" spacing="10.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.owlplug.core.controllers.dialogs.DonateDialogController"> | ||
<children> | ||
<VBox spacing="20.0"> | ||
<children> | ||
<Label text="The OwlPlug app is completely free to use, offering all its features without any cost." wrapText="true" fx:id=""></Label> | ||
<Label text="However, to keep improving and developing the app, I rely on the support of users. If you enjoy using the app and would like to help me add new features and make it better, please consider donating. Your financial contribution will directly support ongoing development and ensure that I can keep the app available for everyone." wrapText="true" /> | ||
<HBox alignment="CENTER" spacing="10.0" VBox.vgrow="NEVER"> | ||
<children> | ||
<Button fx:id="roadmapButton" contentDisplay="TOP" prefHeight="78.0" prefWidth="115.0" text="Roadmap"> | ||
<graphic> | ||
<SVGPath content="M19.957 4.035c-.345-.024-.682-.035-1.012-.035-7.167 0-11.248 5.464-12.732 9.861l3.939 3.938c4.524-1.619 9.848-5.549 9.848-12.639 0-.367-.014-.741-.043-1.125zm-9.398 11.815l-2.402-2.402c1.018-2.383 3.91-7.455 10.166-7.767-.21 4.812-3.368 8.276-7.764 10.169zm4.559 1.282c-.456.311-.908.592-1.356.842-.156.742-.552 1.535-1.126 2.21-.001-.48-.135-.964-.369-1.449-.413.187-.805.348-1.179.49.551 1.424-.01 2.476-.763 3.462 1.08-.081 2.214-.61 3.106-1.504.965-.962 1.64-2.352 1.687-4.051zm-9.849-5.392c-.482-.232-.965-.364-1.443-.367.669-.567 1.453-.961 2.188-1.121.262-.461.556-.915.865-1.361-1.699.046-3.09.723-4.054 1.686-.893.893-1.421 2.027-1.503 3.106.986-.753 2.039-1.313 3.463-.762.145-.391.305-.785.484-1.181zm6.448.553c-.326-.325-.326-.853 0-1.178.325-.326.853-.326 1.178 0 .326.326.326.854 0 1.179-.326.325-.853.325-1.178-.001zm4.124-4.125c-.65-.65-1.706-.65-2.356 0-.651.651-.651 1.707 0 2.357.65.651 1.706.651 2.357 0 .65-.65.65-1.706-.001-2.357zm-1.591 1.592c-.228-.228-.228-.598 0-.825.227-.228.598-.228.826 0 .227.227.226.597 0 .825-.228.227-.598.227-.826 0zm-12.609 10.555l-.755-.755 4.341-4.323.755.755-4.341 4.323zm4.148 1.547l-.755-.755 3.03-3.054.756.755-3.031 3.054zm-5.034 2.138l-.755-.755 5.373-5.364.756.755-5.374 5.364zm21.083-14.291c-.188.618-.673 1.102-1.291 1.291.618.188 1.103.672 1.291 1.291.189-.619.673-1.103 1.291-1.291-.618-.188-1.102-.672-1.291-1.291zm-14.655-6.504c-.247.81-.881 1.443-1.69 1.69.81.247 1.443.881 1.69 1.69.248-.809.881-1.443 1.69-1.69-.81-.247-1.442-.88-1.69-1.69zm-1.827-3.205c-.199.649-.706 1.157-1.356 1.355.65.199 1.157.707 1.356 1.355.198-.649.706-1.157 1.354-1.355-.648-.198-1.155-.706-1.354-1.355zm5.387 0c-.316 1.035-1.127 1.846-2.163 2.163 1.036.316 1.847 1.126 2.163 2.163.316-1.036 1.127-1.846 2.162-2.163-1.035-.317-1.845-1.128-2.162-2.163zm11.095 13.64c-.316 1.036-1.127 1.846-2.163 2.163 1.036.316 1.847 1.162 2.163 2.197.316-1.036 1.127-1.881 2.162-2.197-1.035-.317-1.846-1.127-2.162-2.163z" fill="WHITE" /> | ||
</graphic></Button> | ||
<Button fx:id="featureRequestButton" contentDisplay="TOP" prefHeight="78.0" prefWidth="115.0" text="Feature requests"> | ||
<graphic> | ||
<SVGPath content="M24 20h-3v4l-5.333-4h-7.667v-4h2v2h6.333l2.667 2v-2h3v-8.001h-2v-2h4v12.001zm-6-6h-9.667l-5.333 4v-4h-3v-14.001h18v14.001zm-9-4.084h-5v1.084h5v-1.084zm5-2.916h-10v1h10v-1zm0-3h-10v1h10v-1z" fill="WHITE" /> | ||
</graphic></Button> | ||
<Button fx:id="aboutButton" contentDisplay="TOP" prefHeight="78.0" prefWidth="115.0" text="About OwlPlug"> | ||
<graphic> | ||
<SVGPath content="M7 16h13v1h-13v-1zm13-3h-13v1h13v-1zm0-6h-5v1h5v-1zm0 3h-5v1h5v-1zm-17-8v17.199c0 .771-1 .771-1 0v-15.199h-2v15.98c0 1.115.905 2.02 2.02 2.02h19.958c1.117 0 2.022-.904 2.022-2.02v-17.98h-21zm19 17h-17v-15h17v15zm-9-12h-6v4h6v-4z" fill="WHITE" /> | ||
</graphic></Button> | ||
|
||
</children> | ||
</HBox> | ||
<Label text="If you like OwlPlug or want to see new features implemented, you can help me by clicking on the Contribute button. It will redirect you to the donation page." wrapText="true" /> | ||
</children> | ||
</VBox> | ||
<HBox alignment="TOP_RIGHT" spacing="10.0" VBox.vgrow="NEVER"> | ||
<children> | ||
<Button fx:id="donateButton" text="Contribute to OwlPlug" /> | ||
<Button fx:id="cancelButton" text="No, leave" /> | ||
</children> | ||
</HBox> | ||
</children> | ||
</VBox> |