Ejemplo n.º 1
0
// Parameters:
//   overwrite - this option forces the current settings to overwrite any existing settings
//      that might be saved to the configured ini/settings folder.
//
// Notes:
//   The overwrite option applies to PCSX2 options only.  Plugin option behavior will depend
//   on the plugins.
//
void AppConfig_OnChangedSettingsFolder( bool overwrite )
{
	PathDefs::GetDocuments().Mkdir();
	GetSettingsFolder().Mkdir();

	const wxString iniFilename( GetUiSettingsFilename() );

	if( overwrite )
	{
		if( wxFileExists( iniFilename ) && !wxRemoveFile( iniFilename ) )
			throw Exception::AccessDenied(iniFilename)
				.SetBothMsgs(pxL("Failed to overwrite existing settings file; permission was denied."));

		const wxString vmIniFilename( GetVmSettingsFilename() );

		if( wxFileExists( vmIniFilename ) && !wxRemoveFile( vmIniFilename ) )
			throw Exception::AccessDenied(vmIniFilename)
				.SetBothMsgs(pxL("Failed to overwrite existing settings file; permission was denied."));
	}

	// Bind into wxConfigBase to allow wx to use our config internally, and delete whatever
	// comes out (cleans up prev config, if one).
	delete wxConfigBase::Set( OpenFileConfig( iniFilename ) );
	GetAppConfig()->SetRecordDefaults(true);

	if( !overwrite )
		AppLoadSettings();

	AppApplySettings();
	AppSaveSettings();//Make sure both ini files are created if needed.
}
Ejemplo n.º 2
0
ff::INativeHostControl *ff::ClrStartup(StringRef versionOrAssembly)
{
	// Use my own empty config file
	ComPtr<IDataFile> configFile;
	assertRetVal(GetAppConfig(&configFile), false);

	return ClrStartup(configFile->GetPath(), versionOrAssembly);
}
Ejemplo n.º 3
0
 /// Constructor - initialize variables
 Simulation::Simulation( const IrrHandles& irr )
     : mIrr(irr)
     , mMaxId(kFirstSimId)
     , mFrameDelay(GetAppConfig().FrameDelay)
 {
     // initialize entity types
     for (size_t i = 0; i < sizeof(uint32_t); ++i)
     {
         SimEntitySet entitites;
         mEntityTypes[1 << i] = entitites;
     }
 }
Ejemplo n.º 4
0
// ³ÌÐò³õʼ»¯
int CAppBase::Init(HINSTANCE hInstance)
{
	int result = 0;
	GAppHandle = this;
	GetAppConfig();
	
	m_pTANGEngine = new TANGEngine(hInstance);



	result = InitWindow(hInstance);
	if (E_FAILED == result)
	{
		return E_FAILED;
	}
	result = m_pTANGEngine->Init(m_hWnd, NULL, m_iScreenWidth, m_iScreenHeight, 0, true);

	if (E_FAILED == result)
	{
		return E_FAILED;
	}

	return E_SUCCESS;
}
Ejemplo n.º 5
0
AppIniLoader::AppIniLoader()
	: IniLoader( (GetAppConfig() != NULL) ? *GetAppConfig() : _dud_config )
{
}
Ejemplo n.º 6
0
/****************************************************************
 * 功能描述: 主函数
 * 输入参数: argc-输入的整型入参
             argv-输入的字符型入参
 * 输出参数: 无
 * 返回值: 0-执行成功    -1-执行失败
 * 其它说明:无
 * 修改日期        版本号        修改人      修改内容
 *--------------------------------------------------------------
 * 20141117        V1.0           zzx         新建
 ****************************************************************/
int main(int argc, char*argv[])
{
    char szPathName[1000] = {0};
    int  iPathLen = 0;
    int  iRetVal  = 0;
 
 
    printf("starting...\n");
 
 
    // 先读取全局配置
    iRetVal = GetAppConfig();
    if (iRetVal != 0)
    {
        return -1;
    }   
 
 
    if (4 != argc)
    {
        printf("argc=%d\n", argc);
        rintf("用法: touch.exe 目录名保持天数是否恢复\n例1: touch.exe D:\\work 60 1\n例2: touch.exe \"D:\\w o rk\" 60 0\n");
        eturn -1;
    }
    else
    {
        char szTempPath[1000] = {0};
 
 
        //目录名称
        strncpy(szTempPath, argv[1], sizeof(szTempPath)-1);
        iPathLen = strlen(szTempPath);
        if (iPathLen < 2)
        {
            printf("用法: touch.exe 目录名保持天数是否恢复\n例如: touch.exe D:\\work 600\n");
            return -1;
        }
 
 
        //第一个字符为引号
        if (szTempPath[0] == '"')
        {
            //最后一个不是引号判为非法
            if (szTempPath[iPathLen] != '"')
            {
                printf("第一个参数第一个字符是双引号, 最后一个字符不是双引号.\n");
                printf("用法: touch.exe 目录名保持天数\n例如: touch.exe \"D:\\w o r k\" 60\n");
                return -1;
            }
            else
            {
                //去掉前后引号
                memcpy(szPathName, szTempPath+1,iPathLen-2);
            }
        }
        //盘符
        else if ( ((szTempPath[0] >= 'A') &&(szTempPath[0] <= 'Z')) ||
               ((szTempPath[0] >= 'a') &&(szTempPath[0] <= 'z')) )
        {
            strncpy(szPathName, szTempPath,sizeof(szPathName)-1);
        }
        //第一个字符不是双引号或A~Z判为非法
        else
        {
            printf("第一个参数第一个字符不是双引号或A~Z或a~z\n");
            printf("用法: touch.exe 目录名保持天数\n例如: touch.exe D:\\work 60\n");
            return -1;
        }
    }
 
 
    Check(szPathName);
 
    printf("finished!...\n");
 
 
    return 0;  
}