From 3b796886182cec15618c9a93c1edae68226718b2 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Mon, 21 Sep 2015 02:09:51 +0100 Subject: [PATCH] refs #450 A better place for GUI to receive all current core settings upon establishing a connection to core. --- src/swiftgui_standard/swiftguistd.cpp | 16 ++++++++++++++++ src/swiftgui_standard/swiftguistd_init.cpp | 2 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/swiftgui_standard/swiftguistd.cpp b/src/swiftgui_standard/swiftguistd.cpp index 05e13b172..e78b98a3d 100644 --- a/src/swiftgui_standard/swiftguistd.cpp +++ b/src/swiftgui_standard/swiftguistd.cpp @@ -301,6 +301,8 @@ void SwiftGuiStd::ps_handleTimerBasedUpdates() void SwiftGuiStd::setContextAvailability() { + bool corePreviouslyAvailable = this->m_coreAvailable; + if (this->getIContextApplication()->isUsingImplementingObject()) { this->m_coreAvailable = true; @@ -311,6 +313,20 @@ void SwiftGuiStd::setContextAvailability() } this->m_contextNetworkAvailable = this->m_coreAvailable || this->getIContextNetwork()->isUsingImplementingObject(); this->m_contextAudioAvailable = this->m_coreAvailable || this->getIContextAudio()->isUsingImplementingObject(); + + // react to a change in core's availability + if (this->m_coreAvailable != corePreviouslyAvailable) + { + if (this->m_coreAvailable) + { + // core has just become available + this->getIContextApplication()->synchronizeLocalSettings(); + } + else + { + // core has just become unavailable... + } + } } void SwiftGuiStd::updateGuiStatusInformation() diff --git a/src/swiftgui_standard/swiftguistd_init.cpp b/src/swiftgui_standard/swiftguistd_init.cpp index 83c4b410e..786526524 100644 --- a/src/swiftgui_standard/swiftguistd_init.cpp +++ b/src/swiftgui_standard/swiftguistd_init.cpp @@ -211,8 +211,6 @@ void SwiftGuiStd::initGuiSignals() void SwiftGuiStd::initialDataReads() { - this->getIContextApplication()->synchronizeLocalSettings(); - this->setContextAvailability(); if (!this->m_coreAvailable) {