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; break;
case 's': case 's':
_surfaceManager.saveXmlSettings( _surfaceManager.saveXmlSettings(SettingsLoader::instance()->getLastLoadedFilename());
PIMAPPER_USER_SURFACES_XML_FILE);
break; break;
case 'z': case 'z':

2
src/Application/SettingsLoader.cpp

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

4
src/Application/SettingsLoader.h

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

Loading…
Cancel
Save