mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-23 12:18:37 -05:00
Remove Bookmark functional
This commit is contained in:
parent
d4fb63cb77
commit
1d1aa515de
@ -39,6 +39,17 @@ void BookmarkMgr::removeBookmark(std::string group, BookmarkEntry *be) {
|
||||
bmData[group].erase(be);
|
||||
}
|
||||
|
||||
void BookmarkMgr::removeBookmark(BookmarkEntry *be) {
|
||||
std::lock_guard < std::mutex > lockData(busy_lock);
|
||||
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
|
||||
|
||||
for (auto &bmd_i : bmData) {
|
||||
if (bmd_i.second.find(be) != bmd_i.second.end()) {
|
||||
bmd_i.second.erase(be);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BookmarkList BookmarkMgr::getBookmarks(std::string group) {
|
||||
std::lock_guard < std::mutex > lock(busy_lock);
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
void addBookmark(std::string group, DemodulatorInstance *demod);
|
||||
void addBookmark(std::string group, BookmarkEntry *be);
|
||||
void removeBookmark(std::string group, BookmarkEntry *be);
|
||||
void removeBookmark(BookmarkEntry *be);
|
||||
|
||||
BookmarkList getBookmarks(std::string group);
|
||||
|
||||
|
@ -470,11 +470,11 @@ void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
||||
if (!tvi) {
|
||||
|
||||
if (itm == bookmarkBranch) {
|
||||
|
||||
bookmarkBranchSelection();
|
||||
} else if (itm == activeBranch) {
|
||||
|
||||
activeBranchSelection();
|
||||
} else if (itm == recentBranch) {
|
||||
|
||||
recentBranchSelection();
|
||||
} else {
|
||||
m_propPanel->Hide();
|
||||
hideProps();
|
||||
@ -539,9 +539,11 @@ void BookmarkView::onBookmarkActive( wxCommandEvent& event ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onBookmarkRecent( wxCommandEvent& event ) {
|
||||
if (bookmarkSel) {
|
||||
wxGetApp().getBookmarkMgr().removeRecent(bookmarkSel);
|
||||
wxGetApp().getBookmarkMgr().addBookmark("Ungrouped", bookmarkSel);
|
||||
if (recentSel) {
|
||||
wxGetApp().getBookmarkMgr().removeRecent(recentSel);
|
||||
wxGetApp().getBookmarkMgr().addBookmark("Ungrouped", recentSel);
|
||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -557,7 +559,11 @@ void BookmarkView::onRemoveActive( wxCommandEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveBookmark( wxCommandEvent& event ) {
|
||||
// todo
|
||||
if (bookmarkSel) {
|
||||
wxGetApp().getBookmarkMgr().removeBookmark(bookmarkSel);
|
||||
bookmarkSel = nullptr;
|
||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user