Skip to content

Commit

Permalink
Merge #102 nmc/2352-Windows_related_changes - Master
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenMCloud committed Mar 8, 2024
2 parents 2484f2a + eb41d63 commit 5d84c90
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 44 deletions.
3 changes: 3 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")
#NMC change, its needed to find the ui file in a different location than the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

#NMC change, its needed to find the ui file in a different location than the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

if(QUICK_COMPILER)
find_package(Qt5QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES
Expand Down
6 changes: 3 additions & 3 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
ac = availabilityMenu->addAction(Utility::vfsFreeSpaceActionText());
connect(ac, &QAction::triggered, this, [this]() { slotSetCurrentFolderAvailability(PinState::OnlineOnly); });

ac = menu->addAction(tr("Disable virtual file support …"));
connect(ac, &QAction::triggered, this, &AccountSettings::slotDisableVfsCurrentFolder);
ac->setDisabled(Theme::instance()->enforceVirtualFilesSyncFolder());
// ac = menu->addAction(tr("Disable virtual file support …"));
// connect(ac, &QAction::triggered, this, &AccountSettings::slotDisableVfsCurrentFolder);
// ac->setDisabled(Theme::instance()->enforceVirtualFilesSyncFolder());
}

// if (Theme::instance()->showVirtualFilesOption() && !folder->virtualFilesEnabled() && Vfs::checkAvailability(folder->path())) {
Expand Down
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 @@ -567,10 +567,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 @@ -1189,40 +1200,41 @@ void SocketApi::sendSharingContextMenuOptions(const FileData &fileData, SocketLi
listener->sendMessage(QLatin1String("MENU_ITEM:LEAVESHARE") + flagString + tr("Leave this share"));
}

//Magenta customization
// 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"));
}
// 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 @@ -1386,9 +1398,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

0 comments on commit 5d84c90

Please sign in to comment.