Commit 61e9a324 authored by whitlocb's avatar whitlocb
Browse files

Various movie fixes


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@3006 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4c2da3c7
......@@ -45,20 +45,20 @@
static const char *Severity_strings[] = {
"Error", "Warning", "Message",
"ErrorClear"};
"ErrorClear", "Information"};
std::string
MessageAttributes::Severity_ToString(MessageAttributes::Severity t)
{
int index = int(t);
if(index < 0 || index >= 4) index = 0;
if(index < 0 || index >= 5) index = 0;
return Severity_strings[index];
}
std::string
MessageAttributes::Severity_ToString(int t)
{
int index = (t < 0 || t >= 4) ? 0 : t;
int index = (t < 0 || t >= 5) ? 0 : t;
return Severity_strings[index];
}
......@@ -66,7 +66,7 @@ bool
MessageAttributes::Severity_FromString(const std::string &s, MessageAttributes::Severity &val)
{
val = MessageAttributes::Error;
for(int i = 0; i < 4; ++i)
for(int i = 0; i < 5; ++i)
{
if(s == Severity_strings[i])
{
......@@ -89,7 +89,7 @@ const char *MessageAttributes::TypeMapFormatString = "si";
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -111,7 +111,7 @@ MessageAttributes::MessageAttributes() :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -135,7 +135,7 @@ MessageAttributes::MessageAttributes(const MessageAttributes &obj) :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -155,7 +155,7 @@ MessageAttributes::~MessageAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -181,7 +181,7 @@ MessageAttributes::operator = (const MessageAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -204,7 +204,7 @@ MessageAttributes::operator == (const MessageAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -225,7 +225,7 @@ MessageAttributes::operator != (const MessageAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -246,7 +246,7 @@ MessageAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -274,7 +274,7 @@ MessageAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -300,7 +300,7 @@ MessageAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -327,7 +327,7 @@ MessageAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -353,7 +353,7 @@ MessageAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -401,7 +401,7 @@ MessageAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forc
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -427,7 +427,7 @@ MessageAttributes::SetFromNode(DataNode *parentNode)
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 4)
if(ival >= 0 && ival < 5)
SetSeverity(Severity(ival));
}
else if(node->GetNodeType() == STRING_NODE)
......@@ -502,7 +502,7 @@ MessageAttributes::SelectText()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -528,7 +528,7 @@ MessageAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -554,7 +554,7 @@ MessageAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -580,7 +580,7 @@ MessageAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......
......@@ -51,7 +51,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 20 09:40:39 PDT 2007
// Creation: Fri Jan 18 14:43:37 PST 2008
//
// Modifications:
//
......@@ -65,7 +65,8 @@ public:
Error,
Warning,
Message,
ErrorClear
ErrorClear,
Information
};
MessageAttributes();
......
......@@ -5,6 +5,7 @@
Warning
Message
ErrorClear
Information
</Enum>
<Field name="text" type="string">""</Field>
<Field name="severity" type="enum" subtype="Severity">Message</Field>
......
......@@ -325,6 +325,43 @@ GUIBase::Message(const QString &msg)
// Write to the log as well.
debug3 << "Message: " << msg.latin1() << endl;
}
// ****************************************************************************
// Method: GUIBase::Information
//
// Purpose:
// This method writes an informative message into the message state
// object. This causes the message to be displayed.
//
// Arguments:
// msg : The text to put in the message.
//
// Programmer: Brad Whitlock
// Creation: Fri Jan 18 14:40:00 PST 2008
//
// Modifications:
//
// ****************************************************************************
void
GUIBase::Information(const QString &msg)
{
if(msgAttr == 0)
return;
if(writeToConsole)
{
cerr << "Message: " << msg.latin1() << endl;
}
else
{
msgAttr->SetText(std::string(msg.latin1()));
msgAttr->SetSeverity(MessageAttributes::Information);
msgAttr->Notify();
}
// Write to the log as well.
debug3 << "Message: " << msg.latin1() << endl;
}
// ****************************************************************************
// Method: GUIBase::Status
......
......@@ -99,6 +99,9 @@ class SimpleObserver;
// Brad Whitlock, Tue Feb 13 09:21:03 PDT 2007
// I added GetViewerMethods and GetViewerState.
//
// Brad Whitlock, Fri Jan 18 14:38:53 PST 2008
// Added Information method.
//
// ****************************************************************************
class GUI_API GUIBase
......@@ -118,6 +121,8 @@ protected:
void Error(const QString &msg);
void Warning(const QString &msg);
void Message(const QString &msg);
// Shows right away, cleared by other message types
void Information(const QString &msg);
void Status(const QString &msg, int milliseconds = 10000);
void ClearStatus();
......
......@@ -1220,6 +1220,10 @@ QvisGUIApplication::Synchronize(int tag)
// Brad Whitlock, Thu Feb 2 18:55:30 PST 2006
// Added a tag to open up the "Save movie" wizard.
//
// Brad Whitlock, Fri Jan 18 16:53:02 PST 2008
// Don't open the file if it's "notset". This prevents an error message when
// opening the GUI from the CLI.
//
// ****************************************************************************
void
......@@ -1238,9 +1242,12 @@ QvisGUIApplication::HandleSynchronize(int val)
else if(val == LOAD_ACTIVESOURCE_TAG)
{
// Check the window information for the active source.
loadFile = QualifiedFilename(GetViewerState()->GetWindowInformation()->
GetActiveSource());
LoadFile(loadFile, false);
if(GetViewerState()->GetWindowInformation()->GetActiveSource() != "notset")
{
loadFile = QualifiedFilename(GetViewerState()->GetWindowInformation()->
GetActiveSource());
LoadFile(loadFile, false);
}
}
else if(val == INTERPRETER_SYNC_TAG)
{
......@@ -7251,6 +7258,10 @@ QvisGUIApplication::SaveMovie()
// Brad Whitlock, Wed Sep 27 14:12:58 PST 2006
// Added support for movie templates and changed how stereo works.
//
// Brad Whitlock, Fri Jan 18 14:14:38 PST 2008
// Changed the code so it uses our Message dialog so users can paste the
// command into another window.
//
// ****************************************************************************
void
......@@ -7443,7 +7454,7 @@ QvisGUIApplication::SaveMovieMain()
if (movieAtts->GetGenerationMethod() == MovieAttributes::NowNewInstance)
{
msg = "VisIt executed ";
msg = "VisIt executed the following command line to begin making your movie:\n\n";
// Fire off "visit -movie" under the covers. Perhaps have some
// stuff to send back progress to this process.
......@@ -7460,13 +7471,16 @@ QvisGUIApplication::SaveMovieMain()
}
else
{
msg = "Execute";
msg = "Execute the following command at the command prompt "
"on your local computer to begin making your movie. "
"All settings, including the number of processors, "
"will be the same as your current VisIt session when "
"you invoke:\n\n";
}
if(!errFlag)
{
// Finish creating the message.
msg += " the following command line to begin making your movie:\n\n";
for(int i = 0; i < args.size(); ++i)
{
msg += args[i].c_str();
......@@ -7475,7 +7489,7 @@ QvisGUIApplication::SaveMovieMain()
// Open a dialog that lists the "visit -movie" command that
// you have to run to make the movie.
QMessageBox::information(mainWin, "VisIt", msg, QMessageBox::Ok);
Information(msg);
}
}
}
......
......@@ -72,12 +72,17 @@
// Brad Whitlock, Mon May 12 13:00:03 PST 2003
// I made the text read only.
//
// Brad Whitlock, Fri Jan 18 16:11:07 PST 2008
// Added preserveInformation, doHide slot, and made the window wider&taller by default.
//
// *************************************************************************************
QvisMessageWindow::QvisMessageWindow(MessageAttributes *msgAttr,
const char *captionString) : QvisWindowBase(captionString),
Observer(msgAttr)
{
preserveInformation = false;
// Create the central widget and the top layout.
QWidget *central = new QWidget( this );
setCentralWidget( central );
......@@ -87,8 +92,9 @@ QvisMessageWindow::QvisMessageWindow(MessageAttributes *msgAttr,
messageText = new QMultiLineEdit( central, "outputText" );
messageText->setWordWrap( QMultiLineEdit::WidgetWidth );
messageText->setReadOnly(true);
messageText->setMinimumWidth(fontMetrics().width("Closed the compute "
"engine on host sunburn.llnl.gov. "));
messageText->setMinimumWidth(3 * fontMetrics().width("Closed the compute "
"engine on host sunburn.llnl.gov. ") / 2);
messageText->setMinimumHeight(8 * fontMetrics().lineSpacing());
severityLabel = new QLabel(messageText, "Message", central, "Severity Label");
QFont f("helvetica", 18);
f.setBold(true);
......@@ -104,7 +110,7 @@ QvisMessageWindow::QvisMessageWindow(MessageAttributes *msgAttr,
QPushButton *dismissButton = new QPushButton("Dismiss", central, "dismiss");
buttonLayout->addStretch(10);
buttonLayout->addWidget(dismissButton);
connect(dismissButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(dismissButton, SIGNAL(clicked()), this, SLOT(doHide()));
}
// *************************************************************************************
......@@ -154,6 +160,12 @@ QvisMessageWindow::~QvisMessageWindow()
// Brad Whitlock, Thu May 11 15:01:21 PST 2006
// Return if the message is ErrorClear.
//
// Brad Whitlock, Fri Jan 18 14:34:55 PST 2008
// Added Information, which is similar to Message but shows the window.
// The Information message is shown until a new information, error, or
// warning message comes in. Incoming "Message" messages do not overwrite
// an Information message while the window is showing.
//
// *************************************************************************************
void
......@@ -177,44 +189,110 @@ QvisMessageWindow::Update(Subject *)
oldSeverity = MessageAttributes::Warning;
else if (oldSeverityLabel == "Message")
oldSeverity = MessageAttributes::Message;
else if (oldSeverityLabel == "Information")
oldSeverity = MessageAttributes::Information;
else
oldSeverity = MessageAttributes::Error;
// set severity to whichever is worse
if (oldSeverity < severity)
severity = oldSeverity;
// If we're not in information mode, append the incoming messages
if(!preserveInformation)
{
// set severity to whichever is worse
if (oldSeverity < severity)
severity = oldSeverity;
// catenate new message onto old
msgText = messageText->text();
QString newMsgText = QString(ma->GetText().c_str());
if (msgText.find(newMsgText) == -1)
// catenate new message onto old
msgText = messageText->text();
QString newMsgText = QString(ma->GetText().c_str());
if (msgText.find(newMsgText) == -1)
{
msgText += "\n\nShortly thereafter, the following occured...\n\n";
msgText += newMsgText;
}
}
else if(severity == MessageAttributes::Information)
{
msgText += "\n\nShortly thereafter, the following occured...\n\n";
msgText += newMsgText;
msgText = ma->GetText().c_str();
preserveInformation = false;
}
else if((severity == MessageAttributes::Error ||
severity == MessageAttributes::Warning) &&
oldSeverity == MessageAttributes::Information)
{
// Incoming Error, Warnings may overwrite Information.
msgText = ma->GetText().c_str();
preserveInformation = false;
}
}
else
{
msgText = QString(ma->GetText().c_str());
// Don't preserve information if a new information message is
// coming in. Also let error, warning override the existing
// information message.
if(preserveInformation &&
(severity == MessageAttributes::Error ||
severity == MessageAttributes::Warning ||
severity == MessageAttributes::Information))
{
preserveInformation = false;
}
}
// Set the severity label text.
if(severity == MessageAttributes::Error)
if(!preserveInformation)
{
show();
qApp->beep();
severityLabel->setText(QString("Error!"));
RestoreCursor();
}
else if(severity == MessageAttributes::Warning)
{
show();
severityLabel->setText(QString("Warning"));
RestoreCursor();
// Set the severity label text.
if(severity == MessageAttributes::Error)
{
show();
qApp->beep();
severityLabel->setText(QString("Error!"));
RestoreCursor();
}
else if(severity == MessageAttributes::Warning)
{
show();
severityLabel->setText(QString("Warning"));
RestoreCursor();
}
else if(severity == MessageAttributes::Message)
severityLabel->setText(QString("Message"));
else if(severity == MessageAttributes::Information)
{
show();
severityLabel->setText(QString("Information"));
RestoreCursor();
preserveInformation = true;
}
// Set the message text.
messageText->setText(msgText);
}
else if(severity == MessageAttributes::Message)
severityLabel->setText(QString("Message"));
}
// ****************************************************************************
// Method: QvisMessageWindow::doHide
//
// Purpose:
// Hides the window and turns off the preserveInformation mode.
//
// Arguments:
//
// Returns:
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Fri Jan 18 15:30:48 PST 2008
//
// Modifications:
//
// ****************************************************************************
// Set the message text.
messageText->setText(msgText);
void
QvisMessageWindow::doHide()
{
preserveInformation = false;
hide();
}
......@@ -59,7 +59,9 @@ class QMultiLineEdit;
// Creation: Wed Aug 30 18:09:22 PST 2000
//
// Modifications:
//
// Brad Whitlock, Fri Jan 18 15:32:51 PST 2008
// Added preserveInformation flag.
//
// *******************************************************************
class GUI_API QvisMessageWindow : public QvisWindowBase, public Observer
......@@ -70,9 +72,12 @@ public:
const char *captionString = 0);
virtual ~QvisMessageWindow();
virtual void Update(Subject *);
private slots:
void doHide();
private:
QLabel *severityLabel;
QMultiLineEdit *messageText;
bool preserveInformation;
};
#endif
......@@ -497,6 +497,9 @@ QvisSaveMovieWizard::showPage(QWidget *page)
// Brad Whitlock, Wed Sep 27 09:46:42 PDT 2006
// Added code to write out the template options file.
//
// Brad Whitlock, Fri Jan 18 16:06:27 PST 2008
// Force the dialog to be raised and to get focus.
//
// ****************************************************************************
int
......@@ -507,6 +510,8 @@ QvisSaveMovieWizard::Exec()
UpdatePageLinking(0);
showPage(page(0));
raise();
setActiveWindow();
// Go through the wizard.
int retval = exec();
......
......@@ -42,10 +42,13 @@ enhancements and bug-fixes that were added to this release.</p>
from the TimeSlider". This functionality allows the user to plot multiple
times from a database of related files, by Right-Clicking on the plot(s) in
the plot list.</li>
<li>VisIt's <b>Save Movie</b> wizard now displays the <i>command to run later</i> in a window that allows you to cut and paste the command to run into a command prompt.</li>
</ul>
<p><b><font size="4">Bugs fixed in version 1.9.0</font></b></p>
<ul>
<li>VisIt's Simulation database reader now supports materials whose material numbers do not begin at zero. Ranges of material numbers where not all numbers are used are also supported now.</li>
<li>VisIt displays an error message about not being able to read a file called "notset" when the GUI is opened from the CLI via the OpenGUI() function.</li>
<li>VisIt's <b>Save Movie</b> wizard does not come to the front when it is activated until the GUI's <b>Main window</b> is clicked on MacOS X.</li>
</ul>
<p>Click the following link to view the release notes for the previous version
of VisIt: <a href="relnotes1.8.0.html">VisIt 1.8 Release Notes</a>.</p>
......
......@@ -48,7 +48,7 @@ package llnl.visit;
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: Wed Mar 14 17:55:00 PST 2007
// Creation: Fri Jan 18 16:37:20 PST 2008
//
// Modifications:
//
......@@ -61,6 +61,7 @@ public class MessageAttributes extends AttributeSubject
public final static int SEVERITY_WARNING = 1;
public final static int SEVERITY_MESSAGE = 2;
public final static int SEVERITY_ERRORCLEAR = 3;
public final static int SEVERITY_INFORMATION = 4;
public MessageAttributes()
......
......@@ -250,13 +250,16 @@ struct AttributesObject
// Added suppression level; 4 means nothing is suppressed; 1 means
// everything is suppressed.
//
// Brad Whitlock, Fri Jan 18 15:00:41 PST 2008
// Added Information printing.
//
class VisItMessageObserver : public Observer
{
public:
VisItMessageObserver(Subject *s) : Observer(s), lastError("")
{
errorFlag = 0;
suppressLevel = 4;
suppressLevel = 4;
};
virtual ~VisItMessageObserver() { };
......@@ -268,8 +271,8 @@ public:
int SetSuppressLevel(int newLevel)
{
int oldLevel = suppressLevel;
suppressLevel = newLevel;