Commit 74c9c97c authored by fogal1's avatar fogal1
Browse files

Various Qt updates to set window types.

Seems to help some WMs position/place windows.  These are all
thanks to Andreas Kloeckner, though I made some minor edits.

commit d0d6cf1cf99a4d84420d07c4c943fdc21394cd7d
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:11:21 2010 -0700

    Tell Qt the application name.

    Add two new Qt arguments, to tell Qt the application name.  Patch
    from Andreas Kloeckner (thanks!).

commit 84a8cf571897fac83e72cb32df8b6b192a7f1bc1
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:10:03 2010 -0700

    Tell Qt the window is a splash screen.

    Instead of just a frameless window.  Patch from Andreas Kloeckner.

commit 4d8581e62882afc8a1c40aeaa67b14567ef6ad6d
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:08:52 2010 -0700

    postable window: Set Qt window role.

    Patch from Andreas Kloeckner.

commit 1242d93426147276f800145b8d7e164d33ca67cd
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:07:31 2010 -0700

    Set Qt window role.

    Patch from Andreas Kloeckner.

commit 3b828abcf6977c3a0d12f3f2219d90eb05cd65a5
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:05:11 2010 -0700

    Set Qt window role.

    Patch from Andreas Kloeckner.

commit dc0e320559a7ee05bc6b06732c8aa1947d905eb3
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:03:49 2010 -0700

    Tell Qt the application name.

    Patch from Andreas Kloeckner.

