diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/kstartuplogo.cpp | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/kstartuplogo.cpp')
-rw-r--r-- | umbrello/umbrello/kstartuplogo.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/umbrello/umbrello/kstartuplogo.cpp b/umbrello/umbrello/kstartuplogo.cpp new file mode 100644 index 00000000..5cefe463 --- /dev/null +++ b/umbrello/umbrello/kstartuplogo.cpp @@ -0,0 +1,55 @@ +/* + * copyright (C) 2000 + * Michael Edwardes <mte @users.sourceforge.net> + */ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "kstartuplogo.h" +#include <kapplication.h> +#include <kstandarddirs.h> +#include <qtimer.h> + +KStartupLogo::KStartupLogo(QWidget * parent, const char *name) + : QWidget(parent,name, Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WDestructiveClose ) +,m_bReadyToHide(false) { + //pm.load(locate("appdata", "pics/startlogo.png")); + KStandardDirs * dirs = KGlobal::dirs(); + QString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png"); + dataDir += "/umbrello/pics/"; + QPixmap pm(dataDir + "startlogo.png"); + setBackgroundPixmap(pm); + setGeometry(QApplication::desktop()->width()/2-pm.width()/2, + QApplication::desktop()->height()/2-pm.height()/2, + pm.width(),pm.height()); + + timer = new QTimer(this); + connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) ); + timer->start(2000, true); +} + +KStartupLogo::~KStartupLogo() { + delete timer; +} + +void KStartupLogo::mousePressEvent( QMouseEvent*) { + // for the haters of raising startlogos + if (m_bReadyToHide) + hide(); +} + +void KStartupLogo::timerDone() { + this->hide(); +} + +void KStartupLogo::setHideEnabled(bool bEnabled) { + m_bReadyToHide = bEnabled; +} +#include "kstartuplogo.moc" |