]> Creatis software - clitk.git/blobdiff - vv/vv.cxx
basic GUI state loading/saving functionality
[clitk.git] / vv / vv.cxx
index 981105095d68a80934280b6e332895cc1d42fa9a..f7b95df3139c056667d8bb622df95263a4f25e05 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -168,7 +168,11 @@ int main( int argc, char** argv )
           vtk_log->FlushOn();
           vtk_log->AppendOn();
           vtkOutputWindow::SetInstance(vtk_log);
+        } else if (current == "--state") {
+          window.ReadSavedStateFile(argv[i+1]);
+          i++;
         }
+        
       } else if (parse_mode == P_SEQUENCE) {
         sequence_filenames.push_back(current);
       } else if (parse_mode == P_WINDOW) {
@@ -196,10 +200,13 @@ int main( int argc, char** argv )
     window.ApplyWindowLevelToAllImages();
   }
 
+
+  int ret = app.exec();
+  
 #ifndef _WIN32
   // restoring the locale, just to be clean...
   setlocale(LC_NUMERIC, old_locale.c_str());
 #endif
 
-  return app.exec();
+  return ret;
 }