diff --git a/src/mirall/folderwizard.cpp b/src/mirall/folderwizard.cpp index 6c80320367..29b0fa6461 100644 --- a/src/mirall/folderwizard.cpp +++ b/src/mirall/folderwizard.cpp @@ -55,9 +55,8 @@ bool FolderWizardSourcePage::isComplete() const bool isOk = selFile.isDir(); if( !isOk ) { - _ui.warnLabel->show(); - _ui.warnLabel->setText(tr("HEHHHAH")); - } + warnString = tr("No local directory selected!"); + } // check if the local directory isn't used yet in another ownCloud sync Folder::Map *map = _folderMap; if( ! map ) return false; @@ -69,7 +68,7 @@ bool FolderWizardSourcePage::isComplete() const qDebug() << "Checking local path: " << f->path() << " <-> " << selFile.absoluteFilePath(); if( QFileInfo( f->path() ) == selFile ) { isOk = false; - warnString = tr("The local path %1 is already a upload folder.
Please pick another one!").arg(selFile.absoluteFilePath()); + warnString.append( tr("The local path %1 is already a upload folder.
Please pick another one!").arg(selFile.absoluteFilePath()) ); } i++; } @@ -127,6 +126,7 @@ void FolderWizardSourcePage::on_localFolderLineEdit_textChanged() FolderWizardTargetPage::FolderWizardTargetPage() { _ui.setupUi(this); + _ui.warnLabel->hide(); registerField("local?", _ui.localFolderRadioBtn); registerField("remote?", _ui.urlFolderRadioBtn); @@ -145,7 +145,7 @@ FolderWizardTargetPage::FolderWizardTargetPage() _ownCloudDirCheck = new ownCloudDirCheck( this ); connect( _ownCloudDirCheck, SIGNAL(directoryExists(QString,bool)), - SLOT(slotInfoReply(QString,bool))); + SLOT(slotDirCheckReply(QString,bool))); } void FolderWizardTargetPage::slotFolderTextChanged( const QString& t) @@ -155,6 +155,7 @@ void FolderWizardTargetPage::slotFolderTextChanged( const QString& t) if( t.isEmpty() ) { _timer->stop(); + _ui.warnLabel->hide(); return; } @@ -168,10 +169,16 @@ void FolderWizardTargetPage::slotTimerFires() _ownCloudDirCheck->checkDirectory( folder ); } -void FolderWizardTargetPage::slotInfoReply(const QString &url, bool exists ) +void FolderWizardTargetPage::slotDirCheckReply(const QString &url, bool exists ) { qDebug() << "Got reply from ownCloudInfo: " << url << " :" << exists; _dirChecked = exists; + if( _dirChecked ) { + _ui.warnLabel->hide(); + } else { + showWarn( tr("The folder is not available on your ownCloud. Please create it.") ); + } + emit completeChanged(); } @@ -230,6 +237,12 @@ void FolderWizardTargetPage::slotNoOwnCloudFound() _ui.OCFolderLineEdit->setEnabled( false ); } +void FolderWizardTargetPage::showWarn( const QString& msg ) +{ + _ui.warnLabel->show(); + _ui.warnLabel->setText( msg ); +} + void FolderWizardTargetPage::on_localFolderRadioBtn_toggled() { slotToggleItems(); diff --git a/src/mirall/folderwizard.h b/src/mirall/folderwizard.h index 4ec1da5bed..59e99f6ac2 100644 --- a/src/mirall/folderwizard.h +++ b/src/mirall/folderwizard.h @@ -84,8 +84,8 @@ protected slots: void slotFolderTextChanged( const QString& ); void slotTimerFires(); - void slotInfoReply( const QString&, bool ); - + void slotDirCheckReply( const QString&, bool ); + void showWarn( const QString& ); private: Ui_FolderWizardTargetPage _ui; QTimer *_timer; diff --git a/src/mirall/folderwizardtargetpage.ui b/src/mirall/folderwizardtargetpage.ui index da40a0862b..eff92a6f2e 100644 --- a/src/mirall/folderwizardtargetpage.ui +++ b/src/mirall/folderwizardtargetpage.ui @@ -7,7 +7,7 @@ 0 0 431 - 292 + 296 @@ -186,6 +186,92 @@ + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 192 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 192 + + + + + + + + + 255 + 255 + 192 + + + + + + + 255 + 255 + 192 + + + + + + + + true + + + QFrame::StyledPanel + + + TextLabel + + + Qt::AutoText + + + Qt::AlignCenter + + + 3 + + + + Qt::Vertical diff --git a/src/mirall/owncloudinfo.cpp b/src/mirall/owncloudinfo.cpp index 162525dd81..84d2e4106b 100644 --- a/src/mirall/owncloudinfo.cpp +++ b/src/mirall/owncloudinfo.cpp @@ -122,8 +122,9 @@ void ownCloudInfo::slotReadyRead() _readBuffer.append(_reply->readAll()); } -void ownCloudInfo::slotError( QNetworkReply::NetworkError ) +void ownCloudInfo::slotError( QNetworkReply::NetworkError err) { + qDebug() << "Network Error: " << err; emit noOwncloudFound(); }