summaryrefslogtreecommitdiffstats
path: root/kmymoney2/kstartuplogo.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
commitdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch)
tree99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/kstartuplogo.cpp
downloadkmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz
kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/kstartuplogo.cpp')
-rw-r--r--kmymoney2/kstartuplogo.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/kmymoney2/kstartuplogo.cpp b/kmymoney2/kstartuplogo.cpp
new file mode 100644
index 0000000..566f8ad
--- /dev/null
+++ b/kmymoney2/kstartuplogo.cpp
@@ -0,0 +1,113 @@
+/***************************************************************************
+ 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 <qapplication.h>
+#include <qpixmap.h>
+#include <qframe.h>
+#include <qpainter.h>
+
+// ----------------------------------------------------------------------------
+// KDE Includes
+
+#include <kglobal.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+
+// ----------------------------------------------------------------------------
+// Project Includes
+
+#include "kstartuplogo.h"
+#include "kmymoneyglobalsettings.h"
+
+class KStartupSplash::Private
+{
+ public:
+ QString message;
+ QColor color;
+ int align;
+};
+
+KStartupSplash::KStartupSplash(const QPixmap &pixmap, WFlags f) :
+ KSplashScreen(pixmap, f),
+ d(new Private)
+{
+}
+
+KStartupSplash::~KStartupSplash()
+{
+ delete d;
+}
+
+void KStartupSplash::message( const QString &message, int alignment, const QColor &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 KStartupSplash::drawContents( QPainter *painter )
+{
+ painter->setPen( d->color );
+ QRect r = rect();
+ r.setRect( r.x() + 15, r.y() + r.height() - 28, r.width() - 20, 20 );
+ painter->drawText( r, d->align, d->message);
+}
+
+KStartupLogo::KStartupLogo() :
+ QObject(0, 0),
+ m_splash(0)
+{
+ // splash screen setting
+ if(!KMyMoneyGlobalSettings::showSplash())
+ return;
+
+ QString filename = KGlobal::dirs()->findResource("appdata", "pics/startlogo.png");
+ QPixmap splashPixmap(filename);
+
+ if(!splashPixmap.isNull()) {
+ QPixmap backGround(splashPixmap);
+ backGround.fill(KGlobalSettings::highlightColor());
+ bitBlt ( &backGround, 0, 0, &splashPixmap, 0, 0, splashPixmap.width(), splashPixmap.height(), Qt::CopyROP );
+
+ KStartupSplash* splash = new KStartupSplash(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;
+ }
+}
+
+KStartupLogo::~KStartupLogo()
+{
+ delete m_splash;
+}
+
+#include "kstartuplogo.moc"