Commit 3707716e authored by bonnell's avatar bonnell

Session file fixes on windows, plus fix crash with restore session from multiple sources

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11737 18c085ea-50e0-402c-830e-de6fd14e8384
parent b7604e8d
......@@ -1178,6 +1178,8 @@ HandleConfigFiles(const char *path, void (*cb)(const char *, void *),
char *ini = fd.cFileName + len-4;
char *vses = fd.cFileName + len-5;
char *vsesgui = fd.cFileName + len-5-4;
char *session = fd.cFileName + len-8;
char *sessiongui = fd.cFileName + len-8-4;
if(log != NULL)
{
......@@ -1185,11 +1187,15 @@ HandleConfigFiles(const char *path, void (*cb)(const char *, void *),
if(ini >= fd.cFileName) fprintf(log, "\t\t%s\n", ini);
if(vses >= fd.cFileName) fprintf(log, "\t\t%s\n", vses);
if(vsesgui >= fd.cFileName) fprintf(log, "\t\t%s\n", vsesgui);
if(session >= fd.cFileName) fprintf(log, "\t\t%s\n", session);
if(sessiongui >= fd.cFileName) fprintf(log, "\t\t%s\n", sessiongui);
}
if((ini >= fd.cFileName && _stricmp(ini, ".ini") == 0) ||
(vses >= fd.cFileName && _stricmp(vses, ".vses") == 0) ||
(vsesgui >= fd.cFileName && _stricmp(vsesgui, ".vses.gui") == 0)
(vses >= fd.cFileName && _stricmp(vses, ".vses") == 0) ||
(vsesgui >= fd.cFileName && _stricmp(vsesgui, ".vses.gui") == 0) ||
(session >= fd.cFileName && _stricmp(session, ".session") == 0) ||
(sessiongui >= fd.cFileName && _stricmp(sessiongui, ".session.gui") == 0)
)
{
if(_strnicmp(fd.cFileName, "visit-config", 12) == 0)
......
......@@ -72,7 +72,11 @@ void GlobalAttributes::Init()
createTimeDerivativeExpressions = true;
createVectorMagnitudeExpressions = true;
newPlotsInheritSILRestriction = true;
#ifdef WIN32
userDirForSessionFiles = true;
#else
userDirForSessionFiles = false;
#endif
saveCrashRecoveryFile = true;
applySelection = true;
ignoreExtentsFromDbs = false;
......
Initialization: userDirForSessionFiles
#ifdef WIN32
userDirForSessionFiles = true;
#else
userDirForSessionFiles = false;
#endif
Function: CreateNode
Declaration: virtual bool CreateNode(DataNode *node, bool, bool);
Definition:
......
......@@ -52,7 +52,7 @@
<Field name="newPlotsInheritSILRestriction" label="New plots inherit SIL restriction" type="bool">
true
</Field>
<Field name="userDirForSessionFiles" label="Use the user directory for session files" type="bool">
<Field name="userDirForSessionFiles" label="Use the user directory for session files" type="bool" init="true">
false
</Field>
<Field name="saveCrashRecoveryFile" label="Save a crash recovert file" type="bool">
......
......@@ -4198,16 +4198,16 @@ QvisGUIApplication::SaveSession()
// Brad Whitlock, Tue Apr 8 16:29:55 PDT 2008
// Support for internationalization.
//
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Use '.session' on windows, too. Send sessionDir to getSaveFileName
// instead of '.'
//
// ****************************************************************************
void
QvisGUIApplication::SaveSessionAs()
{
#if defined(_WIN32)
QString sessionExtension(".vses");
#else
QString sessionExtension(".session");
#endif
// Create the name of a VisIt session file to use.
QString defaultFile;
......@@ -4217,7 +4217,7 @@ QvisGUIApplication::SaveSessionAs()
// Get the name of the file that the user saved.
QString sFilter(tr("VisIt session") + QString(" (*") + sessionExtension + ")");
QString fileName = QFileDialog::getSaveFileName(mainWin,tr("Save Session File As"),".", sFilter);
QString fileName = QFileDialog::getSaveFileName(mainWin,tr("Save Session File"), sessionDir.c_str(), sFilter);
// If the user chose to save a file, tell the viewer to write its state
// to that file.
......@@ -4244,17 +4244,15 @@ QvisGUIApplication::SaveSessionAs()
// Creation: Mon May 9 14:57:08 PST 2005
//
// Modifications:
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Use '.session' on windows, too.
//
// ****************************************************************************
QString
QvisGUIApplication::SaveSessionFile(const QString &fileName)
{
#if defined(_WIN32)
QString sessionExtension(".vses");
#else
QString sessionExtension(".session");
#endif
// Force the file to have a .session extension.
QString sessionName(fileName);
......@@ -4474,6 +4472,9 @@ QvisGUIApplication::ReadConfigFile(const char *filename)
// Cyrus Harrison, Mon Feb 4 09:45:22 PST 2008
// Resolved AIX linking error w/ auto std::string to QString conversion.
//
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Search for '.session' on windows. Keep .vses for loading older sessions.
//
// ****************************************************************************
void
......@@ -4483,7 +4484,7 @@ QvisGUIApplication::RestoreSession()
QString s(QFileDialog::getOpenFileName(mainWin,tr("Open VisIt Session File"),
sessionDir.c_str(),
#if defined(_WIN32)
"VisIt session (*.vses)"));
"VisIt session (*.session *.vses)"));
#else
"VisIt session (*.session)"));
#endif
......@@ -4524,6 +4525,9 @@ QvisGUIApplication::RestoreSession()
// Jeremy Meredith, Thu Aug 7 15:39:55 EDT 2008
// Removed unused var.
//
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Search for '.session' on windows. Keep .vses for loading older sessions.
//
// ****************************************************************************
void
......@@ -4533,7 +4537,7 @@ QvisGUIApplication::RestoreSessionWithDifferentSources()
QString s(QFileDialog::getOpenFileName(mainWin,tr("Open VisIt Session File"),
sessionDir.c_str(),
#if defined(_WIN32)
"VisIt session (*.vses)"));
"VisIt session (*.session *.vses)"));
#else
"VisIt session (*.session)"));
#endif
......@@ -7080,6 +7084,9 @@ QvisGUIApplication::updateVisIt()
// Brad Whitlock, Thu Oct 2 14:41:25 PDT 2008
// Qt 4.
//
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Windows sessions now use '.session' extension.
//
// ****************************************************************************
void
......@@ -7096,11 +7103,7 @@ QvisGUIApplication::updateVisItCompleted(const QString &program)
QString visitDir(GetUserVisItDirectory().c_str());
QString fileName(visitDir + "update_version");
#if defined(_WIN32)
fileName += ".vses";
#else
fileName += ".session";
#endif
// Tell the viewer to save a session file.
GetViewerMethods()->ExportEntireState(fileName.toStdString());
......@@ -7747,13 +7750,19 @@ QvisGUIApplication::GetNumMovieFrames()
// Brad Whitlock, Thu Jan 31 10:07:59 PST 2008
// Windows portability.
//
// Kathleen Bonnell, Fri Jun 18 12:10:15 MST 2010
// Cannot assume path separators are stored according to platform specifics.
// Check unix style first. Also don't substitute if idx < 0.
//
// ****************************************************************************
void
QvisGUIApplication::UpdateSessionDir( const std::string &sessionFileName )
{
int idx = sessionFileName.rfind(VISIT_SLASH_STRING);
if ( idx != 0 )
int idx = sessionFileName.rfind("/");
if (idx < 0)
idx = sessionFileName.rfind("\\");
if ( idx > 0 )
sessionDir = sessionFileName.substr( 0, idx+1 );
}
......@@ -8195,6 +8204,8 @@ QvisGUIApplication::InterpreterSync()
// Creation: Thu Jan 31 11:05:37 PST 2008
//
// Modifications:
// Kathleen Bonnell, Fri Jun 18 15:15:11 MST 2010
// Windows sessions now use '.session' extinsion.
//
// ****************************************************************************
......@@ -8203,11 +8214,7 @@ QvisGUIApplication::CrashRecoveryFile() const
{
QString s(GetUserVisItDirectory().c_str());
s += "crash_recovery";
#if defined(_WIN32)
s += ".vses";
#else
s += ".session";
#endif
return s;
}
......
......@@ -175,6 +175,10 @@ QvisSessionSourceChanger::setSources(const stringVector &keys,
// Cyrus Harrison, Tue Jul 1 09:14:16 PDT 2008
// Initial Qt4 Port.
//
// Kathleen Bonnell, Fri Jun 18 15:13:22 MST 2010
// Set useLists' zeroth item to selected, instead of ci'th. Prevents
// a segv in some instances.
//
// ****************************************************************************
void
......@@ -200,7 +204,7 @@ QvisSessionSourceChanger::updateControls(int ci)
{
for(size_t i = 0; i < pos->second.size(); ++i)
useList->addItem(pos->second[i].c_str());
useList->item(ci)->setSelected(true);
useList->item(0)->setSelected(true);
}
}
}
......
......@@ -30,10 +30,14 @@
<li>A bug with parsing bool arguments for Python Filter contract wrappers was resolved.</li>
<li>The PDB reader was enhanced so it provides laserid and rayid variables for laser rays.</li>
<li>By request of an LLNL code team, PDB reader was changed so it no longer exchanges the X/Z axes.</li>
<li>A bug in Restore Session with Sources was fixed so that gui will no longer crash when second (or greater) source is selected.</li>
</ul>
<p><b><font size="4">Enhancements in version 2.0.1</font></b></p>
<ul>
<li>The Boxlib reader now represents the AMR nesting structure in a more efficient manner. Adding plots, changing time slices, etc, should be noticably faster for simulations with large numbers of patch.</li>
<li>Windows installer was improved slightly to play better with Windows 7 / Vista.</li>
<li>Default save location for session files on windows is no longer current directory.</li>
<li>Session files on windows are now saved with '.session' extension for compatibility with *nix platforms. Old sessions with '.vses' extension can still be loaded.</li>
</ul>
<p>Click the following link to view the release notes for the previous version of VisIt: <a href="relnotes2.0.0.html">VisIt 2.0 Release Notes</a>.</p>
</body>
......
......@@ -6183,6 +6183,9 @@ ViewerSubject::ImportEntireStateWithDifferentSources()
// Brad Whitlock, Fri May 9 14:54:53 PDT 2008
// Qt 4.
//
// Kathleen Bonnell, Fri Jun 18 15:11:42 MST 2010
// Use '.session' as extension on windows, too.
//
// ****************************************************************************
void
......@@ -6190,11 +6193,7 @@ ViewerSubject::RemoveCrashRecoveryFile() const
{
QString filename(GetUserVisItDirectory().c_str());
filename += "crash_recovery";
#if defined(_WIN32)
filename += ".vses";
#else
filename += ".session";
#endif
// Remove the viewer's crash recovery file if it exists.
QFile cr(filename);
if(cr.exists())
......
......@@ -1024,6 +1024,8 @@ PyGlobalAttributes_setattr(PyObject *self, char *name, PyObject *args)
Py_DECREF(obj);
Py_DECREF(tuple);
if( obj == NULL)
PyErr_Format(PyExc_RuntimeError, "Unable to set unknown attribute: '%s'", name);
return (obj != NULL) ? 0 : -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment