From a99a8a7443d6ff325ed438a49ad545ce89439ddc Mon Sep 17 00:00:00 2001 From: Eugen Fischer Date: Sat, 25 Nov 2023 19:46:34 +0100 Subject: [PATCH] Live backup --- .../xcshareddata/swiftpm/Package.resolved | 68 +++++++++++++++++++ src/gui/accountsettings.cpp | 4 +- src/gui/folderwizard.cpp | 2 +- src/gui/nmcgui/nmcfolderwizard.cpp | 13 +++- src/gui/nmcgui/nmcfolderwizardsourcepage.cpp | 35 ++++++++-- src/gui/nmcgui/nmcfolderwizardsourcepage.h | 4 +- src/gui/nmcgui/nmcfolderwizardtargetpage.cpp | 49 +++++++++++-- src/gui/nmcgui/nmcfolderwizardtargetpage.h | 3 +- src/gui/nmcgui/nmcgeneralsettings.h | 2 +- src/gui/nmcgui/nmcnetworksettings.h | 2 +- 10 files changed, 161 insertions(+), 21 deletions(-) create mode 100644 shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000000..2b412a8c3866f --- /dev/null +++ b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,68 @@ +{ + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire", + "state" : { + "revision" : "b2fa556e4e48cbf06cf8c63def138c98f4b811fa", + "version" : "5.8.0" + } + }, + { + "identity" : "mocker", + "kind" : "remoteSourceControl", + "location" : "https://github.com/WeTransfer/Mocker.git", + "state" : { + "revision" : "5d86f27a8f80d4ba388bc1a379a3c2289a1f3d18", + "version" : "2.6.0" + } + }, + { + "identity" : "nextcloudkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/nextcloud/NextcloudKit", + "state" : { + "branch" : "develop", + "revision" : "adbfaf228d7df4ed0c0fbfe81337a5b0f1081be0" + } + }, + { + "identity" : "realm-core", + "kind" : "remoteSourceControl", + "location" : "https://github.com/realm/realm-core.git", + "state" : { + "revision" : "b77443ca7fa25407869ca537bf3ae912b1427bff", + "version" : "12.13.0" + } + }, + { + "identity" : "realm-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/realm/realm-swift.git", + "state" : { + "revision" : "b442ee3e9caa1abab26fd9b23f060f6f0815ff48", + "version" : "10.33.0" + } + }, + { + "identity" : "swiftyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SwiftyJSON/SwiftyJSON", + "state" : { + "revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07", + "version" : "5.0.1" + } + }, + { + "identity" : "swiftyxmlparser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/yahoojapan/SwiftyXMLParser", + "state" : { + "revision" : "d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be", + "version" : "5.6.0" + } + } + ], + "version" : 2 +} diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 29385aeda1ddc..69e57d42f72b0 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -743,7 +743,7 @@ void AccountSettings::slotAddFolder() const auto folderMan = FolderMan::instance(); folderMan->setSyncEnabled(false); // do not start more syncs. - const auto folderWizard = new NMCFolderWizard(_accountState->account(), this); + const auto folderWizard = new FolderWizard(_accountState->account(), this); folderWizard->setAttribute(Qt::WA_DeleteOnClose); connect(folderWizard, &QDialog::accepted, this, &AccountSettings::slotFolderWizardAccepted); @@ -754,7 +754,7 @@ void AccountSettings::slotAddFolder() void AccountSettings::slotFolderWizardAccepted() { - const auto folderWizard = qobject_cast(sender()); + const auto folderWizard = qobject_cast(sender()); const auto folderMan = FolderMan::instance(); qCInfo(lcAccountSettings) << "Folder wizard completed"; diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index be1456a92af89..f26bd571ca13a 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -669,7 +669,7 @@ void FolderWizardSelectiveSync::virtualFilesCheckboxClicked() FolderWizard::FolderWizard(AccountPtr account, QWidget *parent) : QWizard(parent) , _folderWizardSourcePage(new FolderWizardLocalPath(account)) - , _folderWizardSelectiveSyncPage(new FolderWizardSelectiveSync(account)) + //, _folderWizardSelectiveSyncPage(new FolderWizardSelectiveSync(account)) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setPage(Page_Source, _folderWizardSourcePage); diff --git a/src/gui/nmcgui/nmcfolderwizard.cpp b/src/gui/nmcgui/nmcfolderwizard.cpp index 5f6af1ee9647a..fc701c5675bf7 100644 --- a/src/gui/nmcgui/nmcfolderwizard.cpp +++ b/src/gui/nmcgui/nmcfolderwizard.cpp @@ -27,8 +27,17 @@ NMCFolderWizard::NMCFolderWizard(AccountPtr account, QWidget *parent) setOption(QWizard::NoBackButtonOnLastPage); setButtonText(QWizard::FinishButton, tr("Finish")); - _folderWizardSourcePage->getUi().localFolderLineEdit->clear(); - _folderWizardSourcePage->getUi().localFolderLineEdit->setPlaceholderText(tr("Please select a folder")); + //Source page + auto sourceUi = _folderWizardSourcePage->getUi(); + sourceUi.localFolderLineEdit->clear(); + sourceUi.localFolderLineEdit->setPlaceholderText(tr("Please select a folder")); + sourceUi.setDefaultSettings(); + sourceUi.setLayout(); + + //Target page + auto targetUi = _folderWizardTargetPage->getUi(); + targetUi.setDefaultSettings(); + targetUi.setLayout(); } diff --git a/src/gui/nmcgui/nmcfolderwizardsourcepage.cpp b/src/gui/nmcgui/nmcfolderwizardsourcepage.cpp index c3e413f5e13f5..4589d2ac49cbc 100644 --- a/src/gui/nmcgui/nmcfolderwizardsourcepage.cpp +++ b/src/gui/nmcgui/nmcfolderwizardsourcepage.cpp @@ -13,24 +13,49 @@ */ #include "nmcfolderwizardsourcepage.h" - +#include "theme.h" namespace OCC { NMCFolderWizardSourcePage::NMCFolderWizardSourcePage() - :Ui_FolderWizardSourcePage() + :FolderWizardSourcePage() { - setDefaultSettings(); - setLayout(); - setLogic(); + } void NMCFolderWizardSourcePage::setDefaultSettings() { + groupBox->setVisible(false); } void NMCFolderWizardSourcePage::setLayout() { + QLabel *stepLabel = new QLabel(); + stepLabel->setText(QObject::tr("Step 1 from 2: Local Folder")); + stepLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + stepLabel->setStyleSheet("QLabel{color: #E20074}"); + gridLayout_2->setMargin(0); + gridLayout_2->addWidget(stepLabel, 0,0); + QLabel *textLabel = new QLabel(); + textLabel->setText(QObject::tr("Select a folder on your hard drive, that will be connected to your %1 and permanently connected. All files and sub-folders are automatically uploaded and " + "synchronized.").arg(Theme::instance()->appNameGUI())); + textLabel->setWordWrap(true); + textLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + gridLayout_2->addWidget(textLabel, 1,0); + + gridLayout_2->removeWidget(localFolderLineEdit); + localFolderLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + gridLayout_2->addWidget(localFolderLineEdit, 2,0); + + gridLayout_2->removeWidget(localFolderChooseBtn); + localFolderChooseBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + gridLayout_2->addWidget(localFolderChooseBtn, 3,0); + + gridLayout_2->removeWidget(warnLabel); + gridLayout_2->addWidget(warnLabel, 4,0); + + gridLayout_2->removeItem(verticalSpacer); + gridLayout_2->addItem(verticalSpacer, 5,0); } void NMCFolderWizardSourcePage::setLogic() diff --git a/src/gui/nmcgui/nmcfolderwizardsourcepage.h b/src/gui/nmcgui/nmcfolderwizardsourcepage.h index c907d172849e3..157b3edf320a8 100644 --- a/src/gui/nmcgui/nmcfolderwizardsourcepage.h +++ b/src/gui/nmcgui/nmcfolderwizardsourcepage.h @@ -25,7 +25,7 @@ namespace OCC { -class NMCFolderWizardSourcePage : public Ui_FolderWizardSourcePage, public NMCGuiInterface +class NMCFolderWizardSourcePage : public ::Ui::FolderWizardSourcePage, public NMCGuiInterface { public: @@ -33,7 +33,7 @@ class NMCFolderWizardSourcePage : public Ui_FolderWizardSourcePage, public NMCGu ~NMCFolderWizardSourcePage() = default; // NMCGuiInterface interface -protected: +public: void setDefaultSettings() override; void setLayout() override; void setLogic() override; diff --git a/src/gui/nmcgui/nmcfolderwizardtargetpage.cpp b/src/gui/nmcgui/nmcfolderwizardtargetpage.cpp index ef7e3891fae4d..4179550af361a 100644 --- a/src/gui/nmcgui/nmcfolderwizardtargetpage.cpp +++ b/src/gui/nmcgui/nmcfolderwizardtargetpage.cpp @@ -12,25 +12,64 @@ * for more details. */ #include "nmcfolderwizardtargetpage.h" - +#include "theme.h" namespace OCC { NMCFolderWizardTargetPage::NMCFolderWizardTargetPage() - :Ui_FolderWizardTargetPage() + :Ui::FolderWizardTargetPage() { - setDefaultSettings(); - setLayout(); - setLogic(); } void NMCFolderWizardTargetPage::setDefaultSettings() { + folderEntry->setVisible(false); + warnFrame->setVisible(false); + groupBox->setVisible(false); } void NMCFolderWizardTargetPage::setLayout() { + gridLayout_6->setMargin(0); + + QLabel *stepLabel = new QLabel(); + stepLabel->setText(QObject::tr("Step 2 from 2: Directory in your CLOUD")); + stepLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + stepLabel->setStyleSheet("QLabel{color: #E20074}"); + + gridLayout_6->addWidget(stepLabel, 0,0); + + QLabel *textLabel1 = new QLabel(); + textLabel1->setText(QObject::tr("Both folders are permanently linked, the respective contents are automatically compared and updated.") + .arg(Theme::instance()->appNameGUI())); + textLabel1->setWordWrap(true); + textLabel1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + gridLayout_6->addWidget(textLabel1, 1,0); + + QLabel *textLabel2 = new QLabel(); + textLabel2->setText(QObject::tr("Please select or create a target folder in your %1, where the content will be uploaded and synchronized.") + .arg(Theme::instance()->appNameGUI())); + textLabel2->setWordWrap(true); + textLabel2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + gridLayout_6->addWidget(textLabel2, 2,0); + + gridLayout_6->removeWidget(folderTreeWidget); + gridLayout_6->addWidget(folderTreeWidget, 3,0); + + QHBoxLayout *hLayout = new QHBoxLayout(); + gridLayout_6->removeWidget(refreshButton); + gridLayout_6->removeWidget(addFolderButton); + refreshButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + hLayout->addWidget(refreshButton); + addFolderButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + hLayout->addWidget(addFolderButton); + QSpacerItem *spacer = new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Fixed); + hLayout->addSpacerItem(spacer); + gridLayout_6->addLayout(hLayout, 4,0); + + gridLayout_6->removeWidget(warnFrame); + gridLayout_6->addWidget(warnFrame, 5,0); } void NMCFolderWizardTargetPage::setLogic() diff --git a/src/gui/nmcgui/nmcfolderwizardtargetpage.h b/src/gui/nmcgui/nmcfolderwizardtargetpage.h index 90cbd413e6aa8..164b2037e0e3e 100644 --- a/src/gui/nmcgui/nmcfolderwizardtargetpage.h +++ b/src/gui/nmcgui/nmcfolderwizardtargetpage.h @@ -25,7 +25,7 @@ namespace OCC { -class NMCFolderWizardTargetPage : public Ui_FolderWizardTargetPage, public NMCGuiInterface +class NMCFolderWizardTargetPage : public ::Ui::FolderWizardTargetPage, public NMCGuiInterface { public: @@ -33,7 +33,6 @@ class NMCFolderWizardTargetPage : public Ui_FolderWizardTargetPage, public NMCGu ~NMCFolderWizardTargetPage() = default; // NMCGuiInterface interface -protected: void setDefaultSettings() override final; void setLayout() override final; void setLogic() override final; diff --git a/src/gui/nmcgui/nmcgeneralsettings.h b/src/gui/nmcgui/nmcgeneralsettings.h index bb2443a4b8266..2b7158919bfed 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.h +++ b/src/gui/nmcgui/nmcgeneralsettings.h @@ -16,7 +16,7 @@ #define MIRALL_GENERALSETTINGSMAGENTA_H #include "nmcguiinterface.h" -#include +#include "generalsettings.h" namespace OCC { diff --git a/src/gui/nmcgui/nmcnetworksettings.h b/src/gui/nmcgui/nmcnetworksettings.h index d8294227d38ae..299f46bca2a41 100644 --- a/src/gui/nmcgui/nmcnetworksettings.h +++ b/src/gui/nmcgui/nmcnetworksettings.h @@ -16,7 +16,7 @@ #define MIRALL_NETWORKSETTINGSMAGENTA_H #include "nmcguiinterface.h" -#include +#include "networksettings.h" namespace OCC {