Browse Source

Add saving to last loaded xml settings file

master
Krisjanis Rijnieks 9 years ago
parent
commit
b86dbe272a
  1. 3
      src/Application/Application.cpp
  2. 2
      src/Application/SettingsLoader.cpp
  3. 4
      src/Application/SettingsLoader.h

3
src/Application/Application.cpp

@ -92,8 +92,7 @@ void Application::onKeyPressed(ofKeyEventArgs & args){
break;
case 's':
_surfaceManager.saveXmlSettings(
PIMAPPER_USER_SURFACES_XML_FILE);
_surfaceManager.saveXmlSettings(SettingsLoader::instance()->getLastLoadedFilename());
break;
case 'z':

2
src/Application/SettingsLoader.cpp

@ -104,6 +104,8 @@ bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, st
xmlSettings->popTag(); // surfaces
}
_lastLoadedFilename = fileName;
return true;
}

4
src/Application/SettingsLoader.h

@ -17,12 +17,16 @@ class SettingsLoader {
bool load(SurfaceStack & surfaces, MediaServer & mediaServer, string fileName);
bool save(SurfaceStack & surfaces, string fileName);
string getLastLoadedFilename(){ return _lastLoadedFilename; };
private:
static SettingsLoader * _instance;
BaseSurface * getTriangleSurface(ofxXmlSettings * xmlSettings);
BaseSurface * getQuadSurface(ofxXmlSettings * xmlSettings);
BaseSurface * getGridWarpSurface(ofxXmlSettings * xmlSettings);
string _lastLoadedFilename;
};
}

Loading…
Cancel
Save