mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 06:04:39 -04:00
Fix #635 Round 2 for Bookmarkview on Windows, should be OK now
This commit is contained in:
@@ -190,7 +190,7 @@ void BookmarkView::onUpdateTimer( wxTimerEvent& /* event */ ) {
|
||||
}
|
||||
}
|
||||
|
||||
bool BookmarkView::skipUserEvents() {
|
||||
bool BookmarkView::skipEvents() {
|
||||
|
||||
return !this->IsShown() || doUpdateActive || doUpdateBookmarks;
|
||||
}
|
||||
@@ -511,6 +511,9 @@ void BookmarkView::doUpdateActiveList() {
|
||||
m_treeView->SelectItem(selItem);
|
||||
}
|
||||
|
||||
// Add an extra refresh, that rebuilds the buttons from sratch.
|
||||
activeSelection(lastActiveDemodulator);
|
||||
|
||||
delete prevSelCopy;
|
||||
}
|
||||
|
||||
@@ -543,10 +546,6 @@ void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
||||
|
||||
void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool searchState = (searchKeywords.size() != 0);
|
||||
|
||||
if (searchState) {
|
||||
@@ -577,10 +576,6 @@ void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
||||
|
||||
void BookmarkView::onTreeExpanded( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool searchState = (searchKeywords.size() != 0);
|
||||
|
||||
if (searchState) {
|
||||
@@ -816,9 +811,12 @@ void BookmarkView::onBookmarkChoice( wxCommandEvent & /* event */ ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
|
||||
|
||||
|
||||
if (dsel == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_frequencyVal->SetLabelText(frequencyToStr(dsel->getFrequency()));
|
||||
m_bandwidthVal->SetLabelText(frequencyToStr(dsel->getBandwidth()));
|
||||
m_modulationVal->SetLabelText(dsel->getDemodulatorType());
|
||||
@@ -1074,6 +1072,10 @@ void BookmarkView::activeBranchSelection() {
|
||||
|
||||
void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
||||
|
||||
if (skipEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wxTreeItemId itm = event.GetItem();
|
||||
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
||||
|
||||
@@ -1119,10 +1121,6 @@ void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
||||
|
||||
void BookmarkView::onTreeSelectChanging( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@@ -1203,6 +1201,7 @@ void BookmarkView::onStartRecording( wxCommandEvent& /* event */ ) {
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
if (!curSel->demod->isRecording() && wxGetApp().getConfig()->verifyRecordingPath()) {
|
||||
curSel->demod->setRecording(true);
|
||||
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
}
|
||||
}
|
||||
@@ -1216,6 +1215,7 @@ void BookmarkView::onStopRecording( wxCommandEvent& /* event */ ) {
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
if (curSel->demod->isRecording()) {
|
||||
curSel->demod->setRecording(false);
|
||||
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
}
|
||||
}
|
||||
@@ -1481,10 +1481,6 @@ void BookmarkView::onTreeEndDrag( wxTreeEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onTreeItemGetTooltip( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ protected:
|
||||
void onActivateRange( wxCommandEvent& event );
|
||||
void onUpdateRange( wxCommandEvent& event );
|
||||
|
||||
bool skipUserEvents();
|
||||
|
||||
bool skipEvents();
|
||||
|
||||
TreeViewItem *itemToTVI(wxTreeItemId item);
|
||||
|
||||
void SetTreeItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
||||
@@ -201,4 +201,5 @@ protected:
|
||||
std::vector<std::wstring> searchKeywords;
|
||||
|
||||
void setStatusText(std::string statusText);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user