mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
Start integrating user demod label
This commit is contained in:
parent
9c7ff0598c
commit
2f6e83c55e
@ -1864,6 +1864,8 @@ bool AppFrame::loadSession(std::string fileName) {
|
||||
GetStatusBar()->SetStatusText(wxString::Format(wxT("Loaded session file: %s"), currentSessionFile.c_str()));
|
||||
SetTitle(wxString::Format(wxT("%s: %s"), CUBICSDR_TITLE, filePart.c_str()));
|
||||
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,11 @@ BookmarkEntry *BookmarkMgr::demodToBookmarkEntry(DemodulatorInstance *demod) {
|
||||
|
||||
be->bandwidth = demod->getBandwidth();
|
||||
be->type = demod->getDemodulatorType();
|
||||
be->label = demod->getLabel();
|
||||
be->label = demod->getDemodulatorUserLabel();
|
||||
if (be->label == "") {
|
||||
std::string wstr = demod->getLabel();
|
||||
be->label = std::wstring(wstr.begin(),wstr.end());
|
||||
}
|
||||
be->frequency = demod->getFrequency();
|
||||
|
||||
be->node = new DataNode;
|
||||
|
@ -12,7 +12,7 @@ public:
|
||||
std::mutex busy_lock;
|
||||
|
||||
std::string type;
|
||||
std::string label;
|
||||
std::wstring label;
|
||||
|
||||
long long frequency;
|
||||
int bandwidth;
|
||||
|
@ -57,7 +57,7 @@ void DemodLabelDialog::OnChar(wxKeyEvent& event) {
|
||||
else {
|
||||
activeDemod->setDemodulatorUserLabel(L"");
|
||||
}
|
||||
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
Close();
|
||||
break;
|
||||
case WXK_ESCAPE:
|
||||
|
@ -143,7 +143,12 @@ void BookmarkView::doUpdateActiveList() {
|
||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE;
|
||||
tvi->demod = demod_i;
|
||||
|
||||
wxTreeItemId itm = m_treeView->AppendItem(activeBranch,demod_i->getLabel());
|
||||
wxString activeLabel = demod_i->getDemodulatorUserLabel();
|
||||
if (activeLabel == "") {
|
||||
activeLabel = demod_i->getLabel();
|
||||
}
|
||||
|
||||
wxTreeItemId itm = m_treeView->AppendItem(activeBranch,activeLabel);
|
||||
m_treeView->SetItemData(itm, tvi);
|
||||
|
||||
if (activeDemodulator) {
|
||||
@ -310,7 +315,7 @@ void BookmarkView::activeSelection(DemodulatorInstance *dsel) {
|
||||
m_frequencyVal->SetLabelText(frequencyToStr(dsel->getFrequency()));
|
||||
m_bandwidthVal->SetLabelText(frequencyToStr(dsel->getBandwidth()));
|
||||
m_modulationVal->SetLabelText(dsel->getDemodulatorType());
|
||||
m_labelText->SetValue(dsel->getLabel());
|
||||
m_labelText->SetValue(dsel->getDemodulatorUserLabel());
|
||||
|
||||
hideProps();
|
||||
|
||||
@ -607,11 +612,15 @@ void BookmarkView::onTreeBeginDrag( wxTreeEvent& event ) {
|
||||
}
|
||||
|
||||
bool bAllow = false;
|
||||
std::string dragItemName;
|
||||
std::wstring dragItemName;
|
||||
|
||||
if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
bAllow = true;
|
||||
dragItemName = tvi->demod->getLabel();
|
||||
dragItemName = tvi->demod->getDemodulatorUserLabel();
|
||||
if (dragItemName == "") {
|
||||
std::string wstr = tvi->demod->getLabel();
|
||||
dragItemName = std::wstring(wstr.begin(),wstr.end());
|
||||
}
|
||||
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
|
||||
bAllow = true;
|
||||
dragItemName = tvi->bookmarkEnt->label;
|
||||
|
Loading…
Reference in New Issue
Block a user