1
/***************************************************************************
2
kmfapp.cpp - description
4
begin : Fri Feb 21 2003
5
copyright : (C) 2003 by animal
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
20
#include "kstandarddirs.h"
22
#include <kglobalsettings.h>
35
static QLabel *splash = 0;
37
void set_splash_status( const QString& msg ) {
40
splash->repaint( FALSE );
42
QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold );
44
p.setPen( Qt::white );
45
p.drawText( splash->width()/2 - splash->fontMetrics().width( msg )/2, 265, msg );
46
QApplication::flush();
50
QRect screen = QApplication::desktop()->screenGeometry();
52
screen = QApplication::desktop()->screenGeometry( QApplication::desktop()->screenNumber( mainRect.center() ) );
56
// FIXME: need to get real path from system !!!
57
KStandardDirs std_dir;
58
QString dir = std_dir.findResource("data","kmyfirewall/pics/splash.png");
59
kdDebug() << "\nFound Splashscreen at: " << dir << endl;
61
QPixmap pic = QPixmap::fromMimeSource( dir );
62
QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold );
67
p.setPen( Qt::white );
68
p.drawText( 280, 93, QString("Version %1").arg(KMYFIREWALL_VERSION) );
69
splash = new QLabel( 0, "splash", QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder | QWidget::WX11BypassWM | QWidget::WStyle_StaysOnTop );
70
splash->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
71
splash->setPixmap( pic );
73
splash->setFixedSize(splash->sizeHint());
74
splash->move( screen.center() - QPoint( splash->width() / 2, splash->height() / 2 ) );
75
splash->repaint( FALSE );
77
set_splash_status( "Initializing..." );
78
QApplication::flush();