From 7513d1da491884d69465c2398c4d66d5216e14f3 Mon Sep 17 00:00:00 2001 From: Fim-84 Date: Mon, 4 Sep 2023 16:05:25 +0200 Subject: [PATCH 01/10] Started work on voting tab in janus --- .../controller/MainWindowController.java | 9 +++- .../janus/controller/VoteController.java | 42 +++++++++++++++++++ .../org/unigrid/janus/view/mainWindow.fxml | 38 ++++++++++++++++- .../org/unigrid/janus/view/vote.fxml | 42 +++++++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 fx/src/main/java/org/unigrid/janus/controller/VoteController.java create mode 100644 fx/src/main/resources/org/unigrid/janus/view/vote.fxml diff --git a/fx/src/main/java/org/unigrid/janus/controller/MainWindowController.java b/fx/src/main/java/org/unigrid/janus/controller/MainWindowController.java index 66d8de26..b2c0be99 100644 --- a/fx/src/main/java/org/unigrid/janus/controller/MainWindowController.java +++ b/fx/src/main/java/org/unigrid/janus/controller/MainWindowController.java @@ -65,12 +65,14 @@ public class MainWindowController implements Initializable, PropertyChangeListen @FXML private ToggleButton btnAddress; @FXML private ToggleButton btnDocs; @FXML private ToggleButton btnSettings; + @FXML private ToggleButton btnVote; @FXML private VBox pnlWallet; @FXML private VBox pnlTransactions; @FXML private VBox pnlNodes; @FXML private VBox pnlAddress; @FXML private VBox pnlSettings; @FXML private VBox pnlDocs; + @FXML private VBox pnlVote; @FXML private AnchorPane pnlOverlay; @FXML private AnchorPane pnlWarning; @FXML private FontIcon lockBtn; @@ -142,7 +144,12 @@ private void onSettingsTap(MouseEvent event) { } select(pnlSettings, btnSettings); } - + + @FXML + private void onVoteClicked(MouseEvent event) { + select(pnlVote, btnVote); + } + @Override public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(wallet.BLOCKS_PROPERTY)) { diff --git a/fx/src/main/java/org/unigrid/janus/controller/VoteController.java b/fx/src/main/java/org/unigrid/janus/controller/VoteController.java new file mode 100644 index 00000000..75a9385d --- /dev/null +++ b/fx/src/main/java/org/unigrid/janus/controller/VoteController.java @@ -0,0 +1,42 @@ +/* + The Janus Wallet + Copyright © 2021-2022 The Unigrid Foundation, UGD Software AB + + This program is free software: you can redistribute it and/or modify it under the terms of the + addended GNU Affero General Public License as published by the Free Software Foundation, version 3 + of the License (see COPYING and COPYING.addendum). + + This program 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 Affero General Public License for more details. + + You should have received an addended copy of the GNU Affero General Public License with this program. + If not, see and . + */ + +package org.unigrid.janus.controller; + +import jakarta.enterprise.context.ApplicationScoped; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; + +@ApplicationScoped +public class VoteController { + + @FXML Label lblTitle; + @FXML Label lblSummary; + @FXML Button btnYes; + @FXML Button btnNo; + + @FXML + public void OnVoteNo(ActionEvent e) { + + } + + @FXML + public void OnVoteYes(ActionEvent e) { + + } +} diff --git a/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml b/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml index 65cb08bd..c9ba366d 100644 --- a/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml +++ b/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml @@ -23,7 +23,7 @@ - + @@ -182,6 +182,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -339,6 +370,11 @@ + + + + + diff --git a/fx/src/main/resources/org/unigrid/janus/view/vote.fxml b/fx/src/main/resources/org/unigrid/janus/view/vote.fxml new file mode 100644 index 00000000..a76dd4be --- /dev/null +++ b/fx/src/main/resources/org/unigrid/janus/view/vote.fxml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fx/src/test/java/org/unigrid/janus/controller/SettingsControllerTest.java b/fx/src/test/java/org/unigrid/janus/controller/SettingsControllerTest.java index 4473e978..f7c49b2a 100644 --- a/fx/src/test/java/org/unigrid/janus/controller/SettingsControllerTest.java +++ b/fx/src/test/java/org/unigrid/janus/controller/SettingsControllerTest.java @@ -149,6 +149,9 @@ public void shouldSwitchTabs() { robot.clickOn("#btnSetDebug"); verifyThat("#pnlSetDebug", isVisible()); + robot.clickOn("#btnSetMaintenance"); + verifyThat("#pnlSetMaintenance", isVisible()); + robot.clickOn("#btnSetExport"); verifyThat("#btnSetExport", isVisible()); From 0fb04b1801274b5e621c054612c55ae625116b23 Mon Sep 17 00:00:00 2001 From: dekm Date: Fri, 15 Sep 2023 23:23:59 +0200 Subject: [PATCH 10/10] updating fxml to use default instead of java 18 or 19 --- .../src/main/resources/org/unigrid/bootstrap/debugView.fxml | 2 +- fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml | 2 +- fx/src/main/resources/org/unigrid/janus/view/password.fxml | 2 +- fx/src/main/resources/org/unigrid/janus/view/settings.fxml | 2 +- fx/src/main/resources/org/unigrid/janus/view/splashScreen.fxml | 2 +- fx/src/main/resources/org/unigrid/janus/view/vote.fxml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bootstrap/src/main/resources/org/unigrid/bootstrap/debugView.fxml b/bootstrap/src/main/resources/org/unigrid/bootstrap/debugView.fxml index 4f825014..fd42e5cd 100644 --- a/bootstrap/src/main/resources/org/unigrid/bootstrap/debugView.fxml +++ b/bootstrap/src/main/resources/org/unigrid/bootstrap/debugView.fxml @@ -14,7 +14,7 @@ - + diff --git a/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml b/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml index 4ee1f0bd..168bf243 100644 --- a/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml +++ b/fx/src/main/resources/org/unigrid/janus/view/mainWindow.fxml @@ -24,7 +24,7 @@ - + diff --git a/fx/src/main/resources/org/unigrid/janus/view/password.fxml b/fx/src/main/resources/org/unigrid/janus/view/password.fxml index f13176d9..61972df6 100644 --- a/fx/src/main/resources/org/unigrid/janus/view/password.fxml +++ b/fx/src/main/resources/org/unigrid/janus/view/password.fxml @@ -5,7 +5,7 @@ - +