Skip to content

Commit

Permalink
Live backup
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Nov 25, 2023
1 parent 044d28d commit a99a8a7
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -754,7 +754,7 @@ void AccountSettings::slotAddFolder()

void AccountSettings::slotFolderWizardAccepted()
{
const auto folderWizard = qobject_cast<FolderWizard *>(sender());
const auto folderWizard = qobject_cast<NMCFolderWizard *>(sender());
const auto folderMan = FolderMan::instance();

qCInfo(lcAccountSettings) << "Folder wizard completed";
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 11 additions & 2 deletions src/gui/nmcgui/nmcfolderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down
35 changes: 30 additions & 5 deletions src/gui/nmcgui/nmcfolderwizardsourcepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/gui/nmcgui/nmcfolderwizardsourcepage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

namespace OCC {

class NMCFolderWizardSourcePage : public Ui_FolderWizardSourcePage, public NMCGuiInterface
class NMCFolderWizardSourcePage : public ::Ui::FolderWizardSourcePage, public NMCGuiInterface
{

public:
explicit NMCFolderWizardSourcePage();
~NMCFolderWizardSourcePage() = default;

// NMCGuiInterface interface
protected:
public:
void setDefaultSettings() override;
void setLayout() override;
void setLogic() override;
Expand Down
49 changes: 44 additions & 5 deletions src/gui/nmcgui/nmcfolderwizardtargetpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions src/gui/nmcgui/nmcfolderwizardtargetpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@

namespace OCC {

class NMCFolderWizardTargetPage : public Ui_FolderWizardTargetPage, public NMCGuiInterface
class NMCFolderWizardTargetPage : public ::Ui::FolderWizardTargetPage, public NMCGuiInterface
{

public:
explicit NMCFolderWizardTargetPage();
~NMCFolderWizardTargetPage() = default;

// NMCGuiInterface interface
protected:
void setDefaultSettings() override final;
void setLayout() override final;
void setLogic() override final;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/nmcgui/nmcgeneralsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define MIRALL_GENERALSETTINGSMAGENTA_H

#include "nmcguiinterface.h"
#include <GeneralSettings.h>
#include "generalsettings.h"

namespace OCC {

Expand Down
2 changes: 1 addition & 1 deletion src/gui/nmcgui/nmcnetworksettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define MIRALL_NETWORKSETTINGSMAGENTA_H

#include "nmcguiinterface.h"
#include <NetworkSettings.h>
#include "networksettings.h"

namespace OCC {

Expand Down

0 comments on commit a99a8a7

Please sign in to comment.