Commit 91e7f3ad authored by fogal1's avatar fogal1

Change "Connect" return type to a boolean.

We'll use it to detect errors in some cases.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@14768 18c085ea-50e0-402c-830e-de6fd14e8384
parent fbb48de0
......@@ -118,14 +118,19 @@ MesaDisplay::Initialize(size_t display, const std::vector<std::string> &user_arg
// Tom Fogal, Wed Apr 22 18:37:35 MDT 2009
// Use `Environment' namespace function instead of `unsetenv' directly.
//
// Tom Fogal, Tue May 25 16:10:10 MDT 2010
// Interface change: retval void -> bool
//
// ****************************************************************************
void
bool
MesaDisplay::Connect()
{
InitVTKRendering::ForceMesa();
Environment::unset("DISPLAY");
return true;
}
// ****************************************************************************
......
......@@ -51,6 +51,11 @@
// Programmer: Tom Fogal
// Creation: September 1, 2008
//
// Modifications:
//
// Tom Fogal, Tue May 25 16:08:23 MDT 2010
// Made connect return a bool.
//
// ****************************************************************************
class ENGINE_MAIN_API MesaDisplay : public VisItDisplay
......@@ -61,7 +66,7 @@ class ENGINE_MAIN_API MesaDisplay : public VisItDisplay
virtual bool Initialize(size_t n,
const std::vector<std::string> &args);
virtual void Connect();
virtual bool Connect();
virtual void Teardown();
};
#endif /* VISIT_MESA_DISPLAY_H */
......@@ -57,6 +57,9 @@
// Tom Fogal, Mon Sep 1 15:11:06 EDT 2008
// Add a method to create the appropriate display type (factory).
//
// Tom Fogal, Tue May 25 16:08:39 MDT 2010
// Made ::Connect return a bool, to detect errors.
//
// ****************************************************************************
class ENGINE_MAIN_API VisItDisplay
......@@ -78,7 +81,7 @@ class ENGINE_MAIN_API VisItDisplay
/// Associates this process with the previously-`Initialize'd VisIt Display.
/// Undefined if this VisItDisplay has not been initialized.
virtual void Connect() = 0;
virtual bool Connect() = 0;
/// Closes down a VisItDisplay. You may assume that this will be called by
/// the destructor. It is safe to call Teardown more than once. It is not
......
......@@ -162,9 +162,12 @@ XDisplay::Initialize(size_t display, const std::vector<std::string> &user_args)
// Tom Fogal, Fri Aug 29 19:19:25 EDT 2008
// Removed a variable that was only useful in debugging.
//
// Tom Fogal, Tue May 25 16:07:27 MDT 2010
// Made it return a bool so we can detect errors.
//
// ****************************************************************************
void
bool
XDisplay::Connect()
{
static char env_display[128];
......@@ -175,11 +178,13 @@ XDisplay::Connect()
if(putenv(env_display) != 0)
{
perror("putenv");
debug1 << "putenv(\"" << env_display << "\") failed." << std::endl;
debug1 << this->hostname << ": putenv(\"" << env_display
<< "\") failed.\n";
}
InitVTKRendering::UnforceMesa();
system("xhost +");
return true;
}
// ****************************************************************************
......
......@@ -56,6 +56,7 @@
//
// Tom Fogal, Tue May 25 15:49:00 MDT 2010
// Add hostname storage, for printing error messages.
// Change ::Connect retval to bool.
//
// ****************************************************************************
......@@ -67,7 +68,7 @@ class ENGINE_MAIN_API XDisplay : public VisItDisplay
virtual bool Initialize(size_t n,
const std::vector<std::string> &args);
virtual void Connect();
virtual bool Connect();
virtual void Teardown();
private:
......
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