umbrello API Documentation

kstartuplogo.cpp

00001 /*
00002  *  copyright (C) 2000
00003  *  Michael Edwardes <mte @users.sourceforge.net>
00004  */
00005 
00006 /***************************************************************************
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  ***************************************************************************/
00014 
00015 #include "kstartuplogo.h"
00016 #include <kapplication.h>
00017 #include <kstandarddirs.h>
00018 #include <qtimer.h>
00019 
00020 KStartupLogo::KStartupLogo(QWidget * parent, const char *name)
00021         : QWidget(parent,name, Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WDestructiveClose )
00022 ,m_bReadyToHide(false) {
00023     //pm.load(locate("appdata", "pics/startlogo.png"));
00024     KStandardDirs * dirs = KGlobal::dirs();
00025     QString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png");
00026     dataDir += "/umbrello/pics/";
00027     QPixmap pm(dataDir + "startlogo.png");
00028     setBackgroundPixmap(pm);
00029     setGeometry(QApplication::desktop()->width()/2-pm.width()/2,
00030                 QApplication::desktop()->height()/2-pm.height()/2,
00031                 pm.width(),pm.height());
00032 
00033     timer = new QTimer(this);
00034     connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) );
00035     timer->start(2000, true);
00036 }
00037 
00038 KStartupLogo::~KStartupLogo() {
00039     delete timer;
00040 }
00041 
00042 void KStartupLogo::mousePressEvent( QMouseEvent*) {
00043     // for the haters of raising startlogos
00044     if (m_bReadyToHide)
00045         hide();
00046 }
00047 
00048 void KStartupLogo::timerDone() {
00049     this->hide();
00050 }
00051 
00052 void KStartupLogo::setHideEnabled(bool bEnabled) {
00053     m_bReadyToHide = bEnabled;
00054 }
00055 #include "kstartuplogo.moc"
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:58 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003