void TrackingConfigPanel::SetEnabled(bool enabled) { SetRowEnabled(TrackingInterval, enabled); SetRowEnabled(TrackingVehicleType, enabled); SetRowEnabled(LT24Server, enabled); SetRowEnabled(LT24Username, enabled); SetRowEnabled(LT24Password, enabled); }
void TrackingConfigPanel::SetSkyLinesEnabled(bool enabled) { SetRowEnabled(SL_INTERVAL, enabled); #ifdef HAVE_SKYLINES_TRACKING_HANDLER SetRowEnabled(SL_TRAFFIC_ENABLED, enabled); #endif SetRowEnabled(SL_KEY, enabled); }
void TrackingConfigPanel::SetSkyLinesEnabled(bool enabled) { #ifdef HAVE_NET_STATE_ROAMING SetRowEnabled(SL_ROAMING, enabled); #endif SetRowEnabled(SL_INTERVAL, enabled); SetRowEnabled(SL_TRAFFIC_ENABLED, enabled); SetRowEnabled(SL_NEAR_TRAFFIC_ENABLED, enabled && GetValueBoolean(SL_TRAFFIC_ENABLED)); SetRowEnabled(SL_KEY, enabled); }
void SystemWidget::Prepare(ContainerWindow &parent, const PixelRect &rc) { AddButton("Reboot", *this, REBOOT); AddButton(IsKoboOTGKernel() ? "Disable USB-OTG" : "Enable USB-OTG", *this, SWITCH_KERNEL); AddButton("Export USB storage", *this, USB_STORAGE); SetRowEnabled(USB_STORAGE, !IsKoboOTGKernel()); }
void LineSectorZoneEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc) { ObservationZoneEditWidget::Prepare(parent, rc); AddFloat(_("Gate width"), _("Width of the start/finish gate."), _T("%.1f %s"), _T("%.1f"), 0.1, 200, 1, true, UnitGroup::DISTANCE, GetObject().GetLength(), this); SetRowEnabled(LENGTH, length_editable); }
void CylinderZoneEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc) { ObservationZoneEditWidget::Prepare(parent, rc); AddFloat(_("Radius"), _("Radius of the OZ cylinder."), _T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(200), fixed(1), true, UnitGroup::DISTANCE, GetObject().GetRadius(), this); SetRowEnabled(RADIUS, radius_editable); }
void TaskActionsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc) { AddButton(_("New Task"), *this, NEW_TASK); AddButton(_("Declare"), *this, DECLARE); AddButton(_("Browse"), *this, BROWSE); AddButton(_("Save"), *this, SAVE); if (is_simulator()) /* cannot communicate with real devices in simulator mode */ SetRowEnabled(DECLARE, false); }
void RASPSettingsPanel::UpdateTimeControl() { const DataFieldEnum &item = (const DataFieldEnum &)GetDataField(ITEM); const int item_index = item.GetValue(); SetRowEnabled(TIME, item_index >= 0); if (item_index >= 0) { DataFieldEnum &time_df = (DataFieldEnum &)GetDataField(TIME); time_df.ClearChoices(); time_df.addEnumText(_("Now")); rasp->ForEachTime(item_index, [&time_df](BrokenTime t){ TCHAR timetext[10]; _stprintf(timetext, _T("%02u:%02u"), t.hour, t.minute); time_df.addEnumText(timetext, t.GetMinuteOfDay()); }); if (time.IsPlausible()) time_df.Set(time.GetMinuteOfDay()); GetControl(TIME).RefreshDisplay(); } }
void TrackingConfigPanel::OnModified(DataField &df) { #ifdef HAVE_SKYLINES_TRACKING if (IsDataField(SL_ENABLED, df)) { const DataFieldBoolean &dfb = (const DataFieldBoolean &)df; SetSkyLinesEnabled(dfb.GetAsBoolean()); return; } if (IsDataField(SL_TRAFFIC_ENABLED, df)) { const DataFieldBoolean &dfb = (const DataFieldBoolean &)df; SetRowEnabled(SL_NEAR_TRAFFIC_ENABLED, dfb.GetAsBoolean()); return; } #endif #ifdef HAVE_LIVETRACK24 if (IsDataField(LT24Enabled, df)) { const DataFieldBoolean &dfb = (const DataFieldBoolean &)df; SetEnabled(dfb.GetAsBoolean()); } #endif }