Example #1
0
void emFileManModel::LoadChildCommands(CommandNode * parent)
{
	emArray<emString> names;
	emString path;
	int i,l;

	try {
		names=emTryLoadDir(parent->Dir);
	}
	catch (emString errorMessage) {
		emWarning("%s",errorMessage.Get());
	}
	names.Sort(emStdComparer<emString>::Compare);
	for (i=0; i<names.GetCount(); i++) {
		path=emGetChildPath(parent->Dir,names[i]);
		if (!emIsRegularFile(path)) continue;
		if ((l=names[i].GetLen())>0 && names[i][l-1]=='~') continue;
		LoadCommand(parent,path);
	}
	parent->DirCRC=CalcDirCRC(parent->Dir,names);
	parent->Children.Sort(CompareCmds);
}
Example #2
0
void KeyBinder::Load(wxXmlNode* root)
{

    // Erase all of the existing key bindings.

    for (unsigned int i = 0; i < m_commands.size(); ++i)
    {
        m_commands[i]->keys.clear();
    }

    wxXmlNode* node = root->GetChildren();
    while (node != NULL)
    {

        if (node->GetName() == "command")
        {
            LoadCommand(node);
        }

        node = node->GetNext();

    }

}