00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #include "graspitApp.h"
00031 #include <QSettings>
00032 #include <QLabel>
00033 #include <QFrame>
00034 #include <QDesktopWidget>
00035
00036 #include "mytools.h"
00037
00039 static QLabel *splash = 0;
00040
00046 void
00047 GraspItApp::showSplash()
00048 {
00049 QRect screen = QApplication::desktop()->screenGeometry();
00050 QSettings config;
00051 config.insertSearchPath( QSettings::Windows, "/Columbia" );
00052
00053 QRect mainRect;
00054 QString keybase = "/GraspIt/0.9/";
00055 bool show = config.readBoolEntry( keybase + "SplashScreen", TRUE );
00056 mainRect.setX( config.readNumEntry( keybase + "Geometries/MainwindowX", 0 ) );
00057 mainRect.setY( config.readNumEntry( keybase + "Geometries/MainwindowY", 0 ) );
00058 mainRect.setWidth( config.readNumEntry( keybase + "Geometries/MainwindowWidth", 500 ) );
00059 mainRect.setHeight( config.readNumEntry( keybase + "Geometries/MainwindowHeight", 500 ) );
00060 screen = QApplication::desktop()->screenGeometry( QApplication::desktop()->screenNumber( mainRect.center() ) );
00061
00062 if ( show ) {
00063 splash = new QLabel( 0, "splash",Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
00064
00065 splash->setAttribute(Qt::WA_DeleteOnClose,true);
00066 splash->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
00067 splash->setPixmap(load_pixmap( "splash.jpg" ));
00068 splash->adjustSize();
00069 splash->setFixedSize(splash->sizeHint());
00070 splash->setCaption( "GraspIt!" );
00071 splash->move( screen.center() - QPoint( splash->width() / 2, splash->height() / 2 ) );
00072 splash->show();
00073 splash->repaint( FALSE );
00074 QApplication::flush();
00075
00076 }
00077 }
00078
00082 void GraspItApp::closeSplash()
00083 {
00084 if (splash) delete splash;
00085 }