From 46558d79a59c1f1ce034a447f65d05ef09378b85 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Tue, 1 Sep 2015 15:37:01 +0200 Subject: [PATCH] Add slot to handle clicks on folder names. --- src/gui/accountsettings.cpp | 22 +++++++++++++++++++--- src/gui/accountsettings.h | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 7a4a0f3c3..363072a7c 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -88,6 +88,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) : connect(ui->_folderList, SIGNAL(expanded(QModelIndex)) , this, SLOT(refreshSelectiveSyncStatus())); connect(ui->_folderList, SIGNAL(collapsed(QModelIndex)) , this, SLOT(refreshSelectiveSyncStatus())); + connect(ui->selectiveSyncNotification, SIGNAL(linkActivated(QString)), + this, SLOT(slotLinkActivated(QString))); connect(_model, SIGNAL(suggestExpand(QModelIndex)), ui->_folderList, SLOT(expand(QModelIndex))); connect(_model, SIGNAL(dirtyChanged()), this, SLOT(refreshSelectiveSyncStatus())); refreshSelectiveSyncStatus(); @@ -510,6 +512,12 @@ void AccountSettings::slotAccountStateChanged(int state) } } +void AccountSettings::slotLinkActivated(const QString& link) +{ + qDebug() << "xxxx " << link; +} + + AccountSettings::~AccountSettings() { delete ui; @@ -542,9 +550,17 @@ void AccountSettings::refreshSelectiveSyncStatus() ui->selectiveSyncNotification->setText(QString()); } else { ui->selectiveSyncNotification->setVisible(true); - ui->selectiveSyncNotification->setText( - tr("There are new folders that were not synchronized because they are too big: %1") - .arg(undecidedFolder.join(tr(", ")))); + QString msg = tr("There are new folders that were not synchronized because they are too big: "); + + int cnt = 0; + foreach(auto& folder, undecidedFolder) { + if( cnt++ ) { + msg += QLatin1String(", "); + } + QString p = QString::fromLatin1("%1").arg(folder); + msg += p; + } + ui->selectiveSyncNotification->setText(msg); shouldBeVisible = true; } diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index 20b0da24b..4d8ad31af 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -82,6 +82,7 @@ protected slots: void slotCustomContextMenuRequested(const QPoint&); void slotFolderListClicked( const QModelIndex& indx ); void doExpand(); + void slotLinkActivated(const QString &link); private: void showConnectionLabel(const QString& message,