Exemplo n.º 1
0
// Save the current order and enabled state to the ini file
dword AutoStartPage::Backup( ListPage* page, ListItem* item, dword key, dword extKey )
{
	if ( key != RKEY_Ok )
		return key;
	
	array<AutoStartTAP>& taps = ((AutoStartPage*)page)->m_taps;

	DialogBox progress( "Please wait", "Backing up..." );
	progress.OnOpen();

	string backup;
	for ( unsigned int i = 0; i < taps.size(); ++i )
	{
		if ( i > 0 )
			backup += ",";
		string s = taps[i].filename;
		s[taps[i].filename.size()-3] = taps[i].enabled ? 't' : 'n';
		backup += s;
	}

	Options* options = Tapplication::GetTheApplication()->GetOptions();
	IniFile* file = options->GetIniFile();
	if ( file )
	{
		file->SetValue( "Backup", backup );
		options->SaveValues();
	}

	progress.OnClose();

	return 0;
}