diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 251245c..0dbdb3c 100644 --- a/src/Application/Application.cpp +++ b/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': diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp index 5e67d69..1f4b545 100644 --- a/src/Application/SettingsLoader.cpp +++ b/src/Application/SettingsLoader.cpp @@ -104,6 +104,8 @@ bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, st xmlSettings->popTag(); // surfaces } + _lastLoadedFilename = fileName; + return true; } diff --git a/src/Application/SettingsLoader.h b/src/Application/SettingsLoader.h index 1738c90..a39e087 100644 --- a/src/Application/SettingsLoader.h +++ b/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; }; }