From 0109607404cc3803dc5501e1fd3a7a2ced523151 Mon Sep 17 00:00:00 2001 From: memurats Date: Fri, 24 Oct 2025 15:07:30 +0200 Subject: [PATCH 01/10] account settings dialog changes --- src/gui/CMakeLists.txt | 7 ++ src/gui/accountsettings.cpp | 5 +- src/gui/accountsettings.h | 8 +- src/gui/accountsettings.ui | 25 ++++- src/gui/nmcgui/nmcaccountsettings.cpp | 147 ++++++++++++++++++++++++++ src/gui/nmcgui/nmcaccountsettings.h | 85 +++++++++++++++ src/gui/settingsdialog.cpp | 5 +- 7 files changed, 274 insertions(+), 8 deletions(-) create mode 100644 src/gui/nmcgui/nmcaccountsettings.cpp create mode 100644 src/gui/nmcgui/nmcaccountsettings.h diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 54d32c3580e86..06f095611462a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,6 +6,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) +#NMC customization: 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(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -260,6 +263,10 @@ set(client_SRCS wizard/wizardproxysettingsdialog.cpp ) +file(GLOB NMC_FILES "nmcgui/*") +set(NMC_SRCS ${NMC_FILES}) +list(APPEND client_SRCS ${NMC_SRCS}) + if (NOT DISABLE_ACCOUNT_MIGRATION) list(APPEND client_SRCS legacyaccountselectiondialog.h diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index f246a7026495e..c302f9e613a2f 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -1172,7 +1172,6 @@ void AccountSettings::showConnectionLabel(const QString &message, QStringList er _ui->connectLabel->setToolTip({}); _ui->connectLabel->setStyleSheet(errStyle); } - _ui->accountStatus->setVisible(!message.isEmpty()); } void AccountSettings::slotEnableCurrentFolder(bool terminate) @@ -1268,9 +1267,10 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used) const auto totalStr = Utility::octetsToString(total); const auto percentStr = Utility::compactFormatDouble(percent, 1); const auto toolTip = tr("%1 (%3%) of %2 in use. Some folders, including network mounted or shared folders, might have different limits.").arg(usedStr, totalStr, percentStr); - _ui->quotaInfoLabel->setText(tr("%1 of %2 in use").arg(usedStr, totalStr)); + _ui->quotaInfoLabel->setText(QCoreApplication::translate("", "%1_OF_%2").arg(usedStr, totalStr)); _ui->quotaInfoLabel->setToolTip(toolTip); _ui->quotaProgressBar->setToolTip(toolTip); + _ui->quotaInfoText->setText(QCoreApplication::translate("", "USED_STORAGE_%1").arg(percentStr)); } else { _ui->quotaProgressBar->setVisible(false); _ui->quotaInfoLabel->setToolTip({}); @@ -1282,6 +1282,7 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used) const auto usedStr = Utility::octetsToString(used); _ui->quotaInfoLabel->setText(tr("%1 in use").arg(usedStr)); } + _ui->quotaInfoText->setText(QCoreApplication::translate("", "USED_STORAGE_%1").arg(QString::number(0))); } } diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index 6db64c3f7e229..f9b904171417b 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -108,6 +108,7 @@ protected slots: const QVector &roles); void slotPossiblyUnblacklistE2EeFoldersAndRestartSync(); + void checkClientSideEncryptionState(); void slotE2eEncryptionCertificateNeedMigration(); private slots: @@ -124,9 +125,14 @@ private slots: void setupE2eEncryption(); void forgetE2eEncryption(); - void checkClientSideEncryptionState(); void removeActionFromEncryptionMessage(const QString &actionId); +protected: + Ui::AccountSettings *getUi() const + { + return _ui; + } + private: bool event(QEvent *) override; QAction *addActionToEncryptionMessage(const QString &actionTitle, const QString &actionId); diff --git a/src/gui/accountsettings.ui b/src/gui/accountsettings.ui index 2db413221b169..b09eea0e43e04 100644 --- a/src/gui/accountsettings.ui +++ b/src/gui/accountsettings.ui @@ -14,7 +14,7 @@ Form - + @@ -66,9 +66,28 @@ + + + + + 0 + 0 + + + + 0% of memory used + + + Qt::PlainText + + + false + + + - + @@ -257,7 +276,7 @@ - + QTabWidget::Rounded diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp new file mode 100644 index 0000000000000..391ac940c4db6 --- /dev/null +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (C) by Eugen Fischer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + + #include "nmcgui/nmcaccountsettings.h" + #include "ui_accountsettings.h" + #include "../common/utility.h" + #include "guiutility.h" + + #include + #include + #include + #include + #include + #include + #include + #include + + namespace OCC { + + NMCAccountSettings::NMCAccountSettings(AccountState *accountState, QWidget *parent) + : AccountSettings(accountState, parent) + , m_liveAccountButton(new CustomButton(QCoreApplication::translate("", "ADD_LIVE_BACKUP"), QIcon(QLatin1String(":/client/theme/NMCIcons/action-add.svg")).pixmap(24,24))) + , m_liveTitle(new QLabel(QCoreApplication::translate("", "LIVE_BACKUPS"))) + , m_liveDescription(new QLabel(QCoreApplication::translate("", "LIVE_DESCRIPTION"))) + , m_folderSync(new QLabel(QCoreApplication::translate("", "YOUR_FOLDER_SYNC"))) + { + setDefaultSettings(); + setLayout(); + connect(m_liveAccountButton, &CustomButton::clicked, this, &NMCAccountSettings::slotAddFolder); + } + + void NMCAccountSettings::setDefaultSettings() + { + getUi()->encryptionMessage->setCloseButtonVisible(true); + getUi()->selectiveSyncStatus->setVisible(false); + getUi()->selectiveSyncNotification->setVisible(false); + getUi()->accountStatus->setVisible(false); + getUi()->bigFolderUi->setVisible(false); + getUi()->gridLayout->setSpacing(8); + } + + void NMCAccountSettings::setLayout() + { + // Entferne alte Quota-Widgets + getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoLabel); + getUi()->storageGroupBox->removeWidget(getUi()->quotaProgressBar); + getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoText); + + getUi()->gridLayout->removeWidget(getUi()->encryptionMessage); + getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); + + // Titel für Folder Sync + m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); + m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + getUi()->gridLayout->addWidget(m_folderSync, 1, 0); + + // Live-Backup-Bereich + auto *liveHLayout = new QHBoxLayout(); + liveHLayout->setContentsMargins(8, 8, 8, 8); + + auto *liveVLayout = new QVBoxLayout(); + auto *liveWidget = new QWidget(this); + liveWidget->setStyleSheet("QWidget {border-radius: 4px;}"); + liveWidget->setLayout(liveHLayout); + + liveHLayout->addLayout(liveVLayout); + liveHLayout->addStretch(); + + const QString styleSheet = QStringLiteral( + "QPushButton { font-size: %5px; border: %1px solid; border-color: black; " + "border-radius: 4px; background-color: %2; color: %3; } " + "QPushButton:hover { background-color: %4; }"); + + m_liveAccountButton->setStyleSheet(styleSheet.arg("0", "#E20074", "white", "#c00063", "13")); + m_liveAccountButton->setFixedSize(180, 32); + m_liveAccountButton->setLeftIconMargin(4); + + liveHLayout->addWidget(m_liveAccountButton); + + liveVLayout->addWidget(m_liveTitle); + m_liveTitle->setStyleSheet("font-size: 15px; font-weight: 600;"); + + liveVLayout->addWidget(m_liveDescription); + m_liveDescription->setStyleSheet("font-size: 13px;"); + m_liveDescription->setText(QCoreApplication::translate("", "LIVE_BACKUPS_DESCRIPTION")); + m_liveDescription->setWordWrap(true); + m_liveDescription->setFixedWidth(450); + + getUi()->gridLayout->addWidget(liveWidget, 4, 0); + + // Speicherbereich + auto *magentaHLayout = new QHBoxLayout(); + magentaHLayout->setSpacing(32); + + auto *quotaVLayout = new QVBoxLayout(); + quotaVLayout->setSpacing(4); + quotaVLayout->addSpacing(12); + + quotaVLayout->addWidget(getUi()->quotaInfoLabel); + getUi()->quotaInfoLabel->setStyleSheet("QLabel { font-size: 18px; padding: 8px; font-weight: 500; }"); + + quotaVLayout->addWidget(getUi()->quotaProgressBar); + getUi()->quotaProgressBar->setStyleSheet( + "QProgressBar { background-color: #e5e5e5; color: black; border: 1px solid black; border-radius: 4px; margin-left: 8px; } " + "QProgressBar::chunk { background-color: #E20074; }"); + getUi()->quotaProgressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + + quotaVLayout->addWidget(getUi()->quotaInfoText); + getUi()->quotaInfoText->setStyleSheet("QLabel { font-size: 13px; padding: 8px; }"); + + quotaVLayout->addSpacing(20); + magentaHLayout->addLayout(quotaVLayout); + + auto *storageLinkButton = new QPushButton(QCoreApplication::translate("", "STORAGE_EXTENSION"), this); + storageLinkButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + storageLinkButton->setStyleSheet( + "QPushButton { height: 32px; width: 180px; border: 1px solid black; background-color: #ededed; " + "color: black; font-size: 13px; border-radius: 4px; } " + "QPushButton::hover { background-color: white; }"); + + connect(storageLinkButton, &QPushButton::clicked, this, []() { + QDesktopServices::openUrl(QUrl(QStringLiteral("https://cloud.telekom-dienste.de/tarife"))); + }); + + magentaHLayout->addWidget(storageLinkButton); + magentaHLayout->addSpacing(8); + + getUi()->gridLayout->addLayout(magentaHLayout, 5, 0); + + // Sichtbarkeit initial ausblenden + getUi()->encryptionMessage->hide(); + checkClientSideEncryptionState(); + } + + } // namespace OCC + \ No newline at end of file diff --git a/src/gui/nmcgui/nmcaccountsettings.h b/src/gui/nmcgui/nmcaccountsettings.h new file mode 100644 index 0000000000000..b8ebc65c86516 --- /dev/null +++ b/src/gui/nmcgui/nmcaccountsettings.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) by Eugen Fischer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + + #ifndef MIRALL_ACCOUNTSETTINGSMAGENTA_H + #define MIRALL_ACCOUNTSETTINGSMAGENTA_H + + #include + #include + #include + #include + + #include + + namespace OCC { + + /** + * @brief A QPushButton with a custom left icon margin. + */ + class CustomButton : public QPushButton { + Q_OBJECT + + public: + explicit CustomButton(const QString &text, const QIcon &icon, QWidget *parent = nullptr) + : QPushButton(text, parent) + , m_icon(icon) + { + setIconSize(QSize(24, 24)); + } + + void setLeftIconMargin(int margin) { m_leftMargin = margin; } + + protected: + void paintEvent(QPaintEvent *event) override { + QPushButton::paintEvent(event); + // Optional icon rendering (currently disabled) + // if (!m_icon.isNull()) { + // QRect iconRect(m_leftMargin, + // (height() - iconSize().height()) / 2, + // iconSize().width(), + // iconSize().height()); + // QPainter painter(this); + // painter.drawPixmap(iconRect, m_icon.pixmap(iconSize())); + // } + } + + private: + QIcon m_icon; + int m_leftMargin = 4; + }; + + /** + * @brief Erweiterte AccountSettings-Ansicht für Magenta. + */ + class NMCAccountSettings : public AccountSettings { + Q_OBJECT + + public: + explicit NMCAccountSettings(AccountState *accountState, QWidget *parent = nullptr); + ~NMCAccountSettings() override = default; + + private: + void setDefaultSettings(); + void setLayout(); + + CustomButton *m_liveAccountButton = nullptr; + QLabel *m_liveTitle = nullptr; + QLabel *m_liveDescription = nullptr; + QLabel *m_folderSync = nullptr; + }; + + } // namespace OCC + + #endif // MIRALL_ACCOUNTSETTINGSMAGENTA_H + \ No newline at end of file diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index dc6ab9cb802ca..c9f0f2a9dda6f 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -12,6 +12,7 @@ #include "generalsettings.h" #include "networksettings.h" #include "accountsettings.h" +#include "nmcgui/nmcaccountsettings.h" #include "configfile.h" #include "progressdispatcher.h" #include "owncloudgui.h" @@ -235,7 +236,7 @@ void SettingsDialog::accountAdded(AccountState *s) } _toolBar->insertAction(_toolBar->actions().at(0), accountAction); - auto accountSettings = new AccountSettings(s, this); + auto accountSettings = new NMCAccountSettings(s, this); QString objectName = QLatin1String("accountSettings_"); objectName += s->account()->displayName(); accountSettings->setObjectName(objectName); @@ -297,7 +298,7 @@ void SettingsDialog::slotAccountDisplayNameChanged() void SettingsDialog::accountRemoved(AccountState *s) { for (auto it = _actionGroupWidgets.begin(); it != _actionGroupWidgets.end(); ++it) { - auto as = qobject_cast(*it); + auto as = qobject_cast(*it); if (!as) { continue; } From cd46926164e07518c5ba9f7fba2498e15b435f59 Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 14:51:59 +0100 Subject: [PATCH 02/10] updated gui cmake file --- src/gui/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 06f095611462a..96fb9c4f5ac4a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,9 +6,6 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) -#NMC customization: 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(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -26,6 +23,9 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc) set(theme_dir ${CMAKE_SOURCE_DIR}/theme) +#NMC customization: needed to find the ui file in a different location than the header file +set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") + set(client_UI_SRCS accountsettings.ui conflictdialog.ui From 31a92d6013357ed3a0552b5b3981515409eb8454 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 11 Nov 2025 15:55:48 +0100 Subject: [PATCH 03/10] added control of live backup --- src/gui/nmcgui/nmcaccountsettings.cpp | 201 ++++++++++++++------------ src/gui/nmcgui/nmcaccountsettings.h | 1 + 2 files changed, 111 insertions(+), 91 deletions(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index 391ac940c4db6..cd9f95bece3a4 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -51,97 +51,116 @@ } void NMCAccountSettings::setLayout() - { - // Entferne alte Quota-Widgets - getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoLabel); - getUi()->storageGroupBox->removeWidget(getUi()->quotaProgressBar); - getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoText); - - getUi()->gridLayout->removeWidget(getUi()->encryptionMessage); - getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); - - // Titel für Folder Sync - m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); - m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - getUi()->gridLayout->addWidget(m_folderSync, 1, 0); - - // Live-Backup-Bereich - auto *liveHLayout = new QHBoxLayout(); - liveHLayout->setContentsMargins(8, 8, 8, 8); - - auto *liveVLayout = new QVBoxLayout(); - auto *liveWidget = new QWidget(this); - liveWidget->setStyleSheet("QWidget {border-radius: 4px;}"); - liveWidget->setLayout(liveHLayout); - - liveHLayout->addLayout(liveVLayout); - liveHLayout->addStretch(); - - const QString styleSheet = QStringLiteral( - "QPushButton { font-size: %5px; border: %1px solid; border-color: black; " - "border-radius: 4px; background-color: %2; color: %3; } " - "QPushButton:hover { background-color: %4; }"); - - m_liveAccountButton->setStyleSheet(styleSheet.arg("0", "#E20074", "white", "#c00063", "13")); - m_liveAccountButton->setFixedSize(180, 32); - m_liveAccountButton->setLeftIconMargin(4); - - liveHLayout->addWidget(m_liveAccountButton); - - liveVLayout->addWidget(m_liveTitle); - m_liveTitle->setStyleSheet("font-size: 15px; font-weight: 600;"); - - liveVLayout->addWidget(m_liveDescription); - m_liveDescription->setStyleSheet("font-size: 13px;"); - m_liveDescription->setText(QCoreApplication::translate("", "LIVE_BACKUPS_DESCRIPTION")); - m_liveDescription->setWordWrap(true); - m_liveDescription->setFixedWidth(450); - - getUi()->gridLayout->addWidget(liveWidget, 4, 0); - - // Speicherbereich - auto *magentaHLayout = new QHBoxLayout(); - magentaHLayout->setSpacing(32); - - auto *quotaVLayout = new QVBoxLayout(); - quotaVLayout->setSpacing(4); - quotaVLayout->addSpacing(12); - - quotaVLayout->addWidget(getUi()->quotaInfoLabel); - getUi()->quotaInfoLabel->setStyleSheet("QLabel { font-size: 18px; padding: 8px; font-weight: 500; }"); - - quotaVLayout->addWidget(getUi()->quotaProgressBar); - getUi()->quotaProgressBar->setStyleSheet( - "QProgressBar { background-color: #e5e5e5; color: black; border: 1px solid black; border-radius: 4px; margin-left: 8px; } " - "QProgressBar::chunk { background-color: #E20074; }"); - getUi()->quotaProgressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - - quotaVLayout->addWidget(getUi()->quotaInfoText); - getUi()->quotaInfoText->setStyleSheet("QLabel { font-size: 13px; padding: 8px; }"); - - quotaVLayout->addSpacing(20); - magentaHLayout->addLayout(quotaVLayout); - - auto *storageLinkButton = new QPushButton(QCoreApplication::translate("", "STORAGE_EXTENSION"), this); - storageLinkButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - storageLinkButton->setStyleSheet( - "QPushButton { height: 32px; width: 180px; border: 1px solid black; background-color: #ededed; " - "color: black; font-size: 13px; border-radius: 4px; } " - "QPushButton::hover { background-color: white; }"); - - connect(storageLinkButton, &QPushButton::clicked, this, []() { - QDesktopServices::openUrl(QUrl(QStringLiteral("https://cloud.telekom-dienste.de/tarife"))); - }); - - magentaHLayout->addWidget(storageLinkButton); - magentaHLayout->addSpacing(8); - - getUi()->gridLayout->addLayout(magentaHLayout, 5, 0); - - // Sichtbarkeit initial ausblenden - getUi()->encryptionMessage->hide(); - checkClientSideEncryptionState(); - } +{ + // Entferne alte Quota-Widgets + getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoLabel); + getUi()->storageGroupBox->removeWidget(getUi()->quotaProgressBar); + getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoText); + + getUi()->gridLayout->removeWidget(getUi()->encryptionMessage); + getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); + + // Titel für Folder Sync + m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); + m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + getUi()->gridLayout->addWidget(m_folderSync, 1, 0); + + // --- Live-Backup-Bereich --- + auto *liveHLayout = new QHBoxLayout(); + liveHLayout->setContentsMargins(8, 8, 8, 8); + + auto *liveVLayout = new QVBoxLayout(); + m_liveWidget = new QWidget(this); // Membervariable statt lokale Variable + m_liveWidget->setStyleSheet("QWidget { border-radius: 4px; }"); + m_liveWidget->setLayout(liveHLayout); + + liveHLayout->addLayout(liveVLayout); + liveHLayout->addStretch(); + + const QString styleSheet = QStringLiteral( + "QPushButton { font-size: %5px; border: %1px solid; border-color: black; " + "border-radius: 4px; background-color: %2; color: %3; } " + "QPushButton:hover { background-color: %4; }"); + + m_liveAccountButton->setStyleSheet(styleSheet.arg("0", "#E20074", "white", "#c00063", "13")); + m_liveAccountButton->setFixedSize(180, 32); + m_liveAccountButton->setLeftIconMargin(4); + + liveHLayout->addWidget(m_liveAccountButton); + + liveVLayout->addWidget(m_liveTitle); + m_liveTitle->setStyleSheet("font-size: 15px; font-weight: 600;"); + + liveVLayout->addWidget(m_liveDescription); + m_liveDescription->setStyleSheet("font-size: 13px;"); + m_liveDescription->setText(QCoreApplication::translate("", "LIVE_BACKUPS_DESCRIPTION")); + m_liveDescription->setWordWrap(true); + m_liveDescription->setFixedWidth(450); + + getUi()->gridLayout->addWidget(m_liveWidget, 4, 0); + + // --- Speicherbereich (Quota) --- + auto *magentaHLayout = new QHBoxLayout(); + magentaHLayout->setSpacing(32); + + auto *quotaVLayout = new QVBoxLayout(); + quotaVLayout->setSpacing(4); + quotaVLayout->addSpacing(12); + + quotaVLayout->addWidget(getUi()->quotaInfoLabel); + getUi()->quotaInfoLabel->setStyleSheet("QLabel { font-size: 18px; padding: 8px; font-weight: 500; }"); + + quotaVLayout->addWidget(getUi()->quotaProgressBar); + getUi()->quotaProgressBar->setStyleSheet( + "QProgressBar { background-color: #e5e5e5; color: black; border: 1px solid black; border-radius: 4px; margin-left: 8px; } " + "QProgressBar::chunk { background-color: #E20074; }"); + getUi()->quotaProgressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + + quotaVLayout->addWidget(getUi()->quotaInfoText); + getUi()->quotaInfoText->setStyleSheet("QLabel { font-size: 13px; padding: 8px; }"); + + quotaVLayout->addSpacing(20); + magentaHLayout->addLayout(quotaVLayout); + + auto *storageLinkButton = new QPushButton(QCoreApplication::translate("", "STORAGE_EXTENSION"), this); + storageLinkButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + storageLinkButton->setStyleSheet( + "QPushButton { height: 32px; width: 180px; border: 1px solid black; background-color: #ededed; " + "color: black; font-size: 13px; border-radius: 4px; } " + "QPushButton:hover { background-color: white; }"); + + connect(storageLinkButton, &QPushButton::clicked, this, []() { + QDesktopServices::openUrl(QUrl(QStringLiteral("https://cloud.telekom-dienste.de/tarife"))); + }); + + magentaHLayout->addWidget(storageLinkButton); + magentaHLayout->addSpacing(8); + + getUi()->gridLayout->addLayout(magentaHLayout, 5, 0); + + // --- Sichtbarkeit initial ausblenden --- + getUi()->encryptionMessage->hide(); + checkClientSideEncryptionState(); + + // --- Sichtbarkeit des Live-Backup-Bereichs je nach Tab --- + auto *tabWidget = getUi()->tabWidget; + auto *fileProviderTab = getUi()->fileProviderTab; + auto *connectionSettingsTab = getUi()->connectionSettingsTab; + + if (tabWidget && fileProviderTab && connectionSettingsTab) { + connect(tabWidget, &QTabWidget::currentChanged, this, + [this, tabWidget, fileProviderTab](int index) { + QWidget *currentTab = tabWidget->widget(index); + bool showLiveBackup = (currentTab == fileProviderTab); + m_liveWidget->setVisible(showLiveBackup); + }); + + // Initialzustand + QWidget *currentTab = tabWidget->currentWidget(); + bool showLiveBackup = (currentTab == fileProviderTab); + m_liveWidget->setVisible(showLiveBackup); + } +} } // namespace OCC \ No newline at end of file diff --git a/src/gui/nmcgui/nmcaccountsettings.h b/src/gui/nmcgui/nmcaccountsettings.h index b8ebc65c86516..1439d813b3a06 100644 --- a/src/gui/nmcgui/nmcaccountsettings.h +++ b/src/gui/nmcgui/nmcaccountsettings.h @@ -77,6 +77,7 @@ QLabel *m_liveTitle = nullptr; QLabel *m_liveDescription = nullptr; QLabel *m_folderSync = nullptr; + QWidget *m_liveWidget = nullptr; }; } // namespace OCC From 8466851616fee76826a9da2b3f88f1d0175571c3 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 11 Nov 2025 17:05:28 +0100 Subject: [PATCH 04/10] removed folder sync title --- src/gui/nmcgui/nmcaccountsettings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index cd9f95bece3a4..28c8d4a6b79e1 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -61,9 +61,9 @@ getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); // Titel für Folder Sync - m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); - m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - getUi()->gridLayout->addWidget(m_folderSync, 1, 0); + // m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); + // m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + // getUi()->gridLayout->addWidget(m_folderSync, 1, 0); // --- Live-Backup-Bereich --- auto *liveHLayout = new QHBoxLayout(); From 65b569cdfca6ebacec877a7e0c0ade4bbd94d179 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 11 Nov 2025 17:09:25 +0100 Subject: [PATCH 05/10] add debug --- src/gui/nmcgui/nmcaccountsettings.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index 28c8d4a6b79e1..be7a3e37270f3 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -25,6 +25,7 @@ #include #include #include + #include namespace OCC { @@ -148,16 +149,26 @@ auto *connectionSettingsTab = getUi()->connectionSettingsTab; if (tabWidget && fileProviderTab && connectionSettingsTab) { + qDebug() << "Tabs:" << tabWidget->count(); + for (int i = 0; i < tabWidget->count(); ++i) { + qDebug() << "Tab" << i << ":" << tabWidget->widget(i); + } + qDebug() << "fileProviderTab =" << fileProviderTab; + qDebug() << "connectionSettingsTab =" << connectionSettingsTab; + connect(tabWidget, &QTabWidget::currentChanged, this, [this, tabWidget, fileProviderTab](int index) { QWidget *currentTab = tabWidget->widget(index); bool showLiveBackup = (currentTab == fileProviderTab); + qDebug() << "currentTab =" << currentTab + << "fileProviderTab =" << fileProviderTab + << "showLiveBackup =" << showLiveBackup; m_liveWidget->setVisible(showLiveBackup); }); - // Initialzustand QWidget *currentTab = tabWidget->currentWidget(); bool showLiveBackup = (currentTab == fileProviderTab); + qDebug() << "Initial showLiveBackup =" << showLiveBackup; m_liveWidget->setVisible(showLiveBackup); } } From 6c5ed3866e50eb064bddf04c6ea8d90527734024 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 12 Nov 2025 12:18:42 +0100 Subject: [PATCH 06/10] fixed tabs --- src/gui/nmcgui/nmcaccountsettings.cpp | 36 +++++---------------------- src/gui/nmcgui/nmcaccountsettings.h | 1 - translations/client_de.ts | 2 +- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index be7a3e37270f3..959284cc19d79 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -25,7 +25,6 @@ #include #include #include - #include namespace OCC { @@ -34,7 +33,6 @@ , m_liveAccountButton(new CustomButton(QCoreApplication::translate("", "ADD_LIVE_BACKUP"), QIcon(QLatin1String(":/client/theme/NMCIcons/action-add.svg")).pixmap(24,24))) , m_liveTitle(new QLabel(QCoreApplication::translate("", "LIVE_BACKUPS"))) , m_liveDescription(new QLabel(QCoreApplication::translate("", "LIVE_DESCRIPTION"))) - , m_folderSync(new QLabel(QCoreApplication::translate("", "YOUR_FOLDER_SYNC"))) { setDefaultSettings(); setLayout(); @@ -61,11 +59,6 @@ getUi()->gridLayout->removeWidget(getUi()->encryptionMessage); getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); - // Titel für Folder Sync - // m_folderSync->setStyleSheet("font-size: 15px; font-weight: 600; padding: 8px;"); - // m_folderSync->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - // getUi()->gridLayout->addWidget(m_folderSync, 1, 0); - // --- Live-Backup-Bereich --- auto *liveHLayout = new QHBoxLayout(); liveHLayout->setContentsMargins(8, 8, 8, 8); @@ -148,29 +141,12 @@ auto *fileProviderTab = getUi()->fileProviderTab; auto *connectionSettingsTab = getUi()->connectionSettingsTab; - if (tabWidget && fileProviderTab && connectionSettingsTab) { - qDebug() << "Tabs:" << tabWidget->count(); - for (int i = 0; i < tabWidget->count(); ++i) { - qDebug() << "Tab" << i << ":" << tabWidget->widget(i); - } - qDebug() << "fileProviderTab =" << fileProviderTab; - qDebug() << "connectionSettingsTab =" << connectionSettingsTab; - - connect(tabWidget, &QTabWidget::currentChanged, this, - [this, tabWidget, fileProviderTab](int index) { - QWidget *currentTab = tabWidget->widget(index); - bool showLiveBackup = (currentTab == fileProviderTab); - qDebug() << "currentTab =" << currentTab - << "fileProviderTab =" << fileProviderTab - << "showLiveBackup =" << showLiveBackup; - m_liveWidget->setVisible(showLiveBackup); - }); - - QWidget *currentTab = tabWidget->currentWidget(); - bool showLiveBackup = (currentTab == fileProviderTab); - qDebug() << "Initial showLiveBackup =" << showLiveBackup; - m_liveWidget->setVisible(showLiveBackup); - } + connect(tabWidget, &QTabWidget::currentChanged, this, [this, tabWidget, connectionsSettingsTab](int index) { + QWidget *currentTab = tabWidget->widget(index); + // Live-Backups nur ausblenden, wenn Connection Settings aktiv ist + bool hideLiveBackup = (currentTab == connectionsSettingsTab); + m_liveWidget->setVisible(!hideLiveBackup); + }); } } // namespace OCC diff --git a/src/gui/nmcgui/nmcaccountsettings.h b/src/gui/nmcgui/nmcaccountsettings.h index 1439d813b3a06..c323391383be9 100644 --- a/src/gui/nmcgui/nmcaccountsettings.h +++ b/src/gui/nmcgui/nmcaccountsettings.h @@ -76,7 +76,6 @@ CustomButton *m_liveAccountButton = nullptr; QLabel *m_liveTitle = nullptr; QLabel *m_liveDescription = nullptr; - QLabel *m_folderSync = nullptr; QWidget *m_liveWidget = nullptr; }; diff --git a/translations/client_de.ts b/translations/client_de.ts index 0b4417654c6b4..3db9bb7957ce4 100644 --- a/translations/client_de.ts +++ b/translations/client_de.ts @@ -515,7 +515,7 @@ Soll das Konto importiert werden? Standard file sync - Standard Dateisynchronisierung + Ihre Ordner in Synchronisation From 82107ba397a0780e770c3542312ba853e8128498 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 12 Nov 2025 12:51:08 +0100 Subject: [PATCH 07/10] fix error --- src/gui/nmcgui/nmcaccountsettings.cpp | 98 ++++++++++++++------------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index 959284cc19d79..49a78f608fea2 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -12,44 +12,44 @@ * for more details. */ - #include "nmcgui/nmcaccountsettings.h" - #include "ui_accountsettings.h" - #include "../common/utility.h" - #include "guiutility.h" - - #include - #include - #include - #include - #include - #include - #include - #include - - namespace OCC { - - NMCAccountSettings::NMCAccountSettings(AccountState *accountState, QWidget *parent) - : AccountSettings(accountState, parent) - , m_liveAccountButton(new CustomButton(QCoreApplication::translate("", "ADD_LIVE_BACKUP"), QIcon(QLatin1String(":/client/theme/NMCIcons/action-add.svg")).pixmap(24,24))) - , m_liveTitle(new QLabel(QCoreApplication::translate("", "LIVE_BACKUPS"))) - , m_liveDescription(new QLabel(QCoreApplication::translate("", "LIVE_DESCRIPTION"))) - { - setDefaultSettings(); - setLayout(); - connect(m_liveAccountButton, &CustomButton::clicked, this, &NMCAccountSettings::slotAddFolder); - } - - void NMCAccountSettings::setDefaultSettings() - { - getUi()->encryptionMessage->setCloseButtonVisible(true); - getUi()->selectiveSyncStatus->setVisible(false); - getUi()->selectiveSyncNotification->setVisible(false); - getUi()->accountStatus->setVisible(false); - getUi()->bigFolderUi->setVisible(false); - getUi()->gridLayout->setSpacing(8); - } - - void NMCAccountSettings::setLayout() +#include "nmcgui/nmcaccountsettings.h" +#include "ui_accountsettings.h" +#include "../common/utility.h" +#include "guiutility.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace OCC { + +NMCAccountSettings::NMCAccountSettings(AccountState *accountState, QWidget *parent) + : AccountSettings(accountState, parent) + , m_liveAccountButton(new CustomButton(QCoreApplication::translate("", "ADD_LIVE_BACKUP"), QIcon(QLatin1String(":/client/theme/NMCIcons/action-add.svg")).pixmap(24,24))) + , m_liveTitle(new QLabel(QCoreApplication::translate("", "LIVE_BACKUPS"))) + , m_liveDescription(new QLabel(QCoreApplication::translate("", "LIVE_DESCRIPTION"))) +{ + setDefaultSettings(); + setLayout(); + connect(m_liveAccountButton, &CustomButton::clicked, this, &NMCAccountSettings::slotAddFolder); +} + +void NMCAccountSettings::setDefaultSettings() +{ + getUi()->encryptionMessage->setCloseButtonVisible(true); + getUi()->selectiveSyncStatus->setVisible(false); + getUi()->selectiveSyncNotification->setVisible(false); + getUi()->accountStatus->setVisible(false); + getUi()->bigFolderUi->setVisible(false); + getUi()->gridLayout->setSpacing(8); +} + +void NMCAccountSettings::setLayout() { // Entferne alte Quota-Widgets getUi()->storageGroupBox->removeWidget(getUi()->quotaInfoLabel); @@ -141,13 +141,19 @@ auto *fileProviderTab = getUi()->fileProviderTab; auto *connectionSettingsTab = getUi()->connectionSettingsTab; - connect(tabWidget, &QTabWidget::currentChanged, this, [this, tabWidget, connectionsSettingsTab](int index) { - QWidget *currentTab = tabWidget->widget(index); - // Live-Backups nur ausblenden, wenn Connection Settings aktiv ist - bool hideLiveBackup = (currentTab == connectionsSettingsTab); + if (tabWidget && connectionSettingsTab) { + connect(tabWidget, &QTabWidget::currentChanged, this, + [this, tabWidget, connectionSettingsTab](int index) { + QWidget *currentTab = tabWidget->widget(index); + bool hideLiveBackup = (currentTab == connectionSettingsTab); + m_liveWidget->setVisible(!hideLiveBackup); + }); + + // Initialzustand + QWidget *currentTab = tabWidget->currentWidget(); + bool hideLiveBackup = (currentTab == connectionSettingsTab); m_liveWidget->setVisible(!hideLiveBackup); - }); + } } - - } // namespace OCC - \ No newline at end of file + +} // namespace OCC From cd49f3cc010f50bbb4e51a444af6769fa1c9c80b Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 10:24:27 +0100 Subject: [PATCH 08/10] removed unused variable --- src/gui/nmcgui/nmcaccountsettings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index 49a78f608fea2..120d259af9779 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -138,7 +138,6 @@ void NMCAccountSettings::setLayout() // --- Sichtbarkeit des Live-Backup-Bereichs je nach Tab --- auto *tabWidget = getUi()->tabWidget; - auto *fileProviderTab = getUi()->fileProviderTab; auto *connectionSettingsTab = getUi()->connectionSettingsTab; if (tabWidget && connectionSettingsTab) { From f3962d11bf244036208d326514d0f4e899793483 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 10:00:34 +0100 Subject: [PATCH 09/10] added spacer --- src/gui/nmcgui/nmcaccountsettings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index 120d259af9779..b397404b2578a 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -58,6 +58,10 @@ void NMCAccountSettings::setLayout() getUi()->gridLayout->removeWidget(getUi()->encryptionMessage); getUi()->gridLayout->addWidget(getUi()->encryptionMessage, 0, 0); + getUi()->gridLayout->addItem( + new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed), + 1, 0 + ); // --- Live-Backup-Bereich --- auto *liveHLayout = new QHBoxLayout(); From d8da1f1049c2bd22b1372a1ac45bab4ece137c0a Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 19 Nov 2025 08:59:30 +0100 Subject: [PATCH 10/10] changed spacing --- src/gui/nmcgui/nmcaccountsettings.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/nmcgui/nmcaccountsettings.cpp b/src/gui/nmcgui/nmcaccountsettings.cpp index b397404b2578a..85b01fe365f4e 100644 --- a/src/gui/nmcgui/nmcaccountsettings.cpp +++ b/src/gui/nmcgui/nmcaccountsettings.cpp @@ -68,7 +68,7 @@ void NMCAccountSettings::setLayout() liveHLayout->setContentsMargins(8, 8, 8, 8); auto *liveVLayout = new QVBoxLayout(); - m_liveWidget = new QWidget(this); // Membervariable statt lokale Variable + m_liveWidget = new QWidget(this); m_liveWidget->setStyleSheet("QWidget { border-radius: 4px; }"); m_liveWidget->setLayout(liveHLayout); @@ -99,14 +99,13 @@ void NMCAccountSettings::setLayout() // --- Speicherbereich (Quota) --- auto *magentaHLayout = new QHBoxLayout(); - magentaHLayout->setSpacing(32); + magentaHLayout->setSpacing(12); auto *quotaVLayout = new QVBoxLayout(); quotaVLayout->setSpacing(4); - quotaVLayout->addSpacing(12); quotaVLayout->addWidget(getUi()->quotaInfoLabel); - getUi()->quotaInfoLabel->setStyleSheet("QLabel { font-size: 18px; padding: 8px; font-weight: 500; }"); + getUi()->quotaInfoLabel->setStyleSheet("QLabel { font-size: 18px; padding: 4px; font-weight: 500; }"); quotaVLayout->addWidget(getUi()->quotaProgressBar); getUi()->quotaProgressBar->setStyleSheet( @@ -115,9 +114,9 @@ void NMCAccountSettings::setLayout() getUi()->quotaProgressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); quotaVLayout->addWidget(getUi()->quotaInfoText); - getUi()->quotaInfoText->setStyleSheet("QLabel { font-size: 13px; padding: 8px; }"); + getUi()->quotaInfoText->setStyleSheet("QLabel { font-size: 13px; padding: 4px; }"); - quotaVLayout->addSpacing(20); + quotaVLayout->addSpacing(12); magentaHLayout->addLayout(quotaVLayout); auto *storageLinkButton = new QPushButton(QCoreApplication::translate("", "STORAGE_EXTENSION"), this);