summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/kstartuplogo.cpp
blob: 48df28a818197ca11fd88b8e0f65972177a95148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 <tqtimer.h>

KStartupLogo::KStartupLogo(TQWidget * tqparent, const char *name)
        : TQWidget(tqparent,name, TQt::WStyle_NoBorder | TQt::WStyle_Customize | TQt::WDestructiveClose )
,m_bReadyToHide(false) {
    //pm.load(locate("appdata", "pics/startlogo.png"));
    KStandardDirs * dirs = KGlobal::dirs();
    TQString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png");
    dataDir += "/umbrello/pics/";
    TQPixmap pm(dataDir + "startlogo.png");
    setBackgroundPixmap(pm);
    setGeometry(TQApplication::desktop()->width()/2-pm.width()/2,
                TQApplication::desktop()->height()/2-pm.height()/2,
                pm.width(),pm.height());

    timer = new TQTimer(this);
    connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) );
    timer->start(2000, true);
}

KStartupLogo::~KStartupLogo() {
    delete timer;
}

void KStartupLogo::mousePressEvent( TQMouseEvent*) {
    // 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"