made OnMessage a bit cleaner, problably shoudl move to /visual

This commit is contained in:
corne lukken 2015-05-26 16:37:15 +02:00
parent daeb2d5a18
commit 06da0a913c
2 changed files with 11 additions and 9 deletions

View File

@ -81,25 +81,20 @@ bool CubicSDR::OnInit() {
devName.append(" (In Use?)");
}
choices.Add(devName);
}
}
int devId = wxGetSingleChoiceIndex(wxT("Devices"), wxT("Choose Input Device"), choices);
std::cout << "Chosen: " << devId << std::endl;
sdrThread->setDeviceId(devId);
}
} else {
OnMessage("no devices found!", "warning");
}
t_PostSDR = new std::thread(&SDRPostThread::threadMain, sdrPostThread);
t_SDR = new std::thread(&SDRThread::threadMain, sdrThread);
appframe = new AppFrame();
if(devs.size() == 0) {
// appframe->OnMessage("no devices found!", "warning");
wxMessageDialog *message = new wxMessageDialog(NULL, wxT("no devices found"), wxT("warning"), wxOK | wxICON_ERROR );
message->ShowModal();
}
#ifdef __APPLE__
int main_policy;
struct sched_param main_param;
@ -293,3 +288,8 @@ void CubicSDR::setFrequencySnap(int snap) {
int CubicSDR::getFrequencySnap() {
return snap;
}
void CubicSDR::OnMessage(std::string text, std::string title) {
wxMessageDialog *message = new wxMessageDialog(NULL, wxString::Format(text.c_str()), wxString::Format(title.c_str()), wxOK | wxICON_ERROR );
message->ShowModal();
}

View File

@ -62,6 +62,8 @@ public:
void showFrequencyInput();
void OnMessage(std::string message, std::string title);
private:
AppFrame *appframe;
AppConfig config;