From 2b2fd7de8abf493426c3accfe2d36b324efc0a63 Mon Sep 17 00:00:00 2001 From: "Tom Dewey tom.dewey@raspberrypi.com" Date: Wed, 11 Oct 2023 13:22:32 +0100 Subject: [PATCH] qml: Remove customisation button, roll into flow This patch carries a translation risk, as we change the default progression button. Remove the customisation button all together, and make the customisation options something we offer as part of flashing an image that has that capability. While this adds an additional click to the flash sequence, it should provide a steer to people who are flashing customisable images to make use of this capability, potentially avoiding an additional pass through the Imager. --- src/UseSavedSettingsPopup.qml | 7 +++++-- src/main.qml | 30 ++++-------------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/UseSavedSettingsPopup.qml b/src/UseSavedSettingsPopup.qml index ce09c97..f002763 100644 --- a/src/UseSavedSettingsPopup.qml +++ b/src/UseSavedSettingsPopup.qml @@ -70,7 +70,7 @@ Popup { Layout.topMargin: 10 font.family: roboto.name font.bold: true - text: qsTr("Warning: advanced settings set") + text: qsTr("Use image customisation?") } Text { @@ -83,8 +83,9 @@ Popup { Layout.fillHeight: true Layout.leftMargin: 25 Layout.topMargin: 25 + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "") - text: qsTr("Would you like to apply the image customization settings saved earlier?") + text: qsTr("Would you like to apply image customization settings?") } RowLayout { @@ -111,6 +112,7 @@ Popup { } Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff" Material.background: "#c51a4a" + enabled: imageWriter.hasSavedCustomizationSettings() ? true : false } ImButton { @@ -121,6 +123,7 @@ Popup { } Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff" Material.background: "#c51a4a" + enabled: imageWriter.hasSavedCustomizationSettings() ? true : false } ImButton { diff --git a/src/main.qml b/src/main.qml index b2053ae..d1c96ba 100644 --- a/src/main.qml +++ b/src/main.qml @@ -31,7 +31,7 @@ ApplicationWindow { * tags. */ property string hwTags - + /** 0: Exclusive, must match explicit device names only, no untagged 1: Exclusive by prefix, must match the device name as a prefix, no untagged 2: Inclusive, match explicit device names and untagged @@ -283,26 +283,9 @@ ApplicationWindow { visible: false } - ImButton { - Layout.bottomMargin: 25 - Layout.minimumHeight: 40 - Layout.preferredWidth: 200 - Layout.alignment: Qt.AlignRight - padding: 5 - id: customizebutton - onClicked: { - optionspopup.openPopup() - } - visible: imageWriter.imageSupportsCustomization() - Accessible.description: qsTr("Select this button to access advanced settings") - contentItem: Image { - source: "icons/ic_cog_red.svg" - fillMode: Image.PreserveAspectFit - } - } ImButton { id: writebutton - text: qsTr("WRITE") + text: qsTr("Next") Layout.bottomMargin: 25 Layout.minimumHeight: 40 Layout.preferredWidth: 200 @@ -315,7 +298,7 @@ ApplicationWindow { return } - if (!optionspopup.initialized && imageWriter.imageSupportsCustomization() && imageWriter.hasSavedCustomizationSettings()) { + if (!optionspopup.visible && imageWriter.imageSupportsCustomization()) { usesavedsettingspopup.openPopup() } else { confirmwritepopup.askForConfirmation() @@ -1136,7 +1119,6 @@ ApplicationWindow { langbarRect.visible = false writebutton.visible = false writebutton.enabled = false - customizebutton.visible = false cancelwritebutton.enabled = true cancelwritebutton.visible = true cancelverifybutton.enabled = true @@ -1266,7 +1248,6 @@ ApplicationWindow { function resetWriteButton() { progressText.visible = false progressBar.visible = false - customizebutton.visible = imageWriter.imageSupportsCustomization() osbutton.enabled = true dstbutton.enabled = true hwbutton.enabled = true @@ -1313,7 +1294,6 @@ ApplicationWindow { if (imageWriter.readyToWrite()) { writebutton.enabled = true } - customizebutton.visible = imageWriter.imageSupportsCustomization() } function onCancelled() { @@ -1597,9 +1577,8 @@ ApplicationWindow { function selectHWitem(hwmodel) { hwTags = hwmodel.tags - + if (hwmodel.matching_type) { - switch (hwmodel.matching_type) { case "exclusive": hwTagMatchingType = 0 @@ -1709,7 +1688,6 @@ ApplicationWindow { if (imageWriter.readyToWrite()) { writebutton.enabled = true } - customizebutton.visible = imageWriter.imageSupportsCustomization() } }