From 26bf75e05f0820113823bec6ca86f9df7e271249 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 7 Feb 2024 22:01:00 +0100 Subject: [PATCH 1/5] Display more details of the sync progress in the settings dialog. - Add margin to sync progress text. - Make use of the text in FolderStatusDelegate::FolderSyncText. Signed-off-by: Camila Ayres --- src/gui/folderstatusdelegate.cpp | 3 ++- src/gui/folderstatusmodel.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index b356a3dd32b83..1041dc56e6c84 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -331,7 +331,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & overallProgressRect.setWidth(progressBarRect.width()); painter->setFont(progressFont); - painter->drawText(QStyle::visualRect(option.direction, option.rect, overallProgressRect), Qt::AlignLeft | Qt::AlignVCenter, overallString); + painter->drawText(QStyle::visualRect(option.direction, option.rect, generalSyncStatusRect), Qt::AlignLeft | Qt::AlignVCenter, generalSyncStatus); + painter->restore(); } diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 41d363490fd12..dd7f478ebfb95 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -270,7 +270,8 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const return accountConnected; case Qt::ToolTipRole: { if (!progress.isNull()) { - return progress._progressString; + // e.g. 13 seconds left, 500 MB of 1 GB, file 3 of 6 + return progress._overallSyncString; } auto toolTip = accountConnected ? Theme::instance()->statusHeaderText(folder->syncResult().status()) @@ -307,12 +308,14 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const return Theme::instance()->folderOfflineIcon(); } case FolderStatusDelegate::SyncProgressItemString: + // e.g. Syncing fileName1, filename2 return progress._progressString; case FolderStatusDelegate::WarningCount: return progress._warningCount; case FolderStatusDelegate::SyncProgressOverallPercent: return progress._overallPercent; case FolderStatusDelegate::SyncProgressOverallString: + // 13 seconds left, 500 MB of 1 GB, file 3 of 6 return progress._overallSyncString; case FolderStatusDelegate::FolderSyncText: if (folder->virtualFilesEnabled()) { @@ -1136,7 +1139,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } } else if (totalFileCount > 0) { // Don't attempt to estimate the time left if there is no kb to transfer. - overallSyncString = tr("file %1 of %2").arg(currentFile).arg(totalFileCount); + overallSyncString = tr("%1 file %2 of %3").arg(kindString).arg(currentFile).arg(totalFileCount); } pi->_overallSyncString = overallSyncString; From 292bd3040bdcc67eae11c38a265a8e3206cf594d Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 7 Feb 2024 22:03:04 +0100 Subject: [PATCH 2/5] Modernize FolderStatusModel::slotSetProgress. - Add const auto. - Change variable names to be more clear. Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 80 +++++++++++++++++------------------ 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index dd7f478ebfb95..398343fcd9b58 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -983,63 +983,62 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) return; } - auto *pi = &_folders[folderIndex]._progress; + auto *const subFolderProgress = &_folders[folderIndex]._progress; if (progress.status() == ProgressInfo::Starting) { _isSyncRunningForAwhile = false; } - QVector roles; - roles << FolderStatusDelegate::SyncProgressItemString - << FolderStatusDelegate::WarningCount - << Qt::ToolTipRole; + const QVector roles{ FolderStatusDelegate::SyncProgressItemString, FolderStatusDelegate::WarningCount, + Qt::ToolTipRole }; if (progress.status() == ProgressInfo::Discovery) { if (!progress._currentDiscoveredRemoteFolder.isEmpty()) { - pi->_overallSyncString = tr("Checking for changes in remote \"%1\"").arg(progress._currentDiscoveredRemoteFolder); + subFolderProgress->_overallSyncString = tr("Checking for changes in remote \"%1\"").arg(progress._currentDiscoveredRemoteFolder); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } else if (!progress._currentDiscoveredLocalFolder.isEmpty()) { - pi->_overallSyncString = tr("Checking for changes in local \"%1\"").arg(progress._currentDiscoveredLocalFolder); + subFolderProgress->_overallSyncString = tr("Checking for changes in local \"%1\"").arg(progress._currentDiscoveredLocalFolder); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } } if (progress.status() == ProgressInfo::Reconcile) { - pi->_overallSyncString = tr("Reconciling changes"); + subFolderProgress->_overallSyncString = tr("Reconciling changes"); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } // Status is Starting, Propagation or Done - if (!progress._lastCompletedItem.isEmpty() && Progress::isWarningKind(progress._lastCompletedItem._status)) { - pi->_warningCount++; + subFolderProgress->_warningCount++; } // find the single item to display: This is going to be the bigger item, or the last completed // item if no items are in progress. auto curItem = progress._lastCompletedItem; - qint64 curItemProgress = -1; // -1 means finished - qint64 biggerItemSize = 0; - quint64 estimatedUpBw = 0; - quint64 estimatedDownBw = 0; + auto curItemProgress = -1; // -1 means finished + auto biggerItemSize = 0; + auto estimatedUpBw = 0; + auto estimatedDownBw = 0; QString allFilenames; - for (const auto &citm : progress._currentItems) { - if (curItemProgress == -1 || (ProgressInfo::isSizeDependent(citm._item) - && biggerItemSize < citm._item._size)) { - curItemProgress = citm._progress.completed(); - curItem = citm._item; - biggerItemSize = citm._item._size; + for (const auto &syncFile : progress._currentItems) { + if (curItemProgress == -1 || (ProgressInfo::isSizeDependent(syncFile._item) + && biggerItemSize < syncFile._item._size)) { + curItemProgress = syncFile._progress.completed(); + curItem = syncFile._item; + biggerItemSize = syncFile._item._size; } - if (citm._item._direction != SyncFileItem::Up) { - estimatedDownBw += progress.fileProgress(citm._item).estimatedBandwidth; + + if (syncFile._item._direction != SyncFileItem::Up) { + estimatedDownBw += progress.fileProgress(syncFile._item).estimatedBandwidth; } else { - estimatedUpBw += progress.fileProgress(citm._item).estimatedBandwidth; + estimatedUpBw += progress.fileProgress(syncFile._item).estimatedBandwidth; } - auto fileName = QFileInfo(citm._item._file).fileName(); + + auto fileName = QFileInfo(syncFile._item._file).fileName(); if (allFilenames.length() > 0) { //: Build a list of file names allFilenames.append(QStringLiteral(", \"%1\"").arg(fileName)); @@ -1057,8 +1056,6 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) QString fileProgressString; if (ProgressInfo::isSizeDependent(curItem)) { - const auto s1 = Utility::octetsToString(curItemProgress); - const auto s2 = Utility::octetsToString(curItem._size); //quint64 estimatedBw = progress.fileProgress(curItem).estimatedBandwidth; if (estimatedUpBw || estimatedDownBw) { /* @@ -1093,38 +1090,40 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } } else { //: Example text: "uploading foobar.png (2MB of 2MB)" - fileProgressString = tr("%1 %2 (%3 of %4)").arg(kindString, itemFileName, s1, s2); + fileProgressString = tr("%1 %2 (%3 of %4)").arg(kindString, itemFileName, + Utility::octetsToString(curItemProgress), + Utility::octetsToString(curItem._size)); } } else if (!kindString.isEmpty()) { //: Example text: "uploading foobar.png" fileProgressString = tr("%1 %2").arg(kindString, itemFileName); } - pi->_progressString = fileProgressString; + subFolderProgress->_progressString = fileProgressString; // overall progress const auto completedSize = progress.completedSize(); - const auto completedFile = progress.completedFiles(); const auto currentFile = progress.currentFile(); - const auto totalSize = qMax(completedSize, progress.totalSize()); const auto totalFileCount = qMax(currentFile, progress.totalFiles()); + const auto totalSize = qMax(completedSize, progress.totalSize()); + QString overallSyncString; if (totalSize > 0) { - const auto s1 = Utility::octetsToString(completedSize); - const auto s2 = Utility::octetsToString(totalSize); + const auto completedSizeString = Utility::octetsToString(completedSize); + const auto totalSizeString = Utility::octetsToString(totalSize); - const auto estimatedEta = progress.totalProgress().estimatedEta; + if (const auto estimatedEta = progress.totalProgress().estimatedEta; + progress.trustEta() && (estimatedEta > 0 || _isSyncRunningForAwhile)) { - if (progress.trustEta() && (estimatedEta > 0 || _isSyncRunningForAwhile)) { _isSyncRunningForAwhile = true; //: Example text: "5 minutes left, 12 MB of 345 MB, file 6 of 7" if (estimatedEta == 0) { overallSyncString = tr("A few seconds left, %1 of %2, file %3 of %4") - .arg(s1, s2) + .arg(completedSizeString, totalSizeString) .arg(currentFile) .arg(totalFileCount); } else { overallSyncString = tr("%5 left, %1 of %2, file %3 of %4") - .arg(s1, s2) + .arg(completedSizeString, totalSizeString) .arg(currentFile) .arg(totalFileCount) .arg(Utility::durationToDescriptiveString1(estimatedEta)); @@ -1133,7 +1132,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } else { //: Example text: "12 MB of 345 MB, file 6 of 7" overallSyncString = tr("%1 of %2, file %3 of %4") - .arg(s1, s2) + .arg(completedSizeString, totalSizeString) .arg(currentFile) .arg(totalFileCount); } @@ -1141,15 +1140,14 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) // Don't attempt to estimate the time left if there is no kb to transfer. overallSyncString = tr("%1 file %2 of %3").arg(kindString).arg(currentFile).arg(totalFileCount); } - - pi->_overallSyncString = overallSyncString; + subFolderProgress->_overallSyncString = overallSyncString; auto overallPercent = 0; - if (totalFileCount > 0) { + if (const auto completedFile = progress.completedFiles();totalFileCount > 0) { // Add one 'byte' for each file so the percentage is moving when deleting or renaming files overallPercent = qRound(double(completedSize + completedFile) / double(totalSize + totalFileCount) * 100.0); } - pi->_overallPercent = qBound(0, overallPercent, 100); + subFolderProgress->_overallPercent = qBound(0, overallPercent, 100); emit dataChanged(index(folderIndex), index(folderIndex), roles); } From 7a56c78ce54e9cd9d4b57886dc89e63c657c07e8 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Fri, 5 Jul 2024 11:48:50 +0200 Subject: [PATCH 3/5] Make sync status text easier to understand. - Never display "please wait" to users. - Only start displaying status starting at 1. e.g. "0 f 6 files" => "1 of 6 files" - Improve text for FolderStatusDelegate::FolderSyncText. - Reconciling => Syncing. - Syncing => Sync. Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 17 +++++++++-------- src/gui/tray/syncstatussummary.cpp | 4 ++-- src/gui/updater/ocupdater.cpp | 2 +- src/libsync/theme.cpp | 14 +++++++------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 398343fcd9b58..27bb07425a6f7 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -319,9 +319,9 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const return progress._overallSyncString; case FolderStatusDelegate::FolderSyncText: if (folder->virtualFilesEnabled()) { - return tr("Synchronizing VirtualFiles with local folder"); + return tr("Synchronizing virtual files in local folder"); } else { - return tr("Synchronizing with local folder"); + return tr("Synchronizing files in local folder"); } } return {}; @@ -899,7 +899,7 @@ void FolderStatusModel::slotUpdateFolderState(Folder *folder) if (!folder) { return; } - + for (auto i = 0; i < _folders.count(); ++i) { if (_folders.at(i)._folder == folder) { emit dataChanged(index(i), index(i)); @@ -1005,7 +1005,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } if (progress.status() == ProgressInfo::Reconcile) { - subFolderProgress->_overallSyncString = tr("Reconciling changes"); + subFolderProgress->_overallSyncString = tr("Syncing local and remote changes"); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } @@ -1107,7 +1107,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) const auto totalSize = qMax(completedSize, progress.totalSize()); QString overallSyncString; - if (totalSize > 0) { + if (totalSize > 0 && completedSize > 0) { const auto completedSizeString = Utility::octetsToString(completedSize); const auto totalSizeString = Utility::octetsToString(totalSize); @@ -1136,7 +1136,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) .arg(currentFile) .arg(totalFileCount); } - } else if (totalFileCount > 0) { + } else if (totalFileCount > 0 && currentFile > 0) { // Don't attempt to estimate the time left if there is no kb to transfer. overallSyncString = tr("%1 file %2 of %3").arg(kindString).arg(currentFile).arg(totalFileCount); } @@ -1187,10 +1187,11 @@ void FolderStatusModel::slotFolderSyncStateChange(Folder *folder) const auto folderMan = FolderMan::instance(); auto pos = folderMan->scheduleQueue().indexOf(folder); for (auto other : folderMan->map()) { - if (other != folder && other->isSyncRunning()) + if (other != folder && other->isSyncRunning()) { pos += 1; + } } - const auto message = pos <= 0 ? tr("Waiting …") : tr("Waiting for %n other folder(s) …", "", pos); + const auto message = pos <= 0 ? tr("About to start syncing") : tr("Waiting for %n other folder(s) …", "", pos); pi = SubFolderInfo::Progress(); pi._overallSyncString = message; } else if (state == SyncResult::SyncPrepare) { diff --git a/src/gui/tray/syncstatussummary.cpp b/src/gui/tray/syncstatussummary.cpp index 987e725e9aef2..cd31daac96677 100644 --- a/src/gui/tray/syncstatussummary.cpp +++ b/src/gui/tray/syncstatussummary.cpp @@ -156,9 +156,9 @@ void SyncStatusSummary::setSyncStateForFolder(const Folder *folder) case SyncResult::NotYetStarted: setSyncing(true); if (totalFiles() <= 0) { - setSyncStatusString(tr("Preparing sync")); + setSyncStatusString(tr("Checking folder changes")); } else { - setSyncStatusString(tr("Syncing")); + setSyncStatusString(tr("Syncing changes")); } setSyncStatusDetailString(""); setSyncIcon(Theme::instance()->syncStatusRunning()); diff --git a/src/gui/updater/ocupdater.cpp b/src/gui/updater/ocupdater.cpp index 833cc2a3a236a..e44cae12f6fda 100644 --- a/src/gui/updater/ocupdater.cpp +++ b/src/gui/updater/ocupdater.cpp @@ -149,7 +149,7 @@ QString OCUpdater::statusString(UpdateStatusStringFormat format) const switch (downloadState()) { case Downloading: - return tr("Downloading %1. Please wait …").arg(updateVersion); + return tr("Downloading %1 …").arg(updateVersion); case DownloadComplete: return tr("%1 available. Restart application to start the update.").arg(updateVersion); case DownloadFailed: { diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 46060c5b7f81b..5b935e9e3d12b 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -81,31 +81,31 @@ QString Theme::statusHeaderText(SyncResult::Status status) const switch (status) { case SyncResult::Undefined: - resultStr = QCoreApplication::translate("theme", "Status undefined"); + resultStr = QCoreApplication::translate("theme", "Sync status is unknown"); break; case SyncResult::NotYetStarted: - resultStr = QCoreApplication::translate("theme", "Waiting to start sync"); + resultStr = QCoreApplication::translate("theme", "Waiting to start syncing"); break; case SyncResult::SyncRunning: resultStr = QCoreApplication::translate("theme", "Sync is running"); break; case SyncResult::Success: - resultStr = QCoreApplication::translate("theme", "Sync Success"); + resultStr = QCoreApplication::translate("theme", "Sync was successful"); break; case SyncResult::Problem: - resultStr = QCoreApplication::translate("theme", "Sync Success, some files were ignored."); + resultStr = QCoreApplication::translate("theme", "Sync was successful but some files were ignored"); break; case SyncResult::Error: - resultStr = QCoreApplication::translate("theme", "Sync Error"); + resultStr = QCoreApplication::translate("theme", "Error occurred during sync"); break; case SyncResult::SetupError: - resultStr = QCoreApplication::translate("theme", "Setup Error"); + resultStr = QCoreApplication::translate("theme", "Error occurred during setup"); break; case SyncResult::SyncPrepare: resultStr = QCoreApplication::translate("theme", "Preparing to sync"); break; case SyncResult::SyncAbortRequested: - resultStr = QCoreApplication::translate("theme", "Aborting …"); + resultStr = QCoreApplication::translate("theme", "Stopping sync"); break; case SyncResult::Paused: resultStr = QCoreApplication::translate("theme", "Sync is paused"); From 890b4012587f48eb240316cdd3e8ba28432d2f5c Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 29 Jul 2024 17:51:55 +0200 Subject: [PATCH 4/5] Capitalize sync instruction strings returned by Progress::asActionString. Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 23 ++++++++--------------- src/libsync/progressdispatcher.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 27bb07425a6f7..80bf350d1f678 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -1056,23 +1056,16 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) QString fileProgressString; if (ProgressInfo::isSizeDependent(curItem)) { - //quint64 estimatedBw = progress.fileProgress(curItem).estimatedBandwidth; if (estimatedUpBw || estimatedDownBw) { - /* - //: Example text: "uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s" - fileProgressString = tr("%1 %2 (%3 of %4) %5 left at a rate of %6/s") - .arg(kindString, itemFileName, s1, s2, - Utility::durationToDescriptiveString(progress.fileProgress(curItem).estimatedEta), - Utility::octetsToString(estimatedBw) ); - */ + //: Example text: "Uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s" //: Example text: "Syncing 'foo.txt', 'bar.txt'" fileProgressString = tr("Syncing %1").arg(allFilenames); if (estimatedDownBw > 0) { fileProgressString.append(tr(", ")); // ifdefs: https://github.com/owncloud/client/issues/3095#issuecomment-128409294 #ifdef Q_OS_WIN - //: Example text: "download 24Kb/s" (%1 is replaced by 24Kb (translated)) - fileProgressString.append(tr("download %1/s").arg(Utility::octetsToString(estimatedDownBw))); + //: Example text: "Download 24Kb/s" (%1 is replaced by 24Kb (translated)) + fileProgressString.append(tr("Download %1/s").arg(Utility::octetsToString(estimatedDownBw))); #else fileProgressString.append(tr("\u2193 %1/s") .arg(Utility::octetsToString(estimatedDownBw))); @@ -1081,21 +1074,21 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) if (estimatedUpBw > 0) { fileProgressString.append(tr(", ")); #ifdef Q_OS_WIN - //: Example text: "upload 24Kb/s" (%1 is replaced by 24Kb (translated)) - fileProgressString.append(tr("upload %1/s").arg(Utility::octetsToString(estimatedUpBw))); + //: Example text: "Upload 24Kb/s" (%1 is replaced by 24Kb (translated)) + fileProgressString.append(tr("Upload %1/s").arg(Utility::octetsToString(estimatedUpBw))); #else fileProgressString.append(tr("\u2191 %1/s") .arg(Utility::octetsToString(estimatedUpBw))); #endif } } else { - //: Example text: "uploading foobar.png (2MB of 2MB)" + //: Example text: "Uploading foobar.png (2MB of 2MB)" fileProgressString = tr("%1 %2 (%3 of %4)").arg(kindString, itemFileName, Utility::octetsToString(curItemProgress), Utility::octetsToString(curItem._size)); } } else if (!kindString.isEmpty()) { - //: Example text: "uploading foobar.png" + //: Example text: "Uploading foobar.png" fileProgressString = tr("%1 %2").arg(kindString, itemFileName); } subFolderProgress->_progressString = fileProgressString; @@ -1138,7 +1131,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } } else if (totalFileCount > 0 && currentFile > 0) { // Don't attempt to estimate the time left if there is no kb to transfer. - overallSyncString = tr("%1 file %2 of %3").arg(kindString).arg(currentFile).arg(totalFileCount); + overallSyncString = tr("File %1 of %2").arg(currentFile).arg(totalFileCount); } subFolderProgress->_overallSyncString = overallSyncString; diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp index ec189b1c97032..b656d6adadbe0 100644 --- a/src/libsync/progressdispatcher.cpp +++ b/src/libsync/progressdispatcher.cpp @@ -74,23 +74,23 @@ QString Progress::asActionString(const SyncFileItem &item) case CSYNC_INSTRUCTION_NEW: case CSYNC_INSTRUCTION_TYPE_CHANGE: if (item._direction != SyncFileItem::Up) - return QCoreApplication::translate("progress", "downloading"); + return QCoreApplication::translate("progress", "Downloading"); else - return QCoreApplication::translate("progress", "uploading"); + return QCoreApplication::translate("progress", "Uploading"); case CSYNC_INSTRUCTION_REMOVE: - return QCoreApplication::translate("progress", "deleting"); + return QCoreApplication::translate("progress", "Deleting"); case CSYNC_INSTRUCTION_EVAL_RENAME: case CSYNC_INSTRUCTION_RENAME: - return QCoreApplication::translate("progress", "moving"); + return QCoreApplication::translate("progress", "Moving"); case CSYNC_INSTRUCTION_IGNORE: - return QCoreApplication::translate("progress", "ignoring"); + return QCoreApplication::translate("progress", "Ignoring"); case CSYNC_INSTRUCTION_STAT_ERROR: case CSYNC_INSTRUCTION_ERROR: - return QCoreApplication::translate("progress", "error"); + return QCoreApplication::translate("progress", "Error"); case CSYNC_INSTRUCTION_UPDATE_METADATA: - return QCoreApplication::translate("progress", "updating local metadata"); + return QCoreApplication::translate("progress", "Updating local metadata"); case CSYNC_INSTRUCTION_UPDATE_VFS_METADATA: - return QCoreApplication::translate("progress", "updating local virtual files metadata"); + return QCoreApplication::translate("progress", "Updating local virtual files metadata"); case CSYNC_INSTRUCTION_NONE: case CSYNC_INSTRUCTION_EVAL: break; From 81c070e499ec286016b9aa888550ae17ef6145ac Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 29 Jul 2024 19:30:09 +0200 Subject: [PATCH 5/5] List less file names in the sync progress bar text. Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 80bf350d1f678..e20169518fd44 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -1023,7 +1023,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) auto biggerItemSize = 0; auto estimatedUpBw = 0; auto estimatedDownBw = 0; - QString allFilenames; + QStringList filenamesList; for (const auto &syncFile : progress._currentItems) { if (curItemProgress == -1 || (ProgressInfo::isSizeDependent(syncFile._item) && biggerItemSize < syncFile._item._size)) { @@ -1038,13 +1038,9 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) estimatedUpBw += progress.fileProgress(syncFile._item).estimatedBandwidth; } - auto fileName = QFileInfo(syncFile._item._file).fileName(); - if (allFilenames.length() > 0) { - //: Build a list of file names - allFilenames.append(QStringLiteral(", \"%1\"").arg(fileName)); - } else { - //: Argument is a file name - allFilenames.append(QStringLiteral("\"%1\"").arg(fileName)); + const auto fileName = QFileInfo(syncFile._item._file).fileName(); + if (filenamesList.length() < 2) { + filenamesList.append(QStringLiteral("\"%1\"").arg(fileName)); } } if (curItemProgress == -1) { @@ -1053,13 +1049,13 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) const auto itemFileName = curItem._file; const auto kindString = Progress::asActionString(curItem); - + const auto allFilenames = filenamesList.join(", "); QString fileProgressString; if (ProgressInfo::isSizeDependent(curItem)) { if (estimatedUpBw || estimatedDownBw) { //: Example text: "Uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s" //: Example text: "Syncing 'foo.txt', 'bar.txt'" - fileProgressString = tr("Syncing %1").arg(allFilenames); + fileProgressString = tr("%1 %2 …").arg(kindString, allFilenames); if (estimatedDownBw > 0) { fileProgressString.append(tr(", ")); // ifdefs: https://github.com/owncloud/client/issues/3095#issuecomment-128409294