[pve-devel] [PATCH pve-flutter-frontend] node overview: power menu: reorder/reword confirm buttons

Dominik Csapak d.csapak at proxmox.com
Wed Apr 17 10:53:02 CEST 2024


move the confirm action to the right as mentioned in the material spec[0]
also rewords the buttons to 'cancel' and 'shutdown/reboot'
for that to work properly slightly rename the confirm message

0: https://m3.material.io/components/dialogs/guidelines#befd7f4d-1029-4957-b1b5-da13fc0bbf3c

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
replaces v3 of my previous patch since v2 was applied:
https://lists.proxmox.com/pipermail/pve-devel/2024-April/063106.html

 lib/widgets/pve_node_power_settings_widget.dart | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/widgets/pve_node_power_settings_widget.dart b/lib/widgets/pve_node_power_settings_widget.dart
index 2e4b9a8..2a0a6b1 100644
--- a/lib/widgets/pve_node_power_settings_widget.dart
+++ b/lib/widgets/pve_node_power_settings_widget.dart
@@ -31,7 +31,7 @@ class PveNodePowerSettings extends StatelessWidget {
                       ),
                       subtitle: const Text("Reboot Node"),
                       onTap: () => confirmedAction(context,
-                          PveClusterResourceAction.reboot, bloc, "reboot"),
+                          PveClusterResourceAction.reboot, bloc, "Reboot"),
                     ),
                     ListTile(
                       leading: const Icon(Icons.power_settings_new),
@@ -41,7 +41,7 @@ class PveNodePowerSettings extends StatelessWidget {
                       ),
                       subtitle: const Text("Shutdown Node"),
                       onTap: () => confirmedAction(context,
-                          PveClusterResourceAction.shutdown, bloc, "shutdown"),
+                          PveClusterResourceAction.shutdown, bloc, "Shutdown"),
                     ),
                   ],
                 ),
@@ -66,14 +66,14 @@ class PveNodePowerSettings extends StatelessWidget {
               ],
             ),
             content: Text(
-                "Are you sure you want to $actionText node '${bloc.nodeID}'?"),
+                "Are you sure you want to do action '$actionText' on node '${bloc.nodeID}'?"),
             actions: [
-              TextButton(
-                  onPressed: () => Navigator.of(context).pop(true),
-                  child: const Text("Yes")),
               TextButton(
                   onPressed: () => Navigator.of(context).pop(false),
-                  child: const Text("No"))
+                  child: const Text("Cancel")),
+              TextButton(
+                  onPressed: () => Navigator.of(context).pop(true),
+                  child: Text(actionText))
             ],
           );
         });
-- 
2.39.2





More information about the pve-devel mailing list