Esempio n. 1
0
void C4SDefinitions::SetModules(const char *szList, const char *szRelativeToPath, const char *szRelativeToPath2)
	{
	int32_t cnt;

	// Empty list: local only
	if (!SModuleCount(szList)) 
		{ 
		LocalOnly=TRUE; 
		for (cnt=0; cnt<C4S_MaxDefinitions; cnt++) Definition[cnt][0]=0;
		return;
		}

	// Set list
	LocalOnly=FALSE;
	for (cnt=0; cnt<C4S_MaxDefinitions; cnt++) 
		{
		SGetModule(szList,cnt,Definition[cnt],_MAX_PATH);
		// Make relative path
		if (szRelativeToPath && *szRelativeToPath)
			if (SEqualNoCase(Definition[cnt],szRelativeToPath,SLen(szRelativeToPath)))
				SCopy(Definition[cnt]+SLen(szRelativeToPath),Definition[cnt]);
		if (szRelativeToPath2 && *szRelativeToPath2)
			if (SEqualNoCase(Definition[cnt],szRelativeToPath2,SLen(szRelativeToPath2)))
				SCopy(Definition[cnt]+SLen(szRelativeToPath2),Definition[cnt]);
		}

	}
Esempio n. 2
0
void C4StartupMainDlg::OnSurveyBtn(C4GUI::Control *btn)
{
	int32_t iPlrCount = SModuleCount(Config.General.Participants);
	int32_t plrCount = 1;
	StdStrBuf sError;

	if (iPlrCount == plrCount) {
		C4Startup::Get()->SwitchDialog(C4Startup::SDID_Survey);
	}
	else if (iPlrCount > plrCount) {
		sError.Format(LoadResStr("IDS_DLG_TOOMANY_QUESTIONNAIRE"), plrCount);
		GetScreen()->ShowMessage(sError.getData(), LoadResStr("IDS_MSG_CANNOTSTARTQUESTIONNAIRE"), C4GUI::Ico_Error);
	}
	else if (iPlrCount < plrCount) {
		sError.Format(LoadResStr("IDS_DLG_TOOFEW_QUESTIONNAIRE"), plrCount);
		GetScreen()->ShowMessage(sError.getData(), LoadResStr("IDS_MSG_CANNOTSTARTQUESTIONNAIRE"), C4GUI::Ico_Error);
	}
}
Esempio n. 3
0
void C4SDefinitions::SetModules(const char *szList, const char *szRelativeToPath, const char *szRelativeToPath2)
{
	int32_t cnt;

	// Empty list: local only
	if (!SModuleCount(szList))
	{
		LocalOnly=true;
		for (cnt=0; cnt<C4S_MaxDefinitions; cnt++) Definition[cnt][0]=0;
		return;
	}

	// Set list
	LocalOnly=false;
	for (cnt=0; cnt<C4S_MaxDefinitions; cnt++)
	{
		SGetModule(szList,cnt,Definition[cnt],_MAX_PATH);
		// Make relative path
		if (szRelativeToPath && *szRelativeToPath)
		{
			if (GetRelativePathS(Definition[cnt],szRelativeToPath) != Definition[cnt])
			{
				SCopy(GetRelativePathS(Definition[cnt],szRelativeToPath),Definition[cnt]);
				continue;
			}
		}
		if (szRelativeToPath2 && *szRelativeToPath2)
		{
			if (GetRelativePathS(Definition[cnt],szRelativeToPath2) != Definition[cnt])
			{
				SCopy(GetRelativePathS(Definition[cnt],szRelativeToPath2),Definition[cnt]);
				continue;
			}
		}
	}

}