Commit 32d468a0 authored by hrchilds's avatar hrchilds

Update from June 23, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@19 18c085ea-50e0-402c-830e-de6fd14e8384
parent 66336430
......@@ -263,6 +263,50 @@ FileServerList::Initialize()
// GetFileListException can be thrown.
//
// Programmer: Brad Whitlock
// Creation: Mon Jun 23 11:39:11 PDT 2003
//
// Modifications:
//
// ****************************************************************************
void
FileServerList::Notify()
{
//
// Do a silent notify, which does the real work but does not tell the
// observers that anything happened.
//
SilentNotify();
//
// Call the base class's Notify method to tell the observers about
// new information.
//
AttributeSubject::Notify();
// Reset the flags for future operations.
hostFlag = pathFlag = filterFlag = false;
fileListFlag = appliedFileListFlag = false;
fileAction = FILE_NOACTION;
}
// ****************************************************************************
// Method: FileServerList::SilentNotify
//
// Purpose:
// Does some RPC calls to talk to the MetaData server. This can
// update the file list. The subject's observers are then called
// to respond to the changes in the file list. It's done this way
// because of the potentially high cost of RPC's and the observers
// should not have to worry where their file list came from.
//
// Notes:
// This routine can throw exceptions. When SetPath was called before
// this routine, GetFileListException or ChangeDirectoryException
// can be thrown. When SetHost is called before this routine,
// GetFileListException can be thrown.
//
// Programmer: Brad Whitlock
// Creation: Mon Aug 21 14:21:02 PST 2000
//
// Modifications:
......@@ -308,10 +352,13 @@ FileServerList::Initialize()
// Brad Whitlock, Mon Mar 24 14:26:40 PST 2003
// I passed the filter to the server's GetFileList rpc.
//
// Brad Whitlock, Mon Jun 23 11:37:03 PDT 2003
// I renamed the method and removed some code.
//
// ****************************************************************************
void
FileServerList::Notify()
FileServerList::SilentNotify()
{
// Return if there is no mdserver associated with the active host.
ServerMap::iterator pos;
......@@ -459,14 +506,6 @@ FileServerList::Notify()
}
ENDTRY
} while(tryAgain);
// Call the base class's Notify method.
AttributeSubject::Notify();
// Reset the flags for future operations.
hostFlag = pathFlag = filterFlag = false;
fileListFlag = appliedFileListFlag = false;
fileAction = FILE_NOACTION;
}
// ****************************************************************************
......
......@@ -96,6 +96,10 @@ class MessageAttributes;
// Brad Whitlock, Tue May 20 14:56:58 PST 2003
// Changed CreateNode interface.
//
// Brad Whitlock, Mon Jun 23 11:31:14 PDT 2003
// Added SilentNotify so we can execute several RPCs without having to
// tell the observers each time we do something.
//
// ****************************************************************************
class GUI_API FileServerList : public AttributeSubject
......@@ -115,6 +119,7 @@ public:
FileServerList();
virtual ~FileServerList();
virtual void Notify();
void SilentNotify();
void Initialize();
virtual bool CreateNode(DataNode *, bool);
......
#include <stdio.h>
#include <algorithm>
#include <map>
#include <visit-config.h> // To get the version number and splashscreen
#include <qapplication.h>
......@@ -1378,6 +1379,7 @@ QvisGUIApplication::CreateWindows(int orientation)
this, SLOT(ActivatePlotWindow(int)));
connect(mainWin->GetPlotManager(), SIGNAL(activateOperatorWindow(int)),
this, SLOT(ActivateOperatorWindow(int)));
connect(mainWin, SIGNAL(refreshFileList()), this, SLOT(RefreshFileList()));
mainWin->ConnectMessageAttr(&message);
mainWin->ConnectGUIMessageAttributes();
mainWin->ConnectGlobalAttributes(viewer->GetGlobalAttributes());
......@@ -2292,6 +2294,95 @@ QvisGUIApplication::InitializeFileServer(DataNode *guiNode)
ENDTRY
}
// ****************************************************************************
// Method: QvisGUIApplication::RefreshFileList
//
// Purpose:
// This is a Qt slot function that rereads the files in the current directory
// and adds them to the new list of applied files, which are the files that
// appear in the selected files list in the file panel.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Mon Jun 23 10:43:58 PDT 2003
//
// Modifications:
//
// ****************************************************************************
void
QvisGUIApplication::RefreshFileList()
{
// Save the current host and path.
std::string oldHost(fileServer->GetHost());
std::string oldPath(fileServer->GetPath());
//
// Create a list of hosts,paths for which we must get a new list of files.
//
std::map<QualifiedFilename, bool> paths;
const QualifiedFilenameVector &appliedFiles = fileServer->GetAppliedFileList();
int i;
for(i = 0; i < appliedFiles.size(); ++i)
{
QualifiedFilename temp(appliedFiles[i]);
temp.filename = "a";
paths[temp] = true;
}
//
// Reread all of the directories that are in the applied file list.
//
QualifiedFilenameVector refreshedFiles;
std::map<QualifiedFilename, bool>::const_iterator pos;
for(pos = paths.begin(); pos != paths.end(); ++pos)
{
TRY
{
// Reread the current directory.
fileServer->SetHost(pos->first.host);
fileServer->SetPath("");
fileServer->SetPath(pos->first.path);
fileServer->SilentNotify();
// Filter the new list of files add them to the refreshed list.
QualifiedFilenameVector newFiles(fileServer->GetFilteredFileList());
for(i = 0; i < newFiles.size(); ++i)
refreshedFiles.push_back(newFiles[i]);
}
CATCH(VisItException)
{
; // do nothing
}
ENDTRY
}
// Sort the file list before storing it.
std::sort(refreshedFiles.begin(), refreshedFiles.end());
//
// Restore the previous host and path and set the new applied file list.
//
fileServer->SetHost(oldHost);
fileServer->SetPath(oldPath);
fileServer->SetAppliedFileList(refreshedFiles);
fileServer->Notify();
//
// If the open file is in the list of new files and it is a virtual db,
// then reopen it so we pick up new time states.
//
for(i = 0; i < refreshedFiles.size(); ++i)
{
if(refreshedFiles[i].IsVirtual() && refreshedFiles[i] == fileServer->GetOpenFile())
{
viewer->ReOpenDatabase(refreshedFiles[i].FullName().c_str(), false);
break;
}
}
}
// ****************************************************************************
// Method: QvisGUIApplication::LoadFile
//
......
......@@ -196,6 +196,9 @@ typedef std::vector<QvisWindowBase *> WindowBaseVector;
// Brad Whitlock, Mon May 5 14:02:12 PST 2003
// I changed the interface to StartMDServer.
//
// Brad Whitlock, Mon Jun 23 11:42:54 PDT 2003
// I added RefreshFileList.
//
// ****************************************************************************
class GUI_API QvisGUIApplication : public QObject, public ConfigManager, public GUIBase
......@@ -205,6 +208,7 @@ public:
QvisGUIApplication(int &argc, char **argv);
~QvisGUIApplication();
int Exec();
private:
void AddViewerArguments(int argc, char **argv);
void AddViewerSpaceArguments(int orientation);
......@@ -245,6 +249,7 @@ private slots:
void SaveWindow();
void SetPrinterOptions();
void PrintWindow();
void RefreshFileList();
private:
bool viewerIsAlive;
......
......@@ -169,6 +169,9 @@
// Brad Whitlock, Wed May 21 07:43:52 PDT 2003
// I added fullFrame mode to the Windows menu.
//
// Brad Whitlock, Mon Jun 23 10:09:51 PDT 2003
// I added a button to refresh the file list.
//
// ****************************************************************************
QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
......@@ -226,7 +229,8 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
QPopupMenu * file = new QPopupMenu( this );
menuBar()->insertItem( tr("&File"), file );
file->insertItem(openIcon, tr("Select &file . . ."), this, SIGNAL(activateFileWindow()), CTRL+Key_F );
file->insertItem(tr("File &information . . ."), this, SIGNAL(activateFileInformationWindow()), CTRL+Key_I);
file->insertItem( tr("Refresh file list"), this, SIGNAL(refreshFileList()), CTRL+Key_R);
file->insertItem( tr("File &information . . ."), this, SIGNAL(activateFileInformationWindow()), CTRL+Key_I);
file->insertItem( tr("Compute &engines . . ."), this, SIGNAL(activateEngineWindow()), CTRL+Key_E);
file->insertSeparator();
file->insertItem(saveIcon, tr("&Save window"), this, SIGNAL(saveWindow()), CTRL+Key_S );
......
......@@ -90,6 +90,9 @@ class WindowInformation;
// Brad Whitlock, Wed May 21 07:42:22 PDT 2003
// I added fullFrame.
//
// Brad Whitlock, Mon Jun 23 10:14:54 PDT 2003
// I added refreshFileList.
//
// ****************************************************************************
class GUI_API QvisMainWindow : public QvisWindowBase, public SimpleObserver
......@@ -152,6 +155,7 @@ signals:
void saveMovie();
void printWindow();
void refreshFileList();
public slots:
void unreadOutput(bool);
protected:
......
......@@ -128,6 +128,9 @@ QvisOperatorWindow::GetCurrentValues(int)
// Brad Whitlock, Wed Jun 26 15:28:08 PST 2002
// Made the operator prompt window only pop up if there are plots.
//
// Jeremy Meredith, Mon Jun 23 16:18:29 PDT 2003
// Changed GetAllID to GetEnabledID.
//
// ****************************************************************************
void
......@@ -167,7 +170,7 @@ QvisOperatorWindow::SetOperatorOptions()
// Create a prompt for the user.
std::string opName(opMgr->GetPluginName(
opMgr->GetAllID(operatorType)));
opMgr->GetEnabledID(operatorType)));
QString msg;
msg.sprintf("No %s operator was found for the selected plots.\n"
"Do you want to apply the %s operator?\n\n",
......
......@@ -1615,6 +1615,9 @@ ViewerPlotList::SetPlotVar(const char *variable)
// Eric Brugger, Mon Nov 18 07:50:16 PST 2002
// I added support for keyframing.
//
// Jeremy Meredith, Mon Jun 23 16:17:42 PDT 2003
// Changed GetAllID to GetEnabledID.
//
// ****************************************************************************
void
......@@ -1650,11 +1653,11 @@ ViewerPlotList::SetPlotAtts(const int plotType)
PlotPluginManager *pMgr = PlotPluginManager::Instance();
std::string msg;
msg = std::string("VisIt cannot set the ") +
pMgr->GetPluginName(pMgr->GetAllID(plotType)) +
pMgr->GetPluginName(pMgr->GetEnabledID(plotType)) +
std::string(" plot attributes since no"
" plots of that type are selected."
" Please select a ") +
pMgr->GetPluginName(pMgr->GetAllID(plotType)) +
pMgr->GetPluginName(pMgr->GetEnabledID(plotType)) +
std::string(" plot before trying to modify its plot"
" attributes.");
......
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