feat: initial commit
This commit is contained in:
parent
7d9905bbcf
commit
753970cfc1
7 changed files with 53 additions and 60 deletions
49
.github/workflows/gradle.yml
vendored
49
.github/workflows/gradle.yml
vendored
|
@ -1,49 +0,0 @@
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Java CI with Gradle
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: windows-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up JDK 22
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
java-version: '22.0.2'
|
|
||||||
distribution: 'zulu'
|
|
||||||
java-package: 'jdk+fx'
|
|
||||||
|
|
||||||
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
|
|
||||||
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
|
|
||||||
- name: Setup Gradle
|
|
||||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
|
||||||
|
|
||||||
- name: Run JLink with Gradle Wrapper
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
|
|
||||||
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
|
|
||||||
#
|
|
||||||
# - name: Setup Gradle
|
|
||||||
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
|
||||||
# with:
|
|
||||||
# gradle-version: '8.9'
|
|
||||||
#
|
|
||||||
# - name: Build with Gradle 8.9
|
|
||||||
# run: gradle build
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -39,4 +39,6 @@ bin/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
### Mac OS ###
|
### Mac OS ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
win_jmods
|
22
build.gradle
22
build.gradle
|
@ -14,6 +14,14 @@ repositories {
|
||||||
maven {
|
maven {
|
||||||
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
|
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
name = "GitHubPackages"
|
||||||
|
url = "https://maven.pkg.github.com/ineanto/qodos"
|
||||||
|
credentials {
|
||||||
|
username = System.getenv("GITHUB_ACTOR")
|
||||||
|
password = System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
|
@ -50,19 +58,23 @@ test {
|
||||||
}
|
}
|
||||||
|
|
||||||
jlink {
|
jlink {
|
||||||
imageZip = project.file("${rootProject.layout.buildDirectory.asFile.get().absolutePath}/distributions/app-${javafx.platform.classifier}.zip")
|
targetPlatform("win") {
|
||||||
|
jdkHome = jdkDownload("https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_windows-x64_bin.zip")
|
||||||
|
addExtraModulePath("./win_jmods")
|
||||||
|
}
|
||||||
|
|
||||||
|
imageZip = project.file("${rootProject.layout.buildDirectory.asFile.get().absolutePath}/distributions/qodos-${javafx.platform.classifier}.zip")
|
||||||
options = [
|
options = [
|
||||||
'--strip-debug',
|
'--strip-debug',
|
||||||
'--compress',
|
'--compress',
|
||||||
'2',
|
'zip-6',
|
||||||
'--no-header-files',
|
'--no-header-files',
|
||||||
'--no-man-pages',
|
'--no-man-pages',
|
||||||
'--module-path',
|
|
||||||
'/home/ineanto/IdeaProjects/qodos/win_jmods'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
launcher {
|
launcher {
|
||||||
name = 'app'
|
name = 'qodos'
|
||||||
|
noConsole = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class AlertDisplay {
|
||||||
new ButtonType("Fermer", ButtonBar.ButtonData.CANCEL_CLOSE)
|
new ButtonType("Fermer", ButtonBar.ButtonData.CANCEL_CLOSE)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
alert.setTitle(null);
|
||||||
alert.setHeaderText("Erreur");
|
alert.setHeaderText("Erreur");
|
||||||
alert.initStyle(StageStyle.UTILITY);
|
alert.initStyle(StageStyle.UTILITY);
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
|
@ -29,6 +30,7 @@ public class AlertDisplay {
|
||||||
new ButtonType("Fermer", ButtonBar.ButtonData.CANCEL_CLOSE)
|
new ButtonType("Fermer", ButtonBar.ButtonData.CANCEL_CLOSE)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
alert.setTitle(null);
|
||||||
alert.setHeaderText(header);
|
alert.setHeaderText(header);
|
||||||
alert.initStyle(StageStyle.UTILITY);
|
alert.initStyle(StageStyle.UTILITY);
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
|
@ -40,11 +42,12 @@ public class AlertDisplay {
|
||||||
|
|
||||||
public static void success(String success) {
|
public static void success(String success) {
|
||||||
final Alert alert = new Alert(
|
final Alert alert = new Alert(
|
||||||
Alert.AlertType.CONFIRMATION,
|
Alert.AlertType.INFORMATION,
|
||||||
success,
|
success,
|
||||||
new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE)
|
new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
alert.setTitle(null);
|
||||||
alert.setHeaderText("Succès");
|
alert.setHeaderText("Succès");
|
||||||
alert.initStyle(StageStyle.UTILITY);
|
alert.initStyle(StageStyle.UTILITY);
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class MainController {
|
||||||
exitButton.setOnAction(_ -> System.exit(0));
|
exitButton.setOnAction(_ -> System.exit(0));
|
||||||
|
|
||||||
aboutButton.setOnAction(_ -> AlertDisplay.info("Qodos", "Générateur de QR Code (URL, VCard)\n" +
|
aboutButton.setOnAction(_ -> AlertDisplay.info("Qodos", "Générateur de QR Code (URL, VCard)\n" +
|
||||||
"Version 0.0.1"));
|
"Version 0.0.2"));
|
||||||
|
|
||||||
genderWomenButton.setToggleGroup(toggleGroup);
|
genderWomenButton.setToggleGroup(toggleGroup);
|
||||||
genderMenButton.setToggleGroup(toggleGroup);
|
genderMenButton.setToggleGroup(toggleGroup);
|
||||||
|
|
|
@ -9,8 +9,12 @@ import xyz.ineanto.qodos.url.URLValidator;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public record QRURLGenerator(String url, BufferedImage logo) {
|
public record QRURLGenerator(
|
||||||
|
String url,
|
||||||
|
BufferedImage logo
|
||||||
|
) {
|
||||||
public void generate(Node node) {
|
public void generate(Node node) {
|
||||||
System.out.println("Generating QR Code for URL...");
|
System.out.println("Generating QR Code for URL...");
|
||||||
|
|
||||||
|
@ -39,6 +43,12 @@ public record QRURLGenerator(String url, BufferedImage logo) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final FileChooser chooser = new FileChooser();
|
final FileChooser chooser = new FileChooser();
|
||||||
|
chooser.setInitialFileName("qr");
|
||||||
|
chooser.setSelectedExtensionFilter(
|
||||||
|
new FileChooser.ExtensionFilter("Image Files",
|
||||||
|
List.of("*.png", "*.jpeg", "*.jpg")
|
||||||
|
)
|
||||||
|
);
|
||||||
chooser.setTitle("Sélectionner la destination...");
|
chooser.setTitle("Sélectionner la destination...");
|
||||||
final File file = chooser.showSaveDialog(node.getScene().getWindow());
|
final File file = chooser.showSaveDialog(node.getScene().getWindow());
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,18 @@ import xyz.ineanto.qodos.url.URLValidator;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public record QRVCardGenerator(int gender, String family, String name, String number, String url, String address,
|
public record QRVCardGenerator(
|
||||||
String email, BufferedImage logo) {
|
int gender,
|
||||||
|
String family,
|
||||||
|
String name,
|
||||||
|
String number,
|
||||||
|
String url,
|
||||||
|
String address,
|
||||||
|
String email,
|
||||||
|
BufferedImage logo
|
||||||
|
) {
|
||||||
public void generate(Node node) {
|
public void generate(Node node) {
|
||||||
System.out.println("Generating QR Code for VCard...");
|
System.out.println("Generating QR Code for VCard...");
|
||||||
|
|
||||||
|
@ -59,6 +68,12 @@ public record QRVCardGenerator(int gender, String family, String name, String nu
|
||||||
try {
|
try {
|
||||||
final FileChooser chooser = new FileChooser();
|
final FileChooser chooser = new FileChooser();
|
||||||
chooser.setTitle("Sélectionner la destination...");
|
chooser.setTitle("Sélectionner la destination...");
|
||||||
|
chooser.setInitialFileName("qr");
|
||||||
|
chooser.setSelectedExtensionFilter(
|
||||||
|
new FileChooser.ExtensionFilter("Image Files",
|
||||||
|
List.of("*.png", "*.jpeg", "*.jpg")
|
||||||
|
)
|
||||||
|
);
|
||||||
final File file = chooser.showSaveDialog(node.getScene().getWindow());
|
final File file = chooser.showSaveDialog(node.getScene().getWindow());
|
||||||
|
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
|
|
Loading…
Reference in a new issue