| 1173 | } |
| 1174 | |
| 1175 | void BookmarkView::onLabelText( wxCommandEvent& /* event */ ) { |
| 1176 | |
| 1177 | std::wstring newLabel = m_labelText->GetValue().ToStdWstring(); |
| 1178 | TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection()); |
| 1179 | |
| 1180 | if (curSel != nullptr) { |
| 1181 | if (curSel->type == TreeViewItem::Type::TREEVIEW_ITEM_TYPE_ACTIVE) { |
| 1182 | curSel->demod->setDemodulatorUserLabel(newLabel); |
| 1183 | wxGetApp().getBookmarkMgr().updateActiveList(); |
| 1184 | } else if (curSel->type == TreeViewItem::Type::TREEVIEW_ITEM_TYPE_BOOKMARK) { |
| 1185 | curSel->bookmarkEnt->label = m_labelText->GetValue().ToStdWstring(); |
| 1186 | curSel->bookmarkEnt->node->child("user_label")->element()->set(newLabel); |
| 1187 | wxGetApp().getBookmarkMgr().updateBookmarks(); |
| 1188 | } else if (curSel->type == TreeViewItem::Type::TREEVIEW_ITEM_TYPE_RECENT) { |
| 1189 | curSel->bookmarkEnt->label = m_labelText->GetValue().ToStdWstring(); |
| 1190 | curSel->bookmarkEnt->node->child("user_label")->element()->set(newLabel); |
| 1191 | wxGetApp().getBookmarkMgr().updateActiveList(); |
| 1192 | } else if (curSel->type == TreeViewItem::Type::TREEVIEW_ITEM_TYPE_RANGE) { |
| 1193 | curSel->rangeEnt->label = m_labelText->GetValue().ToStdWstring(); |
| 1194 | wxGetApp().getBookmarkMgr().updateActiveList(); |
| 1195 | } else if (curSel->type == TreeViewItem::Type::TREEVIEW_ITEM_TYPE_GROUP) { |
| 1196 | std::string newGroupName = m_labelText->GetValue().ToStdString(); |
| 1197 | |
| 1198 | if (!newGroupName.empty() && newGroupName != curSel->groupName) { |
| 1199 | wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName); |
| 1200 | nextGroup = newGroupName; |
| 1201 | wxGetApp().getBookmarkMgr().updateBookmarks(); |
| 1202 | } |
| 1203 | } |
| 1204 | } |
| 1205 | |
| 1206 | if (!m_treeView->HasFocus()) { m_treeView->SetFocus(); } |
| 1207 | } |
| 1208 | |
| 1209 | |
| 1210 | void BookmarkView::onDoubleClickFreq( wxMouseEvent& /* event */ ) { |
nothing calls this directly
no test coverage detected