Commit a0721d27 authored by bonnell's avatar bonnell
Browse files

Windows-specific updates: speed startup, write logs/timings files to user...

Windows-specific updates: speed startup, write logs/timings files to user directory, fix printing problem

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@1900 18c085ea-50e0-402c-830e-de6fd14e8384
parent ea3a7ef1
......@@ -878,6 +878,9 @@ static void *threaded_accept_callback(void *data)
// Brad Whitlock, Tue Jan 17 13:43:05 PST 2006
// Added some debug logging.
//
// Kathleen Bonnell, Wed Aug 22 18:00:57 PDT 2007
// Added 'Sleep' command to while-loop to speed up launch on Windows.
//
// ****************************************************************************
int
......@@ -969,6 +972,9 @@ RemoteProcess::MultiThreadedAcceptSocket()
noDescriptor = (cb.desc == -1);
noProcessError = (cb.Errno == 0 && childDied[GetProcessId()] == false);
MUTEX_UNLOCK(cb.mutex);
#ifdef WIN32
Sleep(1);
#endif
}
while(noDescriptor && noProcessError && noCancel);
debug5 << endl;
......
......@@ -55,7 +55,7 @@
#include <DebugStream.h>
#include <TimingsManager.h>
#include <visit-config.h>
static void RemovePrependedDirs(const char *, char *);
static char executableName[256];
......@@ -182,6 +182,10 @@ NewHandler(void)
// Added explicit call to SetFilename for TimingsManager. This is to
// handle cases where TimingsManager may have already been instanced
// before Initialize is called as in the engine.
//
// Kathleen Bonnell, Wed Aug 22 18:00:57 PDT 2007
// On Windows, write timings and log files to User's directory.
//
// ****************************************************************************
void
......@@ -239,6 +243,20 @@ Init::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool sigs)
RemovePrependedDirs(argv[0], progname_wo_dir);
strcpy(executableName, progname_wo_dir);
strcpy(componentName, progname_wo_dir);
#ifdef WIN32
// On windows, we want timings and log files to go in user's directory,
// not install directory, because users may not have write permissions.
const char *home = getenv("VISITUSERHOME");
std::string homedir;
if(home != 0)
{
homedir = std::string(home);
if(homedir[homedir.size() - 1] != SLASH_CHAR)
homedir += SLASH_STRING;
homedir += executableName;
strcpy(progname_wo_dir, homedir.c_str());
}
#endif
char progname[256];
if (n > 1)
{
......@@ -476,6 +494,10 @@ Init::Finalize(void)
// Programmer: Hank Childs
// Creation: August 13, 2001
//
// Modifications:
// Kathleen Bonnell, Wed Aug 22 18:00:57 PDT 2007
// Use SLASH_CHAR.
//
// ****************************************************************************
static void
......@@ -486,7 +508,7 @@ RemovePrependedDirs(const char *path, char *name)
//
int len = strlen(path);
int lastSlash;
for (lastSlash=len ; path[lastSlash]!='/' && lastSlash>=0 ; lastSlash--)
for (lastSlash=len ; path[lastSlash]!=SLASH_CHAR && lastSlash>=0 ; lastSlash--)
{
continue;
}
......@@ -501,7 +523,7 @@ RemovePrependedDirs(const char *path, char *name)
//
//
if (path[lastSlash] == '/')
if (path[lastSlash] == SLASH_CHAR)
{
strcpy(name, path + lastSlash + 1);
}
......
......@@ -5729,6 +5729,9 @@ QvisGUIApplication::SaveWindow()
// I added MacOS X specific coding that lets us handle the setting up of
// the printer options so we can actually print.
//
// Kathleen Bonnell, Wed Aug 22 17:37:06 PDT 2007
// If on WIN32 and user has set print options, tell viewer to PrintWindow.
//
// ****************************************************************************
void
......@@ -5910,6 +5913,15 @@ QvisGUIApplication::SetPrinterOptions()
p->SetCreator(GetViewerProxy()->GetLocalUserName());
printerObserver->SetUpdate(false);
p->Notify();
#ifdef WIN32
//
// Tell the viewer to print the image because the Windows printer
// dialog has the word "Print" to click when you're done setting
// options. This says to me that Windows applications expect to
// print once the options are set.
//
PrintWindow();
#endif
}
#if defined(Q_WS_MACX)
}
......
......@@ -115,6 +115,9 @@ vtkQtImagePrinter::vtkQtImagePrinter() : print()
// Brad Whitlock, Fri May 12 14:49:52 PST 2006
// Check for data == NULL just in case.
//
// Kathleen Bonnell, Wed Aug 22 17:40:34 PDT 2007
// Made scaling of viewport coords specific to WIN32 and QT version 3.0.2.
//
// ****************************************************************************
void
......@@ -207,7 +210,7 @@ vtkQtImagePrinter::WriteFile(ofstream *, vtkImageData *data, int extent[6])
//
int vptX = (metrics.width() - vptW) / 2;
int vptY = (metrics.height() - vptH) / 2;
#if defined(_WIN32)
#if defined(_WIN32) && QT_VERSION == 302
// At this point, I'm not sure whether this is because of Windows
// or because of printing support in Qt 3.0.2. Just make the image's
// viewport larger for now.
......
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