Add activity for existing folder going over set limit

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-07-05 23:35:13 +08:00
Родитель c975d40fb8
Коммит 7d1fa16a3f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: C839200C384636B0
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -1259,6 +1259,29 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath)
"Please go into the settings and disable it if you wish to stop synchronising it.")
.arg(QString::number(ConfigFile().newBigFolderSizeLimit().second), folderPath);
Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message);
auto blacklistActivityLink = ActivityLink();
blacklistActivityLink._label = tr("Stop syncing");
blacklistActivityLink._primary = true;
blacklistActivityLink._verb = "BLACKLIST_FOLDER";
auto whitelistActivityLink = ActivityLink();
whitelistActivityLink._label = tr("Keep syncing");
whitelistActivityLink._primary = false;
whitelistActivityLink._verb = "WHITELIST_FOLDER";
auto existingFolderNowBigActivity = Activity();
existingFolderNowBigActivity._type = Activity::NotificationType;
existingFolderNowBigActivity._dateTime = QDateTime::fromString(QDateTime::currentDateTime().toString(), Qt::ISODate);
existingFolderNowBigActivity._subject =
tr("The folder %1 has surpassed the set folder size limit of %2MB.").arg(folderPath, QString::number(ConfigFile().newBigFolderSizeLimit().second));
existingFolderNowBigActivity._message = tr("Would you like to stop syncing this folder?");
existingFolderNowBigActivity._accName = _accountState->account()->displayName();
existingFolderNowBigActivity._folder = alias();
existingFolderNowBigActivity._links = {blacklistActivityLink, whitelistActivityLink};
const auto user = UserModel::instance()->findUserForAccount(_accountState.data());
user->slotAddNotification(this, existingFolderNowBigActivity);
}
}