Ejemplo n.º 1
0
void
dlgAirspaceShowModal(bool coloredit)
{
  colormode = coloredit;

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  !Layout::landscape ? _T("IDR_XML_AIRSPACE_L") :
                                       _T("IDR_XML_AIRSPACE"));
  assert(wf != NULL);

  wAirspaceList = (WndListFrame*)wf->FindByName(_T("frmAirspaceList"));
  assert(wAirspaceList != NULL);
  wAirspaceList->SetActivateCallback(OnAirspaceListEnter);
  wAirspaceList->SetPaintItemCallback(OnAirspacePaintListItem);
  wAirspaceList->SetLength(AIRSPACECLASSCOUNT);

  changed = false;

  wf->ShowModal();

  // now retrieve back the properties...
  if (changed) {
    if (!colormode && airspace_warnings != NULL) {
      ProtectedAirspaceWarningManager::ExclusiveLease awm(*airspace_warnings);
      awm->set_config(CommonInterface::SetSettingsComputer().airspace.warnings);
    }

    Profile::Save();
    Message::AddMessage(_("Configuration saved"));
  }

  delete wf;
}
Ejemplo n.º 2
0
void
dlgAirspaceShowModal(bool _color_mode)
{
  color_mode = _color_mode;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_AIRSPACE_L") :
                                      _T("IDR_XML_AIRSPACE"));
  assert(wf != NULL);

  airspace_list = (ListControl*)wf->FindByName(_T("frmAirspaceList"));
  assert(airspace_list != NULL);
  airspace_list->SetActivateCallback(OnAirspaceListEnter);
  airspace_list->SetPaintItemCallback(OnAirspacePaintListItem);
  airspace_list->SetLength(AIRSPACECLASSCOUNT);

  changed = false;

  wf->ShowModal();
  delete wf;

  // now retrieve back the properties...
  if (changed) {
    if (!color_mode && glide_computer != NULL) {
      ProtectedAirspaceWarningManager::ExclusiveLease awm(glide_computer->GetAirspaceWarnings());
      awm->SetConfig(CommonInterface::SetComputerSettings().airspace.warnings);
    }

    Profile::Save();
  }
}