From b006fe46c7c6d6b459eeab07a73cf8fc4de8a39a Mon Sep 17 00:00:00 2001 From: David Gerber Date: Fri, 22 Nov 2024 23:10:48 +0100 Subject: [PATCH] Improve account creation window --- .../AccountCreationWindowController.java | 10 ++++-- .../main/resources/i18n/messages.properties | 4 ++- .../resources/i18n/messages_fr.properties | 1 - .../view/account/account_creation.fxml | 31 +++++++++++++++---- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/ui/src/main/java/io/xeres/ui/controller/account/AccountCreationWindowController.java b/ui/src/main/java/io/xeres/ui/controller/account/AccountCreationWindowController.java index b2368153..bb77948d 100644 --- a/ui/src/main/java/io/xeres/ui/controller/account/AccountCreationWindowController.java +++ b/ui/src/main/java/io/xeres/ui/controller/account/AccountCreationWindowController.java @@ -119,6 +119,7 @@ public void initialize() .doOnError(throwable -> { UiUtils.showAlertError(throwable); setInProgress(false); + status.setText(null); }) .subscribe(); } @@ -136,6 +137,7 @@ else if (selectedFile.getPath().endsWith(".gpg") || selectedFile.getPath().endsW .doOnError(throwable -> { UiUtils.showAlertError(throwable); setInProgress(false); + status.setText(null); }) .subscribe()); } @@ -184,8 +186,8 @@ public void generateProfileAndLocation(String profileName, String locationName) configClient.createProfile(profileName).doOnSuccess(unused -> Platform.runLater(() -> generateLocation(profileName, locationName))) .doOnError(e -> Platform.runLater(() -> { UiUtils.showAlertError(e); - //UiUtils.showError(this.profileName, MessageFormat.format(bundle.getString("account.generation.profile.error"), e.getMessage())); setInProgress(false); + status.setText(null); })) .subscribe(); } @@ -198,8 +200,9 @@ private void generateLocation(String profileName, String locationName) configClient.createLocation(locationName).doOnSuccess(unused -> Platform.runLater(() -> generateIdentity(profileName))) .doOnError(e -> Platform.runLater(() -> { - UiUtils.alert(ERROR, e.getMessage()); // XXX: fix! + UiUtils.showAlertError(e); setInProgress(false); + status.setText(null); })) .subscribe(); } @@ -214,8 +217,9 @@ private void generateIdentity(String identityName) result.doOnSuccess(identityResponse -> Platform.runLater(this::openDashboard)) .doOnError(e -> Platform.runLater(() -> { - UiUtils.alert(ERROR, e.getMessage()); + UiUtils.showAlertError(e); setInProgress(false); + status.setText(null); })) .subscribe(); } diff --git a/ui/src/main/resources/i18n/messages.properties b/ui/src/main/resources/i18n/messages.properties index 493f98ee..b728f534 100644 --- a/ui/src/main/resources/i18n/messages.properties +++ b/ui/src/main/resources/i18n/messages.properties @@ -115,14 +115,16 @@ main.status.dht.stats=Number of peers: {0,number,integer}\nReceived packets: {1, # Account creation +account.welcome=Welcome to Xeres +account.welcome.tip=You need to create a profile and a location. A profile is usually your name or nickname and a location is your machine. You can have several locations like a desktop and a laptop that both use the same profile. Use the import option to import a profile that you already created before. Everything is always stored locally so don't forget to back up your data. The 'Help/Documentation' menu is always available and leaving your mouse pointer above a user interface element will show a help tooltip. account.profile=Profile account.profile.prompt=Profile name account.profile.tip=Use a nickname or real name. A profile can have several locations. account.location=Location account.location.prompt=Location name account.location.tip=This is your Xeres' instance on this device. Use your device's nickname or model. +account.options=Options account.generation.profile-keys=Generating profile keys... -account.generation.profile.error=Error while creating profile: {0} account.generation.location-keys-and-certificate=Generating location keys and certificate... account.generation.identity=Generating identity... account.generation.profile-load=Select a Xeres profile file (xeres_backup.xml), a Retroshare keyring (retroshare_secret_keyring.gpg) or a Retroshare profile (*.asc) diff --git a/ui/src/main/resources/i18n/messages_fr.properties b/ui/src/main/resources/i18n/messages_fr.properties index c08646f8..6f8f6b95 100644 --- a/ui/src/main/resources/i18n/messages_fr.properties +++ b/ui/src/main/resources/i18n/messages_fr.properties @@ -112,7 +112,6 @@ account.location=Localisation account.location.prompt=Nom de localisation account.location.tip=Ceci est votre instance Xeres sur cet appareil. Utilisez le nom de votre appareil ou le model. account.generation.profile-keys=Génération des clefs de profile... -account.generation.profile.error=Erreur lors de la création du profile: {0} account.generation.location-keys-and-certificate=Génération des clefs de localisation et du certificat... account.generation.identity=Génération de l'identité... account.generation.profile-load=Sélectionner un fichier de profile Xeres (xeres_backup.xml), un fichier Keyring de Retroshare (retroshare_secret_keyring.gpg) ou un profile Retroshare (*.asc) diff --git a/ui/src/main/resources/view/account/account_creation.fxml b/ui/src/main/resources/view/account/account_creation.fxml index 4762f9de..eec77c10 100644 --- a/ui/src/main/resources/view/account/account_creation.fxml +++ b/ui/src/main/resources/view/account/account_creation.fxml @@ -19,11 +19,27 @@ ~ along with Xeres. If not, see . --> + - -