Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/qml/CancelDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ApplicationWindow {
Heading {
level: 2
text: {
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying)
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying || releases.variant.status === Units.DownloadStatus.Paused)
qsTr("Cancel Download?")
else if (releases.variant.status == Units.DownloadStatus.Writing)
qsTr("Cancel Writing?")
Expand All @@ -62,7 +62,7 @@ ApplicationWindow {

Label {
text: {
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying)
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying || releases.variant.status === Units.DownloadStatus.Paused)
qsTr("Download and media writing will be aborted. This process can be resumed any time later.")
else if (releases.variant.status == Units.DownloadStatus.Writing)
qsTr("Writing process will be aborted and your drive will have to be restored afterwards.")
Expand Down
60 changes: 50 additions & 10 deletions src/app/qml/DownloadPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Page {
qsTr("Preparing %1").arg(file)
else if (currentStatus === Units.DownloadStatus.Ready)
qsTr("Ready to write %1").arg(file)
else if (currentStatus === Units.DownloadStatus.Paused)
qsTr("%1 has been paused").arg(file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, following UX advice from Gemini, the main text should remain unchanged, but we should change the text below:

________________________________________________________________________
|                      [Illustration stops/dims]                       |
|                                                                      |
|                  Downloading Fedora Workstation 43                   |
|                           Paused (2.3 GB left)                       |
|                                                                      |
|           [▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░]                 |
|                                                                      |
|  [ Cancel ]                                           [ RESUME ]     |
|______________________________________________________________________|

else if (currentStatus == Units.DownloadStatus.Failed_Download)
qsTr("Failed to download %1").arg(file)
else
Expand Down Expand Up @@ -78,12 +80,12 @@ Page {
}

QQC2.Label {
visible: currentStatus == Units.DownloadStatus.Downloading
visible: currentStatus == Units.DownloadStatus.Downloading || currentStatus == Units.DownloadStatus.Paused
text: downloadPage.leftStr
}

QQC2.Label {
visible: currentStatus == Units.DownloadStatus.Downloading
visible: currentStatus == Units.DownloadStatus.Downloading || currentStatus == Units.DownloadStatus.Paused
text: downloadPage.rightStr
}
}
Expand Down Expand Up @@ -135,6 +137,14 @@ Page {
wrapMode: QQC2.Label.Wrap
}

QQC2.Label {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't also add this info text.

id: messageContinueDownload
visible: currentStatus === Units.DownloadStatus.Paused
text: qsTr("Download has been paused.")
wrapMode: QQC2.Label.Wrap
width: infoColumn.width
}

QQC2.Label {
id: messageSelectedImage
visible: releases.selected.isLocal
Expand Down Expand Up @@ -228,16 +238,29 @@ Page {
releases.variant
}
}
},
State {
name: "paused"
when: currentStatus === Units.DownloadStatus.Paused
PropertyChanges {
target: progressBar;
value: releases.variant.progress.ratio
}
PropertyChanges {
target: messageContinueDownload;
visible: true
}
}
]

// There will be only [Finish] button on the right side so [Cancel] button
// is not necessary
previousButtonVisible: currentStatus != Units.DownloadStatus.Finished
previousButtonText: qsTr("Cancel")
previousButtonText: {
return qsTr("Cancel")
}
Comment on lines +243 to +245
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previousButtonText is wrapped in a function that simply returns a constant string. This can be simplified to just assign the string directly without a function wrapper.

Suggested change
previousButtonText: {
return qsTr("Cancel")
}
previousButtonText: qsTr("Cancel")

Copilot uses AI. Check for mistakes.
onPreviousButtonClicked: {
if (releases.variant.status === Units.DownloadStatus.Write_Verifying ||
releases.variant.status === Units.DownloadStatus.Writing ||
releases.variant.status === Units.DownloadStatus.Paused ||
releases.variant.status === Units.DownloadStatus.Downloading ||
releases.variant.status === Units.DownloadStatus.Download_Verifying) {
cancelDialog.show()
Expand All @@ -249,7 +272,11 @@ Page {
}

nextButtonVisible: {
if (currentStatus == Units.DownloadStatus.Finished)
// This will be [Finish] or [Resume] button to finish download or resume download
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you mean [Resume] and [Pause]? Also, in case of the verification, I don't think there is a sensible action besides [Cancel] to do here.

if (currentStatus == Units.DownloadStatus.Finished ||
currentStatus == Units.DownloadStatus.Paused ||
currentStatus == Units.DownloadStatus.Downloading ||
currentStatus == Units.DownloadStatus.Download_Verifying)
return true
// This will be [Retry] button to start the process again if there is a drive plugged in
else if (currentStatus == Units.DownloadStatus.Ready ||
Expand All @@ -260,14 +287,16 @@ Page {
return false
}
nextButtonText: {

if (releases.variant.status === Units.DownloadStatus.Write_Verifying ||
releases.variant.status === Units.DownloadStatus.Writing ||
releases.variant.status === Units.DownloadStatus.Downloading ||
releases.variant.status === Units.DownloadStatus.Download_Verifying)
releases.variant.status === Units.DownloadStatus.Writing)
return qsTr("Cancel")
else if (releases.variant.status == Units.DownloadStatus.Ready)
return qsTr("Write")
else if (releases.variant.status === Units.DownloadStatus.Paused)
return qsTr("Resume")
else if (releases.variant.status === Units.DownloadStatus.Downloading ||
releases.variant.status === Units.DownloadStatus.Download_Verifying)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't think we should allow to stop the verification process, not sure there is a point doing so.

return qsTr("Pause")
else if (releases.variant.status === Units.DownloadStatus.Finished)
return qsTr("Finish")
else
Expand All @@ -288,6 +317,17 @@ Page {
releases.variant.download()
drives.selected.setImage(releases.variant)
drives.selected.write(releases.variant)
} else if (releases.variant.status === Units.DownloadStatus.Paused) {
if (selectedOption != Units.MainSelect.Write)
releases.variant.download()
if (drives.length) {
drives.selected.setImage(releases.variant)
drives.selected.write(releases.variant)
}
Comment on lines +305 to +310
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When resuming from a paused state, the code attempts to write to a drive even if the download hasn't completed yet. The resume logic should first complete the download before attempting to write. The current implementation will call both download() and write() simultaneously, which could cause unexpected behavior. Consider only calling download() when resuming from PAUSED status, and let the normal flow handle writing once the download is complete and the status becomes READY.

Suggested change
if (selectedOption != Units.MainSelect.Write)
releases.variant.download()
if (drives.length) {
drives.selected.setImage(releases.variant)
drives.selected.write(releases.variant)
}
if (selectedOption != Units.MainSelect.Write)
releases.variant.download()
// When resuming from Paused, only resume download.
// Writing will be handled by the normal flow once status is Ready.

Copilot uses AI. Check for mistakes.
} else if (releases.variant.status === Units.DownloadStatus.Downloading ||
releases.variant.status === Units.DownloadStatus.Download_Verifying) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

downloadManager.cancel()
releases.variant.setStatus(Units.DownloadStatus.Paused)
}
}
}
1 change: 1 addition & 0 deletions src/app/qml/Units.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ QtObject {
Downloading,
Download_Verifying,
Ready,
Paused,
Writing_Not_Possible,
Writing,
Write_Verifying,
Expand Down
5 changes: 3 additions & 2 deletions src/app/releasemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,13 @@ class ReleaseVariant : public QObject, public DownloadReceiver
public:
enum Type { LIVE = 0, NETINSTALL, FULL, ATOMIC };
Q_ENUMS(Type)
enum Status { PREPARING = 0, DOWNLOADING, DOWNLOAD_VERIFYING, READY, WRITING_NOT_POSSIBLE, WRITING, WRITE_VERIFYING, FINISHED, FAILED_VERIFICATION, FAILED_DOWNLOAD, FAILED };
enum Status { PREPARING = 0, DOWNLOADING, DOWNLOAD_VERIFYING, READY, PAUSED, WRITING_NOT_POSSIBLE, WRITING, WRITE_VERIFYING, FINISHED, FAILED_VERIFICATION, FAILED_DOWNLOAD, FAILED };
Q_ENUMS(Status)
const QStringList m_statusStrings{tr("Preparing"),
tr("Downloading"),
tr("Checking the download"),
tr("Ready to write"),
tr("Download has been paused"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With what I said above, that it still can keep saying "Downloading ..." we might not need this status information.

tr("Image file was saved to your downloads folder. Writing is not possible"),
tr("Writing"),
tr("Checking the written data"),
Expand Down Expand Up @@ -414,7 +415,6 @@ class ReleaseVariant : public QObject, public DownloadReceiver

Status status() const;
QString statusString() const;
void setStatus(Status s);
QString errorString() const;
void setErrorString(const QString &o);

Expand All @@ -439,6 +439,7 @@ class ReleaseVariant : public QObject, public DownloadReceiver
public slots:
void download();
void resetStatus();
void setStatus(Status s);

private:
QString m_temporaryIso{};
Expand Down