Пример #1
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();
}
Пример #2
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();
}