From 94481a672aeb41c0dd8ceabe93a95c364d8170fd Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Tue, 21 Feb 2012 13:26:39 +0100 Subject: [PATCH] button to add a new sync folder added to status dialog. --- src/mirall/application.cpp | 2 ++ src/mirall/statusdialog.cpp | 9 +++++++++ src/mirall/statusdialog.h | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp index 050432048..619302488 100644 --- a/src/mirall/application.cpp +++ b/src/mirall/application.cpp @@ -70,7 +70,9 @@ Application::Application(int argc, char **argv) : _folderWizard = new FolderWizard(); _owncloudSetupWizard = new OwncloudSetupWizard(); + _statusDialog = new StatusDialog( _theme ); + connect( _statusDialog, SIGNAL(addASync()), this, SLOT(slotAddFolder()) ); connect( _statusDialog, SIGNAL(removeFolderAlias( const QString&)), SLOT(slotRemoveFolder(const QString&))); diff --git a/src/mirall/statusdialog.cpp b/src/mirall/statusdialog.cpp index 43dfd3679..293e2d05d 100644 --- a/src/mirall/statusdialog.cpp +++ b/src/mirall/statusdialog.cpp @@ -136,6 +136,7 @@ StatusDialog::StatusDialog( Theme *theme, QWidget *parent) : connect(_ButtonOpenOC, SIGNAL(clicked()), this, SLOT(slotOpenOC())); connect(_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableFolder())); connect(_ButtonInfo, SIGNAL(clicked()), this, SLOT(slotInfoFolder())); + connect(_ButtonAdd, SIGNAL(clicked()), this, SLOT(slotAddSync())); _ButtonOpenOC->setEnabled(false); _ButtonRemove->setEnabled(false); @@ -143,6 +144,7 @@ StatusDialog::StatusDialog( Theme *theme, QWidget *parent) : _ButtonPush->setEnabled(false); _ButtonEnable->setEnabled(false); _ButtonInfo->setEnabled(false); + _ButtonAdd->setEnabled(true); connect(_folderList, SIGNAL(activated(QModelIndex)), SLOT(slotFolderActivated(QModelIndex))); @@ -264,6 +266,12 @@ void StatusDialog::slotInfoFolder() } } +void StatusDialog::slotAddSync() +{ + qDebug() << "Add a sync requested."; + emit addASync(); +} + void StatusDialog::slotOCInfo( const QString& url, const QString& version ) { _OCUrl = url; @@ -276,6 +284,7 @@ void StatusDialog::slotOCInfoFail() { _ocUrlLabel->setText( tr("Failed to connect to ownCloud. Please check configuration!") ); _ButtonOpenOC->setEnabled(false); + _ButtonAdd->setEnabled( false); } void StatusDialog::slotOpenOC() diff --git a/src/mirall/statusdialog.h b/src/mirall/statusdialog.h index 20d8c0a4a..52cd21009 100644 --- a/src/mirall/statusdialog.h +++ b/src/mirall/statusdialog.h @@ -61,6 +61,9 @@ signals: void enableFolderAlias( const QString&, const bool ); void infoFolderAlias( const QString& ); + /* start the add a folder wizard. */ + void addASync(); + public slots: void slotRemoveFolder(); void slotFetchFolder(); @@ -69,6 +72,7 @@ public slots: void slotOpenOC(); void slotEnableFolder(); void slotInfoFolder(); + void slotAddSync(); protected slots: void slotOCInfoFail();