diff --git a/src/BookmarkMgr.cpp b/src/BookmarkMgr.cpp index 006dafc..bf0411a 100644 --- a/src/BookmarkMgr.cpp +++ b/src/BookmarkMgr.cpp @@ -58,3 +58,11 @@ BookmarkList BookmarkMgr::getBookmarks(std::string group, std::string folder) { return results; } + +void BookmarkMgr::updateActiveList() { + BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView(); + + if (bmv) { + bmv->updateActiveList(); + } +} \ No newline at end of file diff --git a/src/BookmarkMgr.h b/src/BookmarkMgr.h index ff09969..d396f21 100644 --- a/src/BookmarkMgr.h +++ b/src/BookmarkMgr.h @@ -42,6 +42,8 @@ public: void removeBookmark(std::string group, BookmarkEntry *be); BookmarkList getBookmarks(std::string group, std::string folder = ""); + void updateActiveList(); + protected: BookmarkMap bmData; diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index bf3d788..ffe8065 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -80,6 +80,8 @@ DemodulatorInstance::~DemodulatorInstance() { delete pipeIQDemodData; delete threadQueueControl; delete pipeAudioData; + + wxGetApp().getBookmarkMgr().updateActiveList(); } void DemodulatorInstance::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) { @@ -118,6 +120,7 @@ void DemodulatorInstance::run() { active = true; + wxGetApp().getBookmarkMgr().updateActiveList(); } void DemodulatorInstance::updateLabel(long long freq) { @@ -125,6 +128,7 @@ void DemodulatorInstance::updateLabel(long long freq) { newLabel.precision(3); newLabel << std::fixed << ((long double) freq / 1000000.0); setLabel(newLabel.str()); + wxGetApp().getBookmarkMgr().updateActiveList(); } void DemodulatorInstance::terminate() { @@ -227,6 +231,8 @@ void DemodulatorInstance::setActive(bool state) { tracking = false; } active = state; + + wxGetApp().getBookmarkMgr().updateActiveList(); } void DemodulatorInstance::squelchAuto() { @@ -391,6 +397,10 @@ void DemodulatorInstance::setFrequency(long long freq) { wxGetApp().getRigThread()->setFrequency(freq,true); } #endif + + if (this->isActive()) { + wxGetApp().getBookmarkMgr().updateActiveList(); + } } long long DemodulatorInstance::getFrequency() { diff --git a/src/forms/Bookmark/BookmarkView.cpp b/src/forms/Bookmark/BookmarkView.cpp index 7b52abc..3d89511 100644 --- a/src/forms/Bookmark/BookmarkView.cpp +++ b/src/forms/Bookmark/BookmarkView.cpp @@ -4,7 +4,7 @@ BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) { activeBranch = m_treeView->AddRoot("Active"); - doUpdateActive = true; +// doUpdateActive = true; m_updateTimer.Start(500); } @@ -12,7 +12,7 @@ void BookmarkView::onUpdateTimer( wxTimerEvent& event ) { if (doUpdateActive) { doUpdateActiveList(); -// doUpdateActive = false; + doUpdateActive = false; } }