コード例 #1
0
void dlgConfigurationShowModal(void)
{
  PrepareConfigurationDialog();

  wf->ShowModal();

  /* save page number for next time this dialog is opened */
  current_page = wTabMenu->GetLastContentPage();

  // TODO enhancement: implement a cancel button that skips all this
  // below after exit.
  bool changed = false;
  bool requirerestart = false;
  wTabMenu->Save(changed, requirerestart);

  if (changed) {
    Profile::Save();
    LogDebug(_T("Configuration: Changes saved"));
    if (requirerestart)
      MessageBoxX(_("Changes to configuration saved.  Restart XCSoar to apply changes."),
                  _T(""), MB_OK);
  }

  delete wf;
  wf = NULL;
}
コード例 #2
0
void dlgConfigurationShowModal()
{
  PrepareConfigurationDialog();

  wf->ShowModal();

  if (wf->IsDefined())
    Save();

  delete wf;
  wf = NULL;
}
コード例 #3
0
ファイル: dlgConfiguration.cpp プロジェクト: Mrdini/XCSoar
void dlgConfigurationShowModal(void)
{
  PrepareConfigurationDialog();

  if (wf->ShowModal() != mrOK) {
    delete wf;
    return;
  }

  /* save page number for next time this dialog is opened */
  current_page = (config_page)configuration_tabbed->GetCurrentPage();

  // TODO enhancement: implement a cancel button that skips all this
  // below after exit.
  bool changed = false;
  bool requirerestart = false;
  changed |= PagesConfigPanel::Save();
  changed |= PolarConfigPanel::Save();
  changed |= LoggerConfigPanel::Save();
  changed |= DevicesConfigPanel::Save(requirerestart);
  changed |= AirspaceConfigPanel::Save(requirerestart);
  changed |= SiteConfigPanel::Save();
  changed |= MapDisplayConfigPanel::Save();
  changed |= WayPointDisplayConfigPanel::Save();
  changed |= SymbolsConfigPanel::Save();
  changed |= TerrainDisplayConfigPanel::Save();
  changed |= GlideComputerConfigPanel::Save(requirerestart);
  changed |= SafetyFactorsConfigPanel::Save();
  changed |= RouteConfigPanel::Save();
  changed |= InterfaceConfigPanel::Save(requirerestart);
  changed |= LayoutConfigPanel::Save(requirerestart);
  changed |= GaugesConfigPanel::Save();
  changed |= TaskRulesConfigPanel::Save();
  changed |= TaskDefaultsConfigPanel::Save();
  changed |= InfoBoxesConfigPanel::Save(requirerestart);
  changed |= ExperimentalConfigPanel::Save(requirerestart);
  // Units need to be saved last to prevent
  // conversion problems with other values
  changed |= UnitsConfigPanel::Save();

  if (changed) {
    Profile::Save();
    LogDebug(_T("Configuration: Changes saved"));
    if (requirerestart)
      MessageBoxX(_("Changes to configuration saved.  Restart XCSoar to apply changes."),
                  _T(""), MB_OK);
  }

  delete wf;
  wf = NULL;
}
コード例 #4
0
void dlgConfigurationShowModal()
{
  PrepareConfigurationDialog();

  dialog->ShowModal();

  if (dialog->IsDefined()) {
    /* hide the dialog, to avoid redraws inside Save() on a dialog
       that has already been deregistered from the SingleWindow */
    dialog->Hide();

    Save();
  }

  /* destroy the TabMenuControl first, to have a well-defined
     destruction order; this is necessary because some config panels
     refer to buttons belonging to the dialog */
  tab_menu->Destroy();

  delete dialog;
  dialog = NULL;
}