...
 
Commits (1)
......@@ -6,6 +6,7 @@ set(kdenlive_SRCS
dialogs/markerdialog.cpp
dialogs/profilesdialog.cpp
dialogs/renderwidget.cpp
dialogs/splash.cpp
dialogs/titletemplatedialog.cpp
dialogs/wizard.cpp
PARENT_SCOPE)
......
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "splash.hpp"
#include <KDeclarative/KDeclarative>
#include <QQmlContext>
#include <QQuickItem>
#include <QStandardPaths>
Splash::Splash()
: QObject()
, m_engine(new QQmlEngine())
{
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(m_engine);
kdeclarative.setupEngine(m_engine);
kdeclarative.setupContext();
QQmlComponent component(m_engine);
component.loadUrl(QUrl(QStringLiteral("qrc:/qml/splash.qml")));
if (component.isReady()) {
auto *root = component.create();
connect(this, SIGNAL(sigEndSplash()), root, SIGNAL(endSplash()));
} else {
qWarning() << component.errorString();
}
}
Splash::~Splash()
{
delete m_engine;
}
void Splash::endSplash()
{
emit sigEndSplash();
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef SPLASH_H
#define SPLASH_H
#include <QObject>
class QQmlEngine;
class Splash : public QObject
{
Q_OBJECT
public:
Splash();
~Splash();
void endSplash();
signals:
void sigEndSplash();
protected:
QQmlEngine *m_engine;
};
#endif
......@@ -27,6 +27,8 @@
<file alias="discrete.svg">../data/pics/breeze-light/lt_discrete.svg</file>
<file alias="smooth.svg">../data/pics/breeze-light/lt_smooth.svg</file>
<file alias="kdenlive.png">../data/icons/48-apps-kdenlive.png</file>
<file alias="kdenlive-logo.png">../data/pics/kdenlive-logo.png</file>
<file alias="splash-background.png">../data/pics/splash-background.png</file>
<file alias="kdenlive-lock.svg">../data/pics/breeze-light/lt_kdenlive-lock.svg</file>
<file alias="kdenlive-unlock.svg">../data/pics/breeze-light/lt_kdenlive-unlock.svg</file>
<file alias="kdenlive-hide-video.svgz">../data/pics/breeze-light/lt_kdenlive-hide-video.svgz</file>
......
......@@ -19,6 +19,7 @@
***************************************************************************/
#include "core.h"
#include "dialogs/splash.hpp"
#include "logger.hpp"
#include <config-kdenlive.h>
......@@ -51,6 +52,10 @@
#include <QUrl> //new
#include <klocalizedstring.h>
int fact(int n)
{
return n < 2 ? n : fact(n - 1) + fact(n - 2);
}
int main(int argc, char *argv[])
{
#ifdef USE_DRMINGW
......@@ -167,6 +172,10 @@ int main(int argc, char *argv[])
KCrash::initialize();
#endif
auto splash = new Splash();
// splash->show();
qApp->processEvents();
qmlRegisterUncreatableMetaObject(PlaylistState::staticMetaObject, // static meta object
"com.enums", // import statement
1, 0, // major and minor version of the import
......@@ -191,10 +200,15 @@ int main(int argc, char *argv[])
QUrl startup = QUrl::fromLocalFile(currentPath.endsWith(QDir::separator()) ? currentPath : currentPath + QDir::separator());
url = startup.resolved(url);
}
qApp->processEvents();
Core::build(mltPath);
qApp->processEvents();
pCore->initGUI(url);
splash->endSplash();
qApp->processEvents();
int result = app.exec();
Core::clean();
delete splash;
if (EXIT_RESTART == result) {
qCDebug(KDENLIVE_LOG) << "restarting app";
......
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4
Window {
id: splash
objectName: "splash"
color: "transparent"
title: "Splash Window"
SystemPalette { id: activePalette }
modality: Qt.ApplicationModal
flags: Qt.SplashScreen
property int timeoutInterval: 2000
signal timeout
x: (Screen.width - splashContent.width) / 2
y: (Screen.height - splashContent.height) / 2
width: splashContent.width
height: splashContent.height
property int border: 10
property bool splashing: true
signal endSplash
onEndSplash: {
console.log("ending splash")
splash.splashing = false;
}
Rectangle {
id:splashContent
height: Screen.height / 2
width: Screen.width / 3
border.width:splash.border
border.color:"#bfbfbf"
color: "#31363b"
Image {
id:logo
anchors.left: splashContent.left
anchors.top: splashContent.top
anchors.margins: 50
// anchors.horizontalCenter: splashContent.horizontalCenter
source: "../pics/kdenlive-logo.png"
fillMode: Image.PreserveAspectFit
height: splashContent.height / 5 - 100
}
RowLayout {
//anchors.horizontalCenter: splashContent.horizontalCenter
anchors.bottom: logo.bottom
anchors.right: splashContent.right
anchors.rightMargin: logo.x
spacing: 100
Text {
color: "white"
text: "Website"
font.bold: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
Text {
color: "white"
text: "Donate"
font.bold: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
Text {
color: "white"
text: "Forum"
font.bold: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
}
Rectangle {
id:recentProjects
y: splashContent.height / 5
anchors.left: splashContent.left
anchors.leftMargin: splash.border
anchors.right: splashContent.right
anchors.rightMargin: splash.border
color:"#232629"
height: 3 * splashContent.height / 5
width: splashContent.width
visible: !splashing
Text {
id:txtProject
color: "#f38577"
text: "Recent Projects"
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: 50
anchors.leftMargin: 100
font.bold: true
}
}
Image {
id:splash_img
y: splashContent.height / 5
anchors.left: splashContent.left
anchors.leftMargin: splash.border
anchors.right: splashContent.right
anchors.rightMargin: splash.border
height: 3 * splashContent.height / 5
width: splashContent.width
source: "../pics/splash-background.png"
fillMode: Image.PreserveAspectFit
visible: splashing
}
/*Text {
id:txtProject
color: "#f38577"
text: "Recent Projects"
anchors.horizontalCenter: splashContent.horizontalCenter
anchors.top: logo.bottom
anchors.topMargin: 50
font.bold: true
}
Rectangle {
id:recentProjects
border.width:5
border.color:"#efefef"
color: "#fafafa"
height: splashContent.height / 4
width: 5*splashContent.width/6
anchors.horizontalCenter: splashContent.horizontalCenter
anchors.top: txtProject.bottom
anchors.topMargin: 5
}*/
Item {
anchors.left: splashContent.left
anchors.right: splashContent.right
anchors.bottom: splashContent.bottom
anchors.top: recentProjects.bottom
anchors.margins: 50
visible: !splashing
CheckBox {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
style: CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 32
implicitHeight: 32
radius: 3
//border.color: control.activeFocus ? "darkblue" : "gray"
border.width: 1
border.color:"white"
color: "#4d4d4d"
Rectangle {
visible: control.checked
color: "#555"
border.color: "#333"
radius: 1
anchors.margins: 4
anchors.fill: parent
}
}
label: Text {
text: "Hide on startup"
color: "white"
}
}
}
Row {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 50
visible: !splashing
Button {
iconSource:"image://icon/document-new"
text:"New"
//style: CustomButton {
// backColor: splashContent.color
// }
}
Button {
iconSource:"image://icon/document-open"
text:"Open"
//style: CustomButton {
// backColor: splashContent.color
// }
}
}
}
/*MouseArea {
anchors.fill: parent
onClicked: {
console.log("clic");
splash.close();
}
}*/
}
Component.onCompleted: visible = true
}
......@@ -40,6 +40,7 @@
<file alias="BuiltStack.qml">effects/effectstack/view/qml/BuiltStack.qml</file>
<file alias="EffectSlider.qml">effects/effectstack/view/qml/EffectSlider.qml</file>
<file alias="LiftGammaGain.qml">effects/effectstack/view/qml/LiftGammaGain.qml</file>
<file alias="splash.qml">qml/splash.qml</file>
</qresource>
<qresource prefix="data">
<file alias="blacklisted_effects.txt">../data/blacklisted_effects.txt</file>
......