commit e464987e69a95f76f06400edd55d14a2cbefbf40
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Sun Jan 24 17:00:52 2010 -0700

    Set Qt window `file' window role.

    Patch from Andreas Kloeckner.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@9632 18c085ea-50e0-402c-830e-de6fd14e8384
parent b5c99b9b
......@@ -142,13 +142,19 @@ protected:
// Creation: Tue Jul 15 12:05:08 PDT 2008
//
// Modifications:
//
// Tom Fogal, Sun Jan 24 16:54:13 MST 2010
// Apply patch from Andreas Kloeckner to set appropriate window role.
//
// ****************************************************************************
QvisFileWindowBase::QvisFileWindowBase(const QString &winCaption) :
QvisDelayedWindowSimpleObserver(winCaption), intermediateFileList(),
QvisDelayedWindowSimpleObserver(winCaption, Qt::Dialog),
intermediateFileList(),
currentVirtualDatabaseDefinitions(), invalidHosts()
{
setWindowRole("file-window");
fs = 0;
profiles = 0;
......
......@@ -590,6 +590,9 @@ GUI_LogQtMessages(QtMsgType type, const char *msg)
// Brad Whitlock, Tue Apr 8 16:29:55 PDT 2008
// Support for internationalization.
//
// Tom Fogal, Sun Jan 24 17:02:27 MST 2010
// Apply patch from Andreas Kloeckner to tell Qt the application name.
//
// ****************************************************************************
QvisGUIApplication::QvisGUIApplication(int &argc, char **argv) :
......@@ -703,9 +706,8 @@ QvisGUIApplication::QvisGUIApplication(int &argc, char **argv) :
// are setting the initial font through the command line because Qt
// does not want to allow the font to change after qApp is created.
//
// note: JSM 2/1/02 -- should these all be strdup'd ?
qt_argv = new char *[argc + 3];
qt_argc = argc + 2;
qt_argv = new char *[argc + 5];
qt_argc = argc + 4;
for(int i = 0; i < argc; ++i)
{
qt_argv[i] = strdup(argv[i]);
......@@ -714,7 +716,11 @@ QvisGUIApplication::QvisGUIApplication(int &argc, char **argv) :
qt_argv[argc] = strdup("-font");
qt_argv[argc+1] = strdup((char*)GetViewerState()->GetAppearanceAttributes()->
GetFontName().c_str());
qt_argv[argc+2] = NULL;
qt_argv[argc+2] = strdup("-name");
qt_argv[argc+3] = strdup("visit-gui");
qt_argv[argc+4] = NULL;
debug1 << "QvisApplication::QvisApplication: -font " << qt_argv[argc+1] << endl;
qInstallMsgHandler(GUI_LogQtMessages);
mainApp = new QvisApplication(qt_argc, qt_argv);
......
......@@ -327,11 +327,16 @@
// out without the Advanced file menu. Changed default splitter
// sizes depending on if file panel starts hidden or not.
//
// Tom Fogal, Sun Jan 24 17:04:34 MST 2010
// Patch from Andreas Kloeckner to set the Qt window role.
//
// ****************************************************************************
QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
: QvisWindowBase(captionString)
{
setWindowRole("gui-main");
setAttribute(Qt::WA_DeleteOnClose,true);
int id;
QPixmap openIcon, saveIcon, computerIcon, printIcon, rainbowIcon;
......
......@@ -82,12 +82,17 @@
// Brad Whitlock, Fri May 30 14:28:01 PDT 2008
// Qt 4.
//
// Tom Fogal, Sun Jan 24 17:05:48 MST 2010
// Patch from Andreas Kloeckner to set Qt window role.
//
// *************************************************************************************
QvisMessageWindow::QvisMessageWindow(MessageAttributes *msgAttr,
const QString &captionString) : QvisWindowBase(captionString),
const QString &captionString) : QvisWindowBase(captionString, Qt::Dialog),
Observer(msgAttr)
{
setWindowRole("message");
preserveInformation = false;
// Create the central widget and the top layout.
......
......@@ -75,11 +75,18 @@ bool QvisPostableWindow::postEnabled = true;
// Brad Whitlock, Tue Apr 8 15:26:49 PDT 2008
// Support for internationalization.
//
// Tom Fogal, Sun Jan 24 17:08:09 MST 2010
// Patch from Andreas Kloeckner to set appropriate Qt window role.
//
// ****************************************************************************
QvisPostableWindow::QvisPostableWindow(const QString &captionString,
const QString &shortName, QvisNotepadArea *n) : QvisWindowBase(captionString)
const QString &shortName,
QvisNotepadArea *n) :
QvisWindowBase(captionString, Qt::Dialog)
{
setWindowRole("postable-window");
if(!shortName.isEmpty())
shortCaption = QString(shortName);
else
......
......@@ -148,10 +148,14 @@
// Eric Brugger, Tue Mar 17 15:36:27 PDT 2009
// Changed the date on the splash screen.
//
// Tom Fogal, Sun Jan 24 17:09:18 MST 2010
// Patch from Andreas Kloeckner to tell Qt we've got a splash screen window,
// instead of just a window without a frame.
//
// ****************************************************************************
SplashScreen::SplashScreen(bool cyclePictures)
: QFrame(0, Qt::FramelessWindowHint)
: QFrame(0, Qt::SplashScreen)
{
#ifdef Q_WS_MACX
setWindowModality(Qt::WindowModal);
......
......@@ -121,6 +121,10 @@ Viewer_LogQtMessages(QtMsgType type, const char *msg)
// Skip connecting to the client if we're doing a -connectengine, which
// means the engine and not the client is launching the viewer.
//
// Tom Fogal, Sun Jan 24 17:10:46 MST 2010
// Add two new Qt arguments, to tell Qt the application name. Patch from
// Andreas Kloeckner, I modified it to use strdup().
//
// ****************************************************************************
int
......@@ -160,7 +164,7 @@ main(int argc, char *argv[])
//
// Create the QApplication. This sets the qApp pointer.
//
char **argv2 = new char *[argc + 3];
char **argv2 = new char *[argc + 5];
int real_argc = 0;
for(int i = 0; i < argc; ++i)
{
......@@ -169,9 +173,13 @@ main(int argc, char *argv[])
else
argv2[real_argc++] = argv[i];
}
argv2[real_argc] = (char*)"-font";
argv2[real_argc+1] = (char*)viewer.State()->GetAppearanceAttributes()->GetFontName().c_str();
argv2[real_argc+2] = NULL;
argv2[real_argc+2] = (char*)"-name";
argv2[real_argc+3] = (char*)"visit-viewer";
argv2[real_argc+4] = NULL;
debug1 << "Viewer using font: " << argv2[real_argc+1] << endl;
qInstallMsgHandler(Viewer_LogQtMessages);
int argc2 = real_argc + 2;
......
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