Exemplo n.º 1
0
static bool
LoadProfile()
{
  if (Profile::GetPath().IsNull() &&
      !dlgStartupShowModal())
    return false;

  Profile::Load();
  Profile::Use(Profile::map);

  Units::SetConfig(CommonInterface::GetUISettings().format.units);
  SetUserCoordinateFormat(CommonInterface::GetUISettings().format.coordinate_format);

  return true;
}
Exemplo n.º 2
0
bool
XCSoarInterface::LoadProfile()
{
  if (StringIsEmpty(Profile::GetPath()) &&
      !dlgStartupShowModal())
    return false;

  Profile::Load();
  Profile::Use();

  Units::SetConfig(GetUISettings().units);

#ifdef HAVE_MODEL_TYPE
  global_model_type = GetSystemSettings().model_type;
#endif

  return true;
}
Exemplo n.º 3
0
static bool
LoadProfile()
{
  if (StringIsEmpty(Profile::GetPath()) &&
      !dlgStartupShowModal())
    return false;

  Profile::Load();
  Profile::Use();

  Units::SetConfig(CommonInterface::GetUISettings().units);
  SetUserCoordinateFormat(CommonInterface::GetUISettings().coordinate_format);

#ifdef HAVE_MODEL_TYPE
  global_model_type = CommonInterface::GetSystemSettings().model_type;
#endif

  return true;
}
Exemplo n.º 4
0
void XCSoarInterface::PreloadInitialisation(bool ask) {
  if (ask) {
#ifdef PNA
    CleanRegistry(); // VENTA2-FIX for PNA we can't delete all registries..by now
#endif
  }

  SetToRegistry(TEXT("XCV"), 1);

#ifdef DEBUG_TRANSLATIONS
  ReadLanguageFile();
#endif

  // Registry (early)

  if (ask) {
    Profile::RestoreRegistry();
    Profile::ReadRegistrySettings();

    // CreateProgressDialog(gettext(TEXT("Initialising")));

  } else {
    dlgStartupShowModal();
    Profile::RestoreRegistry();
    Profile::ReadRegistrySettings();

    CreateProgressDialog(gettext(TEXT("Initialising")));
  }

  // Interface (before interface)
  if (!ask) {
#ifndef DEBUG_TRANSLATIONS
    ReadLanguageFile();
#endif
    status_messages.LoadFile();
    InputEvents::readFile();
  }

}
Exemplo n.º 5
0
void PreloadInitialisation(bool ask) {
  LKLanguageReady=false;
  LKReadLanguageFile(szLanguageFile);
  FillDataOptions(); // Load infobox list

  if (ask) {
    // Load default profile and status file: we are at an early stage
    LKProfileResetDefault();
    LKProfileLoad(startAircraftFile);
    LKProfileLoad(startPilotFile);
    LKProfileLoad(startDeviceFile);
    // if DEFAULT PROFILE does not exist, initialize ResetDefaults!
    // This is because LKProfileLoad will do this at its end, normally.
    // Notice: aircraft and pilot files will not be overridden by defaults
    if (!LKProfileLoad(startProfileFile)) {
	LKProfileInitRuntime();
    }

    StatusFileInit();
  } else {
    // We are in the dialog startup phase
    FullScreen();
    short retstartup;
    do {
	retstartup=dlgStartupShowModal();
    } while (retstartup>0);

    if (retstartup<0) return;

    if (_tcscmp(startProfileFile,_T("PROFILE_RESET"))==0) {
	StartupStore(_T(". USER ASKED FOR PROFILE FULL RESET!%s"),NEWLINE);
	DoStatusMessage(gettext(_T("_@M1757_"))); // LK8000 PROFILES RESET
	LKProfileResetDefault();
	LKProfileInitRuntime();
	// Notice: this is also resetting the default Aircraft and Pilot profiles to demo settings
    } else  {
	if (!LKProfileLoad(startPilotFile)) {
		#if TESTBENCH
		StartupStore(_T(". PilotFile RESET to defaults%s"),NEWLINE);
		#endif
	}
	if (!LKProfileLoad(startDeviceFile)) {
		#if TESTBENCH
		StartupStore(_T(". DeviceFile RESET to defaults%s"),NEWLINE);
		#endif
	}
	if (!LKProfileLoad(startAircraftFile)) {
		#if TESTBENCH
		StartupStore(_T(". AircraftFile RESET to defaults%s"),NEWLINE);
		#endif
	}
	LKProfileLoad(startProfileFile); // this is calling adjust and InitRuntime itself
    }

    // LKTOKEN _@M1206_ "Initialising..."
	CreateProgressDialog(gettext(TEXT("_@M1206_"))); 
  }

  // Interface (before interface)
  if (!ask) {
    LKReadLanguageFile(szLanguageFile);
    InputEvents::readFile();
  }
  
  InitCustomHardware();
}
Exemplo n.º 6
0
void PreloadInitialisation(bool ask) {
  LKReadLanguageFile(szLanguageFile);

  if (ask) {
    // Load default profile and status file: we are at an early stage
    LKProfileResetDefault();
    LKProfileLoad(startAircraftFile);
    LKProfileLoad(startPilotFile);
    LKProfileLoad(startDeviceFile);
    LKProfileLoad(startProfileFile);

	LKProfileInitRuntime();
    
  } else {
    // We are in the dialog startup phase
    FullScreen();
    short retstartup;
    do {
	retstartup=dlgStartupShowModal();
    } while (retstartup>0);

    if (retstartup<0) return;

    if (_tcscmp(startProfileFile,_T("PROFILE_RESET"))==0) {
        StartupStore(_T(". USER ASKED FOR PROFILE FULL RESET!%s"),NEWLINE);
        DoStatusMessage(MsgToken(1757)); // LK8000 PROFILES RESET
        LKProfileResetDefault();
	// Notice: this is also resetting the default Aircraft and Pilot profiles to demo settings
    } else  {
        if (!LKProfileLoad(startPilotFile)) {
            #if TESTBENCH
            StartupStore(_T(". PilotFile RESET to defaults%s"),NEWLINE);
            #endif
        }
        if (!LKProfileLoad(startDeviceFile)) {
            #if TESTBENCH
            StartupStore(_T(". DeviceFile RESET to defaults%s"),NEWLINE);
            #endif
        }
        if (!LKProfileLoad(startAircraftFile)) {
            #if TESTBENCH
            StartupStore(_T(". AircraftFile RESET to defaults%s"),NEWLINE);
            #endif
        }
    	if(!LKProfileLoad(startProfileFile)) {
            #if TESTBENCH
            StartupStore(_T(". SystemFile RESET to defaults%s"),NEWLINE);
            #endif
        }
    }
	LKProfileInitRuntime();

    InitLKFonts();
    // We are sure that buttons have been created already
    ButtonLabel::SetFont(MapWindowBoldFont);

    // font change, we need to reset "Messge
    Message::InitFont();

    // LKTOKEN _@M1206_ "Initialising..."
	CreateProgressDialog(MsgToken(1206));
  }

  // Interface (before interface)
  if (!ask) {
    LKReadLanguageFile(szLanguageFile);
    InputEvents::readFile();
  }

  InitCustomHardware();
}