Add slot to handle clicks on folder names.
authorKlaas Freitag <freitag@owncloud.com>
Tue, 1 Sep 2015 13:37:01 +0000 (15:37 +0200)
committerKlaas Freitag <freitag@owncloud.com>
Tue, 27 Oct 2015 16:37:12 +0000 (17:37 +0100)
src/gui/accountsettings.cpp
src/gui/accountsettings.h

index 7a4a0f3c3654b547516af5483e3c7dadec34d48a..363072a7c3b9f6984c8c2bc78a0ee32669fa9c1b 100644 (file)
@@ -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("<a href=\"%1\">%1</a>").arg(folder);
+            msg += p;
+        }
+        ui->selectiveSyncNotification->setText(msg);
         shouldBeVisible = true;
     }
 
index 20b0da24b3f025a441f132038889f36ebc36a46c..4d8ad31af5e1f31403301508e92f52665260bcfb 100644 (file)
@@ -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,