Crated messagebox for no devices

This commit is contained in:
corne lukken 2015-05-26 15:23:13 +02:00
parent 9b1f6d7b6d
commit daeb2d5a18
3 changed files with 15 additions and 2 deletions

View File

@ -306,7 +306,6 @@ AppFrame::AppFrame() :
}
AppFrame::~AppFrame() {
}
void AppFrame::OnMenu(wxCommandEvent& event) {
@ -688,3 +687,8 @@ bool AppFrame::loadSession(std::string fileName) {
return true;
}
void AppFrame::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

@ -51,12 +51,15 @@ public:
void saveSession(std::string fileName);
bool loadSession(std::string fileName);
void OnMessage(std::string message, std::string title);
private:
void OnMenu(wxCommandEvent& event);
void OnClose(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event);
void OnIdle(wxIdleEvent& event);
ScopeCanvas *scopeCanvas;
SpectrumCanvas *spectrumCanvas;
WaterfallCanvas *waterfallCanvas;

View File

@ -87,13 +87,19 @@ bool CubicSDR::OnInit() {
std::cout << "Chosen: " << devId << std::endl;
sdrThread->setDeviceId(devId);
}
}
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;