void PolycodeIDEApp::saveConfigFile() { Config *config = CoreServices::getInstance()->getConfig(); Object configFile; configFile.root.name = "config"; configFile.root.addChild("open_projects"); configFile.root.addChild("syntax_theme", globalSyntaxTheme->name); for(int i=0; i < projectManager->getProjectCount(); i++) { PolycodeProject *project = projectManager->getProjectByIndex(i); ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project"); projectEntry->addChild("name", project->getProjectName()); projectEntry->addChild("path", project->getProjectFile()); } configFile.root.addChild("settings"); ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor"); textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor")); textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand")); #if defined(__APPLE__) && defined(__MACH__) core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml"); #else core->createFolder(core->getUserHomeDirectory()+"/.polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml"); #endif }
void PolycodeIDEApp::saveConfigFile() { Object configFile; configFile.root.name = "config"; configFile.root.addChild("open_projects"); for(int i=0; i < projectManager->getProjectCount(); i++) { PolycodeProject *project = projectManager->getProjectByIndex(i); ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project"); projectEntry->addChild("name", project->getProjectName()); projectEntry->addChild("path", project->getProjectFile()); } core->createFolder("/Users/ivansafrin/Library/Application Support/Polycode"); configFile.saveToXML("/Users/ivansafrin/Library/Application Support/Polycode/config.xml"); }
void PolycodeIDEApp::saveConfigFile() { Config *config = CoreServices::getInstance()->getConfig(); Object configFile; configFile.root.name = "config"; configFile.root.addChild("open_projects"); configFile.root.addChild("syntax_theme", globalSyntaxTheme->name); configFile.root.addChild("ui_theme", config->getStringValue("Polycode", "uiTheme")); configFile.root.addChild("texture_filtering_mode", config->getStringValue("Polycode", "textureFilteringMode")); configFile.root.addChild("app_width", String::IntToString(core->getXRes())); configFile.root.addChild("app_height", String::IntToString(core->getYRes())); ObjectEntry *consoleEntry = configFile.root.addChild("console"); consoleEntry->addChild("size", frame->getConsoleSize()); consoleEntry->addChild("showing", frame->isShowingConsole()); for(int i=0; i < projectManager->getProjectCount(); i++) { PolycodeProject *project = projectManager->getProjectByIndex(i); ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project"); projectEntry->addChild("is_active", (project == projectManager->getActiveProject())); projectEntry->addChild("name", project->getProjectName()); projectEntry->addChild("path", project->getProjectFile()); ObjectEntry *projectFrameConfig = frame->getFrameConfigForProject(project); if(projectFrameConfig) { projectEntry->addChild(projectFrameConfig); } } configFile.root.addChild("settings"); ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor"); textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor")); textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand")); #if defined(__APPLE__) && defined(__MACH__) core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml"); #else core->createFolder(core->getUserHomeDirectory()+"/.polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml"); #endif }
void PolycodeIDEApp::saveConfigFile() { Object configFile; configFile.root.name = "config"; configFile.root.addChild("open_projects"); configFile.root.addChild("syntax_theme", globalSyntaxTheme->name); for(int i=0; i < projectManager->getProjectCount(); i++) { PolycodeProject *project = projectManager->getProjectByIndex(i); ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project"); projectEntry->addChild("name", project->getProjectName()); projectEntry->addChild("path", project->getProjectFile()); } #if defined(__APPLE__) && defined(__MACH__) core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml"); #else core->createFolder(core->getUserHomeDirectory()+"/.polycode"); configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml"); #endif }