Commit f91facfb authored by Isaak Lim's avatar Isaak Lim

- added StaysOnTopMessageBox

- changed the warning message-boxes used in Core to always stay on top of other windows

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17613 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 77d8bac8
......@@ -105,6 +105,8 @@
#include <OpenFlipper/common/RendererInfo.hh>
#include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
#define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800
......@@ -607,12 +609,7 @@ Core::init() {
emit log(LOGERR,tr("The build in renderer is only a very limited one and is missing many features!"));
emit log(LOGERR,tr("You should build and use the other renderers!"));
QMessageBox msgBox;
msgBox.setWindowFlags(msgBox.windowFlags() | Qt::WindowStaysOnTopHint); //show messagebox before the splash screen
msgBox.setText("No external plugin renderers available!");
msgBox.setInformativeText("The build in renderer is only a very limited one and is missing many features.\nYou should build and use the other free renderers shipped with OpenFlipper.");
msgBox.setIcon(QMessageBox::Warning);
msgBox.exec();
StaysOnTopMessageBox::warning(0,tr( "No external plugin renderers available!"),tr("The build in renderer is only a very limited one and is missing many features.\nYou should build and use the other free renderers shipped with OpenFlipper."));
}
}
......@@ -1915,13 +1912,13 @@ bool Core::checkOpenGLCapabilities() {
std::cerr << message.toStdString() << std::endl;
QMessageBox::StandardButton button = QMessageBox::critical ( 0, tr( "Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
QMessageBox::StandardButton button = StaysOnTopMessageBox::critical ( 0, tr( "Insufficient OpenGL Capabilities!"),message,QMessageBox::Abort|QMessageBox::Ignore , QMessageBox::Abort);
// Unsafe operation, so quit the application
if ( button == QMessageBox::Abort )
exitFailure();
else
QMessageBox::warning(0,tr( "Insufficient OpenGL Capabilities!"),tr("Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
StaysOnTopMessageBox::warning(0,tr( "Insufficient OpenGL Capabilities!"),tr("Ignoring OpenGL capabilities might lead to unstable Operation! Do it at your own risk!"));
......@@ -1932,7 +1929,7 @@ bool Core::checkOpenGLCapabilities() {
std::cerr << message.toStdString() << std::endl;
QMessageBox::warning ( 0, tr( "Detected possible problems!"),message );
StaysOnTopMessageBox::warning ( 0, tr( "Detected possible problems!"),message );
}
#ifndef NDEBUG
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 17184 $ *
* $LastChangedBy: lim $ *
* $Date: 2013-08-02 14:59:34 +0200 (Fri, 02 Aug 2013) $ *
* *
\*===========================================================================*/
#ifndef STAYSONTOPMESSAGEBOX_HH
#define STAYSONTOPMESSAGEBOX_HH
#include <QMessageBox>
class StaysOnTopMessageBox : public QMessageBox {
Q_OBJECT
public:
StaysOnTopMessageBox(QWidget* _parent) :
QMessageBox(_parent)
{
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
}
StaysOnTopMessageBox(Icon _icon,
const QString& _title,
const QString& _text,
StandardButtons _buttons = NoButton,
QWidget* _parent = 0,
Qt::WindowFlags _f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint) :
QMessageBox(_icon, _title, _text, _buttons, _parent, _f | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint)
{}
};
//=============================================================================
#endif // STAYSONTOPMESSAGEBOX_HH defined
//=============================================================================
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