Skip to content

Commit

Permalink
Merge pull request #359 from kliment/driver-selection-dialog-polish
Browse files Browse the repository at this point in the history
Driver selection dialog polish
  • Loading branch information
azonenberg committed May 24, 2021
2 parents 47b49e8 + e534c85 commit b4ec0e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/glscopeclient/InstrumentConnectionDialog.cpp
Expand Up @@ -66,7 +66,8 @@ InstrumentConnectionDialog::InstrumentConnectionDialog()
vector<string> drivers;
Oscilloscope::EnumDrivers(drivers);
for(auto d : drivers)
m_driverBox.append(d);
if(d != "siggen")
m_driverBox.append(d);

m_grid.attach_next_to(m_transportLabel, m_driverLabel, Gtk::POS_BOTTOM, 1, 1);
m_transportLabel.set_text("Transport");
Expand Down Expand Up @@ -118,14 +119,17 @@ bool InstrumentConnectionDialog::ValidateConfig()
return false;
if(m_transportBox.get_active_text() == "")
return false;
if(m_pathEntry.get_text() == "")
if(m_pathEntry.get_text() == "" && m_transportBox.get_active_text() != "null")
return false;

//For now, hard code check of null being legal only with siggen/demo
if(m_transportBox.get_active_text() != "null")
return true;
if( (m_driverBox.get_active_text() == "siggen") || (m_driverBox.get_active_text() == "demo") )
if( (m_driverBox.get_active_text() == "siggen") || (m_driverBox.get_active_text() == "demo") ){
if(m_pathEntry.get_text() == "")
m_pathEntry.set_text("null");
return true;
}

return false;
}
2 changes: 1 addition & 1 deletion src/glscopeclient/main.cpp
Expand Up @@ -228,7 +228,7 @@ int main(int argc, char* argv[])
"\n"
"A driver and transport must always be selected.\n"
"\n"
"The NULL transport is only legal with the \"siggen\" or \"demo\" driver.",
"The NULL transport is only legal with the \"demo\" driver.",
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
Expand Down

0 comments on commit b4ec0e7

Please sign in to comment.