261 const std::vector<ConnectionParams*>& connections,
265 : wxGrid(parent, wxID_ANY),
266 m_connections(connections),
267 m_header_column_widths({0, 0, 0, 0, 0, 0, 0}),
268 m_last_tooltip_cell(100),
269 m_cs(GLOBAL_COLOR_SCHEME_DAY),
270 m_on_conn_delete(on_conn_update),
271 m_on_edit_conn(on_edit_conn) {
272 ShowScrollbars(wxSHOW_SB_NEVER, wxSHOW_SB_NEVER);
273 SetTable(
new wxGridStringTable(),
true);
274 GetTable()->AppendCols(8);
277 SetDefaultRowSize(wxWindow::GetCharHeight() * 2);
278 SetColLabelSize(wxWindow::GetCharHeight() * 2);
280 static const std::array<wxString, 7> headers = {
281 "", _(
"Protocol") +
" ", _(
"In/Out"), _(
"Data port"), _(
"Status"),
"",
284 for (
auto hdr = headers.begin(); hdr != headers.end(); hdr++, ic++) {
285 SetColLabelValue(
static_cast<int>(hdr - headers.begin()), *hdr);
286 unsigned col_width = hdr->Length() * wxWindow::GetCharWidth();
287 col_width = wxMax(col_width, 6 * wxWindow::GetCharWidth());
288 m_header_column_widths[ic] =
static_cast<int>(col_width);
289 SetColSize(ic,
static_cast<int>(col_width));
293 SetLabelBackgroundColour(GetGlobalColor(
"DILG1"));
294 SetLabelTextColour(GetGlobalColor(
"DILG3"));
297 SetColAttributes(parent);
301 DisableDragColSize();
302 DisableDragRowSize();
303 wxWindow::Show(GetNumberRows() > 0);
305 GetGridWindow()->Bind(wxEVT_MOTION, [&](wxMouseEvent& ev) {
309 GetGridWindow()->Bind(wxEVT_MOUSEWHEEL,
310 [&](
const wxMouseEvent& ev) {
OnWheel(ev); });
312 Bind(wxEVT_GRID_LABEL_LEFT_CLICK,
313 [&](wxGridEvent& ev) { HandleSort(ev.GetCol()); });
314 Bind(wxEVT_GRID_CELL_LEFT_CLICK,
315 [&](wxGridEvent& ev) { OnClickCell(ev.GetRow(), ev.GetCol()); });
316 Bind(wxEVT_PAINT, [&](wxPaintEvent& ev) {
317 SetColAttributes(
dynamic_cast<const wxWindow*
>(ev.GetEventObject()));
320 Bind(wxEVT_SYS_COLOUR_CHANGED,
321 [&](wxSysColourChangedEvent& ev) { OnColorChange(ev); });
322 conn_change_lstnr.Init(
324 [&](
ObservedEvt&) { OnConnectionChange(m_connections); });
327 void SetColorScheme(
const ColorScheme cs) {
332 void OnColorChange() {
333 auto foreground = wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT);
334 auto background = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
335 SetLabelBackgroundColour(background);
336 SetLabelTextColour(foreground);
337 for (
int row = 0; row <= GetNumberRows(); row++) {
338 for (
unsigned col = 0; col < 7; col++) {
339 SetCellBackgroundColour(row, col, background);
340 SetCellTextColour(row, col, foreground);
345 void OnColorChange(wxSysColourChangedEvent& ev) {
350 wxSize GetEstimatedSize()
const {
352 for (
auto s : m_header_column_widths) rs += s;
353 return {
static_cast<int>(rs), -1};
359 dynamic_cast<wxScrolledWindow*
>(FindWindowByName(TopScrollWindowName));
360 assert(w &&
"No TopScroll window found");
363 w->GetViewStart(&xpos, &ypos);
366 w->GetScrollPixelsPerUnit(&x, &y);
368 const int dir = ev.GetWheelRotation();
369 w->Scroll(-1, ypos - dir / y / 4);
373 void ReloadGrid(
const std::vector<ConnectionParams*>& connections) {
376 for (
auto it = connections.begin(); it != connections.end(); ++it) {
377 const auto row =
static_cast<int>(it - connections.begin());
379 SetCellValue(row, 0, (*it)->is_enabled ?
"1" :
"");
380 if ((*it)->is_enabled)
381 m_tooltips[row][0] = _(
"Enabled, click to disable");
383 m_tooltips[row][0] = _(
"Disabled, click to enable");
384 std::string protocol = NavAddr::BusToString((*it)->GetCommProtocol());
385 SetCellValue(row, 1, protocol);
386 SetCellValue(row, 2, (*it)->GetPortDirectionValueStr());
387 SetCellValue(row, 3, (*it)->GetStrippedDSPort());
388 m_tooltips[row][3] = (*it)->user_comment;
389 SetCellValue(row, 5, UtfGear());
390 m_tooltips[row][5] = _(
"Edit connection");
391 SetCellValue(row, 6, UtfWastebasket());
392 m_tooltips[row][6] = _(
"Delete connection");
393 SetCellValue(row, 7, (*it)->GetKey());
396 wxString sp(protocol);
397 unsigned size = sp.Length() * wxWindow::GetCharWidth();
398 m_header_column_widths[1] = std::max(m_header_column_widths[1], size);
399 size = (*it)->GetPortDirectionValueStr().Length() *
400 wxWindow::GetCharWidth();
401 m_header_column_widths[2] = std::max(m_header_column_widths[2], size);
402 sp = wxString((*it)->GetStrippedDSPort());
403 size = sp.Length() * wxWindow::GetCharWidth();
404 m_header_column_widths[3] = std::max(m_header_column_widths[3], size);
407 OnConnectionChange(m_connections);
412 for (
auto val : m_header_column_widths) {
413 SetColSize(ic,
static_cast<int>(val));
424 : m_conns(connections) {}
429 if (row1 == -1 && row2 == -1)
return false;
430 if (row1 == -1)
return false;
431 if (row2 == -1)
return true;
432 const int v1 = m_conns->GetCellValue(row1, 4)[0];
433 const int v2 = m_conns->GetCellValue(row2, 4)[0];
446 auto found = find_if(
447 m_connections.begin(), m_connections.end(),
449 if (found == m_connections.end())
return -1;
450 return static_cast<int>(found - m_connections.begin());
459 auto found = find_if(m_connections.begin(), m_connections.end(),
461 return GetCellValue(row, 7) == p->GetKey();
463 return found != m_connections.end() ? *found :
nullptr;
470 void EnsureRows(
size_t rows) {
471 for (
unsigned i = m_tooltips.size(); i <= rows; i++)
472 m_tooltips.emplace_back(std::vector<std::string>(7));
473 for (
unsigned i = GetNumberRows(); i <= rows; i++) AppendRows(1,
false);
477 void SetColAttributes(
const wxWindow* parent) {
480 SetDefaultCellBackgroundColour(GetGlobalColor(
"DILG1"));
482 auto enable_attr =
new wxGridCellAttr();
483 enable_attr->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
486 enable_attr->SetRenderer(
489 enable_attr->SetRenderer(
new wxGridCellBoolRenderer());
491 enable_attr->SetEditor(
new wxGridCellBoolEditor());
492 if (IsWindows()) enable_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
493 SetColAttr(0, enable_attr);
495 auto protocol_attr =
new wxGridCellAttr();
496 protocol_attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
497 protocol_attr->SetReadOnly(
true);
499 protocol_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
500 SetColAttr(1, protocol_attr);
502 auto in_out_attr =
new wxGridCellAttr();
503 in_out_attr->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
504 in_out_attr->SetReadOnly(
true);
505 if (IsWindows()) in_out_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
506 SetColAttr(2, in_out_attr);
508 auto port_attr =
new wxGridCellAttr();
509 port_attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
510 port_attr->SetReadOnly(
true);
511 if (IsWindows()) port_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
512 SetColAttr(3, port_attr);
514 auto status_attr =
new wxGridCellAttr();
515 status_attr->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
516 status_attr->SetReadOnly(
true);
517 status_attr->SetFont(parent->GetFont().Scale(1.3));
518 if (IsWindows()) status_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
519 SetColAttr(4, status_attr);
521 auto edit_attr =
new wxGridCellAttr();
522 edit_attr->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
523 edit_attr->SetFont(parent->GetFont().Scale(1.3));
524 edit_attr->SetReadOnly(
true);
525 if (IsWindows()) edit_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
526 SetColAttr(5, edit_attr);
528 auto delete_attr =
new wxGridCellAttr();
529 delete_attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
530 delete_attr->SetFont(parent->GetFont().Scale(1.3));
531 delete_attr->SetTextColour(*wxRED);
532 delete_attr->SetReadOnly(
true);
533 if (IsWindows()) delete_attr->SetBackgroundColour(GetGlobalColor(
"DILG1"));
534 SetColAttr(6, delete_attr);
538 void OnClickCell(
int row,
int col) {
543 }
else if (col == 6) {
549 void OnMouseMove(
const wxMouseEvent& ev) {
550 const wxPoint pt = ev.GetPosition();
551 int row = YToRow(pt.y);
552 int col = XToCol(pt.x);
553 if (col < 0 || col >= 7 || row < 0 || row >= GetNumberRows())
return;
554 if (row * 7 + col == m_last_tooltip_cell)
return;
555 m_last_tooltip_cell = row * 7 + col;
556 GetGridWindow()->SetToolTip(m_tooltips[row][col]);
560 void OnConnectionChange(
const std::vector<ConnectionParams*>& connections) {
561 bool refresh_needed =
false;
562 for (
auto it = connections.begin(); it != connections.end(); ++it) {
563 ConnState state = m_conn_states.GetDriverState(
564 (*it)->GetCommProtocol(), (*it)->GetStrippedDSPort());
565 if (!(*it)->is_enabled) state = ConnState::Disabled;
566 auto row =
static_cast<int>(it - connections.begin());
569 case ConnState::Disabled:
570 SetCellValue(row, 4, UtfFilledCircle());
571 m_tooltips[row][4] = _(
"Disabled");
572 refresh_needed =
true;
574 case ConnState::NoStats:
575 SetCellValue(row, 4, UtfOpenCircle());
576 m_tooltips[row][4] = _(
"No driver statistics available");
577 refresh_needed =
true;
579 case ConnState::NoData:
580 SetCellValue(row, 4,
"!");
581 m_tooltips[row][4] = _(
"No data flowing through connection");
582 refresh_needed =
true;
584 case ConnState::Unavailable:
585 SetCellValue(row, 4,
"X");
586 m_tooltips[row][4] = _(
"The device is unavailable");
587 refresh_needed =
true;
590 SetCellValue(row, 4, UtfCheckMark());
591 m_tooltips[row][4] = _(
"Data is flowing");
592 refresh_needed =
true;
596 if (refresh_needed) ForceRefresh();
600 void SetSortingColumn(
int col) {
601 if (GetSortingColumn() != wxNOT_FOUND) {
602 int old_col = GetSortingColumn();
603 auto label = GetColLabelValue(old_col);
604 if (label[0] == UtfArrowDown()[0])
605 SetColLabelValue(old_col, label.substr(2));
607 auto label = GetColLabelValue(col);
608 if (label[0] != UtfArrowDown()[0])
609 SetColLabelValue(col, UtfArrowDown() +
" " + label);
610 wxGrid::SetSortingColumn(col);
615 void HandleSort(
int col) {
619 std::sort(params.begin(), params.end(),
ConnCompare(col));
621 std::sort(params.begin(), params.end(), ConnStateCompare(
this));
623 SetSortingColumn(col);
627 void HandleEnable(
int row) {
630 cp->is_enabled = !cp->is_enabled;
631 cp->is_setup = FALSE;
632 SetCellValue(row, 0, cp->is_enabled ?
"1" :
"");
634 m_tooltips[row][0] = _(
"Enabled, click to disable");
636 m_tooltips[row][0] = _(
"Disabled, click to enable");
640 m_conn_states.HandleDriverStats(stats);
644 if (!cp->is_enabled) {
645 SetCellValue(row, 4, UtfFilledCircle());
652 void HandleEdit(
int row) {
654 Show(GetNumberRows() > 0);
655 m_on_edit_conn(cp,
true);
660 void HandleDelete(
int row) {
662 auto found = std::find(m_connections.begin(), m_connections.end(), cp);
663 if (found != m_connections.end()) {
664 std::stringstream ss;
665 ss << _(
"Ok to delete connection on ") << (*found)->GetStrippedDSPort();
666 int rcode = OCPNMessageBox(
this, ss.str(), _(
"Delete connection?"),
668 if (rcode != wxID_OK && rcode != wxID_YES)
return;
669 delete (*found)->options_panel;
670 StopAndRemoveCommDriver((*found)->GetStrippedDSPort(),
671 (*found)->GetCommProtocol());
673 if (GetNumberRows() >
static_cast<int>(m_connections.size()))
674 DeleteRows(GetNumberRows() - 1);
675 m_on_conn_delete.
Notify();
679 obs::Listener conn_change_lstnr;
680 std::vector<std::vector<std::string>> m_tooltips;
682 const std::vector<ConnectionParams*>& m_connections;
683 std::array<unsigned, 7> m_header_column_widths;
684 int m_last_tooltip_cell;
797 : wxPanel(parent, wxID_ANY) {
798 auto sizer =
new wxStaticBoxSizer(wxVERTICAL,
this,
"");
799 sizer->Add(
new BearingsCheckbox(
this), wxSizerFlags().Expand());
800 sizer->Add(
new ExtraRmbRmcLine(
this), wxSizerFlags().Expand());
801 sizer->Add(
new NmeaFilterRow(
this), wxSizerFlags().Expand());
802 sizer->Add(
new TalkerIdRow(
this), wxSizerFlags().Expand());
803 sizer->Add(
new NetmaskRow(
this), wxSizerFlags().Expand());
805 wxWindow::SetMaxSize(max_size);
810 class BearingsCheckbox :
public wxCheckBox,
public ApplyCancel {
812 explicit BearingsCheckbox(wxWindow* parent)
813 : wxCheckBox(parent, wxID_ANY,
814 _(
"Use magnetic bearing in output sentence APB")) {
815 wxCheckBox::SetValue(g_bMagneticAPB);
818 void Apply()
override { g_bMagneticAPB = GetValue(); }
819 void Cancel()
override { SetValue(g_bMagneticAPB); }
822 class ExtraRmbRmcLine :
public wxPanel {
823 class RmbRmcCheckbox :
public wxCheckBox,
public ApplyCancel {
825 explicit RmbRmcCheckbox(wxWindow* parent)
826 : wxCheckBox(parent, wxID_ANY,
827 _(
"Always send RMB and RMC NMEA0183 data")) {
836 explicit ExtraRmbRmcLine(wxWindow* parent) : wxPanel(parent, wxID_ANY) {
837 auto hbox =
new wxBoxSizer(wxHORIZONTAL);
838 hbox->Add(
new RmbRmcCheckbox(
this), wxSizerFlags().Expand());
839 hbox->Add(1, 1, 1, wxEXPAND);
840 hbox->Add(
new InfoButton(
this, g_btouch, kInfoHeader, kInfo),
841 wxSizerFlags().Border());
847 class ExtraRmbRmcCheckbox final :
public wxCheckBox,
public ApplyCancel {
849 explicit ExtraRmbRmcCheckbox(wxWindow* parent)
850 : wxCheckBox(parent, wxID_ANY,
851 _(
"Always send RMB and RMC NMEA0183 data")) {
860 class NmeaFilterRow :
public wxPanel,
public ApplyCancel {
861 wxCheckBox* checkbox;
862 wxTextCtrl* filter_period;
865 explicit NmeaFilterRow(wxWindow* parent) : wxPanel(parent) {
866 auto hbox =
new wxBoxSizer(wxHORIZONTAL);
867 checkbox =
new wxCheckBox(
869 _(
"Filter NMEA course and speed data. Filter period: "));
870 checkbox->SetValue(g_bfilter_cogsog);
871 hbox->Add(checkbox, wxSizerFlags().Align(wxALIGN_CENTRE));
873 new wxTextCtrl(
this, wxID_ANY,
"", wxDefaultPosition,
874 wxSize(50, 3 * wxWindow::GetCharWidth()), 0);
875 filter_period->SetValue(std::to_string(g_COGFilterSec));
876 hbox->Add(filter_period, wxSizerFlags().Border());
878 NmeaFilterRow::Cancel();
881 void Apply()
override {
882 std::stringstream ss;
883 ss << filter_period->GetValue();
884 ss >> g_COGFilterSec;
885 g_bfilter_cogsog = checkbox->GetValue();
888 void Cancel()
override {
889 std::stringstream ss;
890 ss << g_COGFilterSec;
891 filter_period->SetValue(ss.str());
892 checkbox->SetValue(g_bfilter_cogsog);
897 class TalkerIdRow :
public wxPanel,
public ApplyCancel {
898 wxTextCtrl* text_ctrl;
901 explicit TalkerIdRow(wxWindow* parent) : wxPanel(parent) {
902 auto hbox =
new wxBoxSizer(wxHORIZONTAL);
903 hbox->Add(
new wxStaticText(
this, wxID_ANY, _(
"NMEA 0183 Talker Id: ")),
904 wxSizerFlags().Align(wxALIGN_CENTRE_VERTICAL).Border());
905 text_ctrl =
new wxTextCtrl(
906 this, wxID_ANY,
"", wxDefaultPosition,
907 wxSize(4 * wxWindow::GetCharWidth(), 3 * wxWindow::GetCharWidth()));
908 text_ctrl->SetToolTip(
909 _(
"Enter a two-letter talker ID to override the default ID in NMEA "
910 "sentences generated by OpenCPN (e.g., GP, HC, EC). This affects "
911 "only sentences created by OpenCPN, not those forwarded from other "
913 text_ctrl->SetValue(g_TalkerIdText);
914 hbox->Add(text_ctrl, wxSizerFlags().Border());
916 TalkerIdRow::Cancel();
919 void Apply()
override { g_TalkerIdText = text_ctrl->GetValue(); }
920 void Cancel()
override { text_ctrl->SetValue(g_TalkerIdText); }
924 class NetmaskRow :
public wxPanel,
public ApplyCancel {
926 explicit NetmaskRow(wxWindow* parent)
928 m_spin_ctrl(
new wxSpinCtrl(
this, wxID_ANY)),
929 m_text(
new wxStaticText(
this, wxID_ANY,
"")) {
930 m_spin_ctrl->SetRange(8, 32);
931 auto hbox =
new wxBoxSizer(wxHORIZONTAL);
932 auto flags = wxSizerFlags().Align(wxALIGN_CENTRE_VERTICAL).Border();
933 hbox->Add(
new wxStaticText(
this, wxID_ANY, _(
"Netmask: ")), flags);
934 hbox->Add(m_text, flags);
935 hbox->Add(
new wxStaticText(
this, wxID_ANY, _(
"length (bits): ")), flags);
936 hbox->Add(m_spin_ctrl, flags);
938 NetmaskRow::Cancel();
940 Bind(wxEVT_SPINCTRL, [&](wxSpinEvent&) {
941 m_text->SetLabel(BitsToDottedMask(m_spin_ctrl->GetValue()));
946 void Apply()
override { g_netmask_bits = m_spin_ctrl->GetValue(); }
948 void Cancel()
override {
949 m_spin_ctrl->SetValue(g_netmask_bits);
950 m_text->SetLabel(BitsToDottedMask(m_spin_ctrl->GetValue()));
955 wxSpinCtrl* m_spin_ctrl;
956 wxStaticText* m_text;
963 TopPanel(wxWindow* parent,
const std::vector<ConnectionParams*>& connections,
967 : wxPanel(parent, wxID_ANY),
968 m_evt_add_connection(evt_add_connection),
969 m_connections(connections) {
970 auto vbox =
new wxBoxSizer(wxVERTICAL);
971 auto conn_grid =
new Connections(
this, m_connections, m_evt_add_connection,
973 wxSize panel_max_size(conn_grid->GetEstimatedSize());
974 vbox->AddSpacer(wxWindow::GetCharHeight());
975 auto conn_flags = wxSizerFlags().Border();
976 if (IsAndroid()) conn_flags = wxSizerFlags().Border().Expand();
977 vbox->Add(conn_grid, conn_flags);
979 wxSizerFlags().Border());
980 vbox->Add(0, wxWindow::GetCharHeight());
982 wxSizerFlags().Border(wxLEFT | wxDOWN | wxRIGHT).Expand();
983 m_general_panel =
new GeneralPanel(
this, panel_max_size);
984 vbox->Add(m_general_panel, panel_flags);
986 auto advanced_panel =
new AdvancedPanel(
this, panel_max_size);
987 m_advanced_panel = advanced_panel;
988 auto on_toggle = [&, advanced_panel, vbox](
bool show) {
990 advanced_panel->Show(show);
991 vbox->SetSizeHints(
this);
994 vbox->Add(
new ShowAdvanced(
this, on_toggle), panel_flags);
995 vbox->Add(advanced_panel, panel_flags.ReserveSpaceEvenIfHidden());
998 vbox->SetSizeHints(
this);
1003 auto on_evt_update_connections = [&, conn_grid](
ObservedEvt&) {
1005 conn_grid->Show(conn_grid->GetNumberRows() > 0);
1008 m_add_connection_lstnr.Init(m_evt_add_connection,
1009 on_evt_update_connections);
1010 m_conn_grid = conn_grid;
1013 void SetColorScheme(
const ColorScheme cs)
const {
1014 m_conn_grid->SetColorScheme(cs);
1015 m_general_panel->SetColorScheme(cs);
1017 [[nodiscard]]
Connections* GetConnectionsGrid()
const {
return m_conn_grid; }
1022 const std::vector<ConnectionParams*>& m_connections;
1023 obs::Listener m_add_connection_lstnr;
1032 TopScroll(wxWindow* parent,
const std::vector<ConnectionParams*>& connections,
1034 : wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
1035 wxVSCROLL | wxHSCROLL, TopScrollWindowName) {
1036 ShowScrollbars(wxSHOW_SB_NEVER, wxSHOW_SB_ALWAYS);
1037 auto vbox =
new wxBoxSizer(wxVERTICAL);
1048 new TopPanel(
this, connections, evt_add_connection, on_edit_connection);
1049 vbox->Add(top_panel, wxSizerFlags(1).Expand());
1053 HandleEditFinish(p, new_mode, ok_cancel);
1057 m_edit_panel->SetPropsLabel(_(
"Edit Selected Connection"));
1058 wxWindow*
options = FindWindowByName(
"Options");
1059 assert(
options &&
"Null Options window!");
1064 m_edit_panel->SetSize(
1065 wxSize(
options->GetSize().x,
options->GetSize().y * fraction / 10));
1066 vbox->Add(m_edit_panel, wxSizerFlags(0).Expand());
1067 m_edit_panel->Hide();
1069 SetScrollRate(0, 10);
1070 if (IsAndroid()) SetScrollRate(1, 1);
1072 SetScrollRate(0, 10);
1073 if (IsAndroid()) SetScrollRate(1, 1);
1076 void SetColorScheme(ColorScheme cs)
const {
1077 if (top_panel) top_panel->SetColorScheme(cs);
1081 m_edit_panel->SetPropsLabel(_(
"Edit Selected Connection"));
1082 m_edit_panel->SetNewMode(
false);
1083 m_edit_panel->PreloadControls(p);
1084 m_edit_panel->AddOKCancelButtons();
1089 m_edit_panel->SetPropsLabel(_(
"Configure new connection"));
1090 m_edit_panel->SetDefaultConnectionParams();
1091 m_edit_panel->SetNewMode(
true);
1092 m_edit_panel->AddOKCancelButtons();
1093 m_edit_panel->InitiateNewConnection();
1097 void SwitchToEditor() {
1100 DimeControl(m_edit_panel);
1101 m_edit_panel->Show();
1106 void SwitchToGrid() {
1108 m_edit_panel->Hide();
1124 delete cp_orig->options_panel;
1128 assert(index != -1 &&
"Cannot look up connection index");
1130 cp_edited->is_setup =
false;
1136 if (FindConnectionByIface(cp)) {
1137 wxMessageDialog dialog(
this, kInterfaceExistsMessage,
1138 _(
"Driver creation warning"),
1139 wxOK | wxCENTRE | wxICON_WARNING);
1144 cp->is_setup =
false;
1149 _(
"Unable to create a connection as configured. "
1150 "Connected port or address was missing.");
1151 auto& noteman = NotificationManager::GetInstance();
1152 noteman.AddNotification(NotificationSeverity::kWarning,
1153 msg.ToStdString(), 60);
1157 UpdateDatastreams();
1158 top_panel->m_evt_add_connection.
Notify();
1162 UpdateDatastreams();