aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kampas <martin.kampas@jolla.com>2016-11-05 07:13:56 +0100
committerJuergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-11-22 20:32:11 +0000
commit170e2390948278182257dcc7d91d50ce64cb6e54 (patch)
treea934018b85db094b5d5e086ef8f9bbdec1254972
parent1e7b27baccf861b23d24d6afc0f1f161d6aecd85 (diff)
Bench: Immediately follow tree selection when enabled
Change-Id: I8c5621a61a7a4bd04743a14b74aaabc92b972b88 Reviewed-by: Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>
-rw-r--r--src/bench/hostwidget.cpp10
-rw-r--r--src/bench/hostwidget.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/bench/hostwidget.cpp b/src/bench/hostwidget.cpp
index 0da4f24..b9da0be 100644
--- a/src/bench/hostwidget.cpp
+++ b/src/bench/hostwidget.cpp
@@ -136,7 +136,7 @@ void HostWidget::setHost(Host *host)
connect(host, SIGNAL(yOffsetChanged(int)), this, SLOT(sendYOffset(int)));
connect(host, SIGNAL(rotationChanged(int)), this, SLOT(sendRotation(int)));
connect(host, SIGNAL(followTreeSelectionChanged(bool)),
- m_followTreeSelectionAction, SLOT(setChecked(bool)));
+ this, SLOT(updateFollowTreeSelection(bool)));
connect(m_followTreeSelectionAction, SIGNAL(triggered(bool)), host, SLOT(setFollowTreeSelection(bool)));
}
@@ -219,6 +219,14 @@ void HostWidget::updateOnlineState(bool online)
onDisconnected();
}
+void HostWidget::updateFollowTreeSelection(bool follow)
+{
+ m_followTreeSelectionAction->setChecked(follow);
+
+ if (follow)
+ m_host->setCurrentFile(m_engine->activePath());
+}
+
void HostWidget::connectToServer()
{
qDebug() << "connectToServer";
diff --git a/src/bench/hostwidget.h b/src/bench/hostwidget.h
index 42188e7..b5470e7 100644
--- a/src/bench/hostwidget.h
+++ b/src/bench/hostwidget.h
@@ -71,6 +71,7 @@ private slots:
void updateFile(const QString& file);
void setUpdateFile(const QString& file);
void updateOnlineState(bool online);
+ void updateFollowTreeSelection(bool follow);
void connectToServer();
void connectAndSendFile();