Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmc/2352-Windows_related_changes - Stable-3.11 #83

Open
wants to merge 1 commit into
base: stable-3.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions src/gui/navigationpanehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
QString namespacePath = QString() % R"(Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\)" % clsidStr;

QString title = folder->shortGuiRemotePathOrAppName();
title = title % " - " % folder->accountState()->account()->prettyName(); //Magenta Customization
// Write the account name in the sidebar only when using more than one account.
if (AccountManager::instance()->accounts().size() > 1)
title = title % " - " % folder->accountState()->account()->displayName();
//if (AccountManager::instance()->accounts().size() > 1)
// title = title % " - " % folder->accountState()->account()->displayName();
QString iconPath = QDir::toNativeSeparators(qApp->applicationFilePath());
QString targetFolderPath = QDir::toNativeSeparators(folder->cleanPath());

Expand Down
91 changes: 52 additions & 39 deletions src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,21 @@ void SocketApi::processEncryptRequest(const QString &localFile)
"Server replied with error: %2").arg(fileData.folderRelativePath, job->errorString()));
Q_UNUSED(ret)
} else {
const int ret = QMessageBox::information(nullptr,
tr("Folder encrypted successfully").arg(fileData.folderRelativePath),
tr("The following folder was encrypted successfully: \"%1\"").arg(fileData.folderRelativePath));
Q_UNUSED(ret)
// const int ret = QMessageBox::information(nullptr,
// tr("Folder encrypted successfully").arg(fileData.folderRelativePath),
// tr("The following folder was encrypted successfully: \"%1\"").arg(fileData.folderRelativePath));
// Q_UNUSED(ret)

//Magenta customization
const auto messageBox = new QMessageBox;
messageBox->setAttribute(Qt::WA_DeleteOnClose);
messageBox->setWindowTitle(tr("Folder encrypted successfully").arg(fileData.folderRelativePath));
messageBox->setText(tr("The following folder was encrypted successfully: \"%1\"").arg(fileData.folderRelativePath));
const QIcon avatarIcon = QIcon::fromTheme("iconPath", QIcon(":/client/theme/lock.svg"));
QPixmap pixmap = avatarIcon.pixmap(QSize(24, 24));
messageBox->setIconPixmap(pixmap);
messageBox->addButton(QMessageBox::NoButton);
messageBox->show();
}
});
job->setProperty(encryptJobPropertyFolder, QVariant::fromValue(folder));
Expand Down Expand Up @@ -1168,38 +1179,39 @@ void SocketApi::sendSharingContextMenuOptions(const FileData &fileData, SocketLi

// If sharing is globally disabled, do not show any sharing entries.
// If there is no permission to share for this file, add a disabled entry saying so
if (isOnTheServer && !record._remotePerm.isNull() && !record._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + (!record.isDirectory() ? tr("Resharing this file is not allowed") : tr("Resharing this folder is not allowed")));
} else {
listener->sendMessage(QLatin1String("MENU_ITEM:SHARE") + flagString + tr("Share options"));

// Do we have public links?
bool publicLinksEnabled = theme->linkSharing() && capabilities.sharePublicLink();

// Is is possible to create a public link without user choices?
bool canCreateDefaultPublicLink = publicLinksEnabled
&& !capabilities.sharePublicLinkEnforceExpireDate()
&& !capabilities.sharePublicLinkAskOptionalPassword()
&& !capabilities.sharePublicLinkEnforcePassword();

if (canCreateDefaultPublicLink) {
if (isSecureFileDropSupported) {
listener->sendMessage(QLatin1String("MENU_ITEM:COPY_SECUREFILEDROP_LINK") + QLatin1String("::") + tr("Copy secure file drop link"));
} else {
listener->sendMessage(QLatin1String("MENU_ITEM:COPY_PUBLIC_LINK") + flagString + tr("Copy public link"));
}
} else if (publicLinksEnabled) {
if (isSecureFileDropSupported) {
listener->sendMessage(QLatin1String("MENU_ITEM:MANAGE_PUBLIC_LINKS") + QLatin1String("::") + tr("Copy secure filedrop link"));
} else {
listener->sendMessage(QLatin1String("MENU_ITEM:MANAGE_PUBLIC_LINKS") + flagString + tr("Copy public link"));
}
}
}

if (itemEncryptionFlag == SharingContextItemEncryptedFlag::NotEncryptedItem) {
listener->sendMessage(QLatin1String("MENU_ITEM:COPY_PRIVATE_LINK") + flagString + tr("Copy internal link"));
}
//Magenta customization
// if (isOnTheServer && !record._remotePerm.isNull() && !record._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
// listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + (!record.isDirectory() ? tr("Resharing this file is not allowed") : tr("Resharing this folder is not allowed")));
// } else {
// listener->sendMessage(QLatin1String("MENU_ITEM:SHARE") + flagString + tr("Share options"));

// // Do we have public links?
// bool publicLinksEnabled = theme->linkSharing() && capabilities.sharePublicLink();

// // Is is possible to create a public link without user choices?
// bool canCreateDefaultPublicLink = publicLinksEnabled
// && !capabilities.sharePublicLinkEnforceExpireDate()
// && !capabilities.sharePublicLinkAskOptionalPassword()
// && !capabilities.sharePublicLinkEnforcePassword();

// if (canCreateDefaultPublicLink) {
// if (isSecureFileDropSupported) {
// listener->sendMessage(QLatin1String("MENU_ITEM:COPY_SECUREFILEDROP_LINK") + QLatin1String("::") + tr("Copy secure file drop link"));
// } else {
// listener->sendMessage(QLatin1String("MENU_ITEM:COPY_PUBLIC_LINK") + flagString + tr("Copy public link"));
// }
// } else if (publicLinksEnabled) {
// if (isSecureFileDropSupported) {
// listener->sendMessage(QLatin1String("MENU_ITEM:MANAGE_PUBLIC_LINKS") + QLatin1String("::") + tr("Copy secure filedrop link"));
// } else {
// listener->sendMessage(QLatin1String("MENU_ITEM:MANAGE_PUBLIC_LINKS") + flagString + tr("Copy public link"));
// }
// }
// }

// if (itemEncryptionFlag == SharingContextItemEncryptedFlag::NotEncryptedItem) {
// listener->sendMessage(QLatin1String("MENU_ITEM:COPY_PRIVATE_LINK") + flagString + tr("Copy internal link"));
// }

// Disabled: only providing email option for private links would look odd,
// and the copy option is more general.
Expand Down Expand Up @@ -1363,9 +1375,10 @@ void SocketApi::command_GET_MENU_ITEMS(const QString &argument, OCC::SocketListe
const QFileInfo fileInfo(fileData.localPath);
sendLockFileInfoMenuEntries(fileInfo, syncFolder, fileData, listener, record);

if (!fileInfo.isDir()) {
listener->sendMessage(QLatin1String("MENU_ITEM:ACTIVITY") + flagString + tr("Activity"));
}
//Magenta customization
// if (!fileInfo.isDir()) {
// listener->sendMessage(QLatin1String("MENU_ITEM:ACTIVITY") + flagString + tr("Activity"));
// }

DirectEditor* editor = getDirectEditorForLocalFile(fileData.localPath);
if (editor) {
Expand Down