Skip to content

Commit b71988d

Browse files
committed
feat(Wizard): Enhance "Write Another" functionality and update accessible descriptions
- Updated the accessible description for the "Write Another" button to clarify its purpose. - Implemented a new `resetToWriteStep` function to streamline the process of selecting a new storage device while preserving existing settings. - Introduced a `writeAnotherMode` property to facilitate direct navigation to the writing step after storage selection, improving user experience.
1 parent 00f094a commit b71988d

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

src/wizard/DoneStep.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ WizardStepBase {
146146
ImButton {
147147
id: writeAnotherButton
148148
text: qsTr("Write Another")
149-
accessibleDescription: qsTr("Return to the beginning to write another image to a different storage device")
149+
accessibleDescription: qsTr("Return to storage selection to write the same image to another storage device")
150150
enabled: true
151151
activeFocusOnTab: true
152152
Layout.minimumWidth: Style.buttonWidthMinimum
153153
Layout.preferredHeight: Style.buttonHeightStandard
154154
onClicked: {
155-
// Reset the wizard state to start over
156-
// Use existing app options settings
157-
wizardContainer.resetWizard()
155+
// Return to storage selection to write the same image to another SD card
156+
// This preserves device, OS, and customization settings
157+
wizardContainer.resetToWriteStep()
158158
}
159159
}
160160

src/wizard/WizardContainer.qml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Item {
3333
// Track writing state
3434
property bool isWriting: false
3535

36+
// Track if we're in "write another" flow (skip to writing step after storage selection)
37+
property bool writeAnotherMode: false
38+
3639
// Track selections for display in summary
3740
property string selectedDeviceName: ""
3841
property string selectedOsName: ""
@@ -668,8 +671,14 @@ Item {
668671
function nextStep() {
669672
if (root.currentStep < root.totalSteps - 1) {
670673
var nextIndex = root.currentStep + 1
674+
675+
// Special handling for "write another" mode: skip directly to writing step after storage selection
676+
if (writeAnotherMode && root.currentStep === stepStorageSelection) {
677+
nextIndex = stepWriting
678+
writeAnotherMode = false // Reset the flag
679+
}
671680
// If customization is not supported, skip customization steps entirely
672-
if (!customizationSupported && nextIndex === firstCustomizationStep) {
681+
else if (!customizationSupported && nextIndex === firstCustomizationStep) {
673682
nextIndex = stepWriting
674683
}
675684
// Skip optional Raspberry Pi Connect step when OS does not support it
@@ -969,6 +978,7 @@ Item {
969978
currentStep = 0
970979
permissibleStepsBitmap = 1 // Reset to only Device step permissible
971980
isWriting = false
981+
writeAnotherMode = false
972982
selectedDeviceName = ""
973983
selectedOsName = ""
974984
selectedStorageName = ""
@@ -996,6 +1006,23 @@ Item {
9961006
wizardStack.clear()
9971007
wizardStack.push(deviceSelectionStep)
9981008
}
1009+
1010+
function resetToWriteStep() {
1011+
// Reset only the storage selection to allow choosing a new storage device
1012+
// while preserving device, OS, and customization settings
1013+
selectedStorageName = ""
1014+
1015+
// Keep all steps permissible - they've already been completed
1016+
// This allows backward navigation if needed
1017+
1018+
// Enable write another mode to skip directly to writing step after storage selection
1019+
writeAnotherMode = true
1020+
1021+
// Navigate to storage selection step so user can select a new SD card
1022+
currentStep = stepStorageSelection
1023+
wizardStack.clear()
1024+
wizardStack.push(storageSelectionStep)
1025+
}
9991026

10001027
// Detect device selection changes and invalidate dependent steps
10011028
onSelectedDeviceNameChanged: {

0 commit comments

Comments
 (0)