Commit f97c4e14 authored by Halla Rempt's avatar Halla Rempt

Start work on a more full-features splash screen.

Conflicts:
	libs/main/KoApplication.cpp
parent f38f0ada
......@@ -2,7 +2,7 @@ project(krita)
add_definitions(${KDE4_ENABLE_EXCEPTIONS})
# To avoid the confusion of an endless stream of Eigen warnings.
# To avoid the confusion of an endless stream of Eigen warnings.
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
add_definitions(-Wno-unused-local-typedefs)
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
......@@ -99,7 +99,7 @@ set(KRITA_INCLUDES
# For generated files from .ui
${CMAKE_BINARY_DIR}/krita/ui
${PIGMENT_INCLUDES}
${KOTEXT_INCLUDES}
${KOMAIN_INCLUDES}
......@@ -144,11 +144,15 @@ kde4_add_plugin(kritapart ${kritapart_PART_SRCS})
target_link_libraries(kritapart kritaui)
install(TARGETS kritapart DESTINATION ${PLUGIN_INSTALL_DIR})
set(krita_KDEINIT_SRCS main.cc)
set(krita_KDEINIT_SRCS main.cc kis_splash_screen.cpp)
kde4_add_ui_files(krita_KDEINIT_SRCS
wdgsplash.ui
)
if(WIN32 AND USE_BREAKPAD)
set(krita_KDEINIT_SRCS ${krita_KDEINIT_SRCS} kis_crash_handler.cpp)
set(BREAKPAD_LIBS breakpad)
endif(WIN32 AND USE_BREAKPAD)
endif(WIN32 AND USE_BREAKPAD)
kde4_add_app_icon(krita_KDEINIT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/hi*-app-calligrakrita.png")
kde4_add_kdeinit_executable(krita ${krita_KDEINIT_SRCS})
......
/*
* Copyright (c) 2014 Boudewijn Rempt <boud@valdyas.org>
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_splash_screen.h"
KisSplashScreen::KisSplashScreen(QWidget *parent) :
QWidget(parent)
{
setupUi(this);
}
/*
* Copyright (c) 2014 Boudewijn Rempt <boud@valdyas.org>
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_SPLASH_SCREEN_H
#define KIS_SPLASH_SCREEN_H
#include <QWidget>
#include "ui_wdgsplash.h"
class KisSplashScreen : public QWidget, public Ui::WdgSplash
{
Q_OBJECT
public:
explicit KisSplashScreen(QWidget *parent = 0);
signals:
public slots:
};
#endif // KIS_SPLASH_SCREEN_H
......@@ -30,7 +30,6 @@
#include <kglobal.h>
#include <kcmdlineargs.h>
#include <ksplashscreen.h>
#include <ksycoca.h>
#include <kstandarddirs.h>
#include <kcrash.h>
......@@ -44,6 +43,7 @@
#include "ui/kis_aboutdata.h"
#include "ui/kis_factory2.h"
#include "ui/kis_doc2.h"
#include "kis_splash_screen.h"
#if defined Q_OS_WIN
#include "stdlib.h"
......@@ -97,7 +97,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
// then create the pixmap from an xpm: we cannot get the
// location of our datadir before we've started our components,
// so use an xpm.
QSplashScreen *splash = new KSplashScreen(QPixmap(splash_screen_xpm));
QWidget *splash = new KisSplashScreen();
app.setSplashScreen(splash);
if (!app.start()) {
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WdgSplash</class>
<widget class="QWidget" name="WdgSplash">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>440</width>
<height>525</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>40</red>
<green>40</green>
<blue>40</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>40</red>
<green>40</green>
<blue>40</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>250</red>
<green>250</green>
<blue>250</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="windowOpacity">
<double>0.500000000000000</double>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lblSplash">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>440</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../../2.8/krita/data/splash/splash_screen.xpm</pixmap>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblVersion">
<property name="text">
<string>Version 2.8.1 (d73aa83)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>20</number>
</property>
<item>
<widget class="QLabel" name="lblLinks">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Links&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://krita.org/support-krita#general&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Donations&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.zazzle.com/kritashop&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Shop&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://krita.org/resources&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Getting Started&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://krita.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Website&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://kritastudio.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Commercial Support&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://forum.kde.org/viewforum.php?f=136&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;User Community&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://projects.kde.org/projects/calligra&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006e28;&quot;&gt;Source Code&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblRecent">
<property name="text">
<string>Recent files</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -52,7 +52,7 @@
#endif
#include <QFile>
#include <QSplashScreen>
#include <QWidget>
#include <QSysInfo>
#include <QStringList>
#include <QDesktopServices>
......@@ -79,10 +79,29 @@ public:
: splashScreen(0)
{}
QByteArray nativeMimeType;
QSplashScreen *splashScreen;
QWidget *splashScreen;
QList<KoPart *> partList;
};
class KoApplication::ResetStarting
{
public:
ResetStarting(QWidget *splash = 0)
: m_splash(splash)
{
}
~ResetStarting() {
if (m_splash) {
m_splash->hide();
delete m_splash;
m_splash = 0;
}
}
QWidget *m_splash;
};
KoApplication::KoApplication(const QByteArray &nativeMimeType)
: KApplication(initHack())
, d(new KoApplicationPrivate)
......@@ -136,23 +155,6 @@ bool KoApplication::initHack()
return true;
}
class KoApplication::ResetStarting
{
public:
ResetStarting(QSplashScreen *splash = 0)
: m_splash(splash)
{
}
~ResetStarting() {
if (m_splash) {
m_splash->hide();
}
}
QSplashScreen *m_splash;
};
#if defined(Q_OS_WIN) && defined(ENV32BIT)
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
......@@ -221,7 +223,7 @@ bool KoApplication::start()
if (d->splashScreen) {
d->splashScreen->show();
d->splashScreen->showMessage(".");
//d->splashScreen->showMessage(".");
}
ResetStarting resetStarting(d->splashScreen); // remove the splash when done
......@@ -569,7 +571,7 @@ KoApplication::~KoApplication()
delete d;
}
void KoApplication::setSplashScreen(QSplashScreen *splashScreen)
void KoApplication::setSplashScreen(QWidget *splashScreen)
{
d->splashScreen = splashScreen;
}
......
......@@ -27,7 +27,7 @@ class KoPart;
class KoApplicationPrivate;
class QSplashScreen;
class QWidget;
class QStringList;
#include <KoFilterManager.h>
......@@ -82,7 +82,7 @@ public:
* when start returns, the splashscreen is hidden. Use KSplashScreen
* to have the splash show correctly on Xinerama displays.
*/
void setSplashScreen(QSplashScreen *splash);
void setSplashScreen(QWidget *splash);
QList<KoPart*> partList() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment