You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmymoney/kmymoney2/kstartuplogo.cpp

114 lines
3.3 KiB

/***************************************************************************
kstartuplogo.cpp
-------------------
copyright : (C) 2000 by Michael Edwardes
email : 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 <kdecompat.h>
// ----------------------------------------------------------------------------
// QT Includes
#include <tqapplication.h>
#include <tqpixmap.h>
#include <tqframe.h>
#include <tqpainter.h>
// ----------------------------------------------------------------------------
// KDE Includes
#include <kglobal.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kapplication.h>
// ----------------------------------------------------------------------------
// Project Includes
#include "kstartuplogo.h"
#include "kmymoneyglobalsettings.h"
class TDEStartupSplash::Private
{
public:
TQString message;
TQColor color;
int align;
};
TDEStartupSplash::TDEStartupSplash(const TQPixmap &pixmap, WFlags f) :
KSplashScreen(pixmap, f),
d(new Private)
{
}
TDEStartupSplash::~TDEStartupSplash()
{
delete d;
}
void TDEStartupSplash::message( const TQString &message, int alignment, const TQColor &color)
{
d->message = message;
d->align = alignment;
d->color = color;
// the next line causes the base class signal management to happen
// and also forces a repaint
KSplashScreen::clear();
}
void TDEStartupSplash::drawContents( TQPainter *painter )
{
painter->setPen( d->color );
TQRect r = rect();
r.setRect( r.x() + 15, r.y() + r.height() - 28, r.width() - 20, 20 );
painter->drawText( r, d->align, d->message);
}
TDEStartupLogo::TDEStartupLogo() :
TQObject(0, 0),
m_splash(0)
{
// splash screen setting
if(!KMyMoneyGlobalSettings::showSplash())
return;
TQString filename = TDEGlobal::dirs()->findResource("appdata", "pics/startlogo.png");
TQPixmap splashPixmap(filename);
if(!splashPixmap.isNull()) {
TQPixmap backGround(splashPixmap);
backGround.fill(TDEGlobalSettings::highlightColor());
bitBlt ( &backGround, 0, 0, &splashPixmap, 0, 0, splashPixmap.width(), splashPixmap.height(), TQt::CopyROP );
TDEStartupSplash* splash = new TDEStartupSplash(backGround);
splash->setFixedSize(backGround.size());
// FIXME: I added the 'Loading file...' message here, because this was the only
// existing string we have and I did not want to change the strings. We should
// change that in the future.
splash->message(i18n("Loading..."), AlignLeft, white);
splash->show();
splash->repaint();
m_splash = splash;
}
}
TDEStartupLogo::~TDEStartupLogo()
{
delete m_splash;
}
#include "kstartuplogo.moc"