mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
OP-786 Added new splash screen art. Added new custom splash screen class. Added signal on plugin manager emitting signal when a plugin is about to be loaded.
This commit is contained in:
parent
cf40948bf0
commit
eccdf5fa91
@ -5,7 +5,8 @@ TEMPLATE = app
|
|||||||
TARGET = $$GCS_APP_TARGET
|
TARGET = $$GCS_APP_TARGET
|
||||||
DESTDIR = $$GCS_APP_PATH
|
DESTDIR = $$GCS_APP_PATH
|
||||||
QT += xml
|
QT += xml
|
||||||
SOURCES += main.cpp
|
SOURCES += main.cpp \
|
||||||
|
gcssplashscreen.cpp
|
||||||
include(../rpath.pri)
|
include(../rpath.pri)
|
||||||
include(../libs/utils/utils.pri)
|
include(../libs/utils/utils.pri)
|
||||||
|
|
||||||
@ -31,3 +32,6 @@ OTHER_FILES += openpilotgcs.rc
|
|||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
appresources.qrc
|
appresources.qrc
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
gcssplashscreen.h
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/app">
|
<qresource prefix="/app">
|
||||||
<file>loadingblue13.gif</file>
|
<file>splash.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
66
ground/openpilotgcs/src/app/gcssplashscreen.cpp
Normal file
66
ground/openpilotgcs/src/app/gcssplashscreen.cpp
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* @file gcssplashscreen.cpp
|
||||||
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||||
|
* @addtogroup [Group]
|
||||||
|
* @{
|
||||||
|
* @addtogroup GCSSplashScreen
|
||||||
|
* @{
|
||||||
|
* @brief [Brief]
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* 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 3 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.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "gcssplashscreen.h"
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
const QChar CopyrightSymbol(0x00a9);
|
||||||
|
|
||||||
|
GCSSplashScreen::GCSSplashScreen() :
|
||||||
|
QSplashScreen(), m_pixmap(0), m_painter(0)
|
||||||
|
{
|
||||||
|
m_pixmap = new QPixmap(":/app/splash.png");
|
||||||
|
|
||||||
|
m_painter = new QPainter(m_pixmap);
|
||||||
|
m_painter->setPen(Qt::lightGray);
|
||||||
|
QFont font("Tahoma", 8);
|
||||||
|
m_painter->setFont(font);
|
||||||
|
m_painter->drawText(405, 170, QString(CopyrightSymbol) +
|
||||||
|
QString(tr("2010-2013 The OpenPilot Project - All Rights Reserved")));
|
||||||
|
QString revision;
|
||||||
|
|
||||||
|
#ifdef GCS_REVISION
|
||||||
|
revision = GCS_REVISION;
|
||||||
|
#else
|
||||||
|
revision = tr("N/A");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_painter->drawText(405, 190, QString(tr("GCS Revision - ")) + revision);
|
||||||
|
setPixmap(*m_pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
GCSSplashScreen::~GCSSplashScreen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GCSSplashScreen::showPluginLoadingProgress(ExtensionSystem::PluginSpec *pluginSpec)
|
||||||
|
{
|
||||||
|
QFont font("Tahoma", 13);
|
||||||
|
m_painter->setFont(font);
|
||||||
|
m_painter->drawText(170, 385, pluginSpec->name());
|
||||||
|
setPixmap(*m_pixmap);
|
||||||
|
}
|
52
ground/openpilotgcs/src/app/gcssplashscreen.h
Normal file
52
ground/openpilotgcs/src/app/gcssplashscreen.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* @file gcssplashscreen.h
|
||||||
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||||
|
* @addtogroup [Group]
|
||||||
|
* @{
|
||||||
|
* @addtogroup GCSSplashScreen
|
||||||
|
* @{
|
||||||
|
* @brief [Brief]
|
||||||
|
*****************************************************************************/
|
||||||
|
/*
|
||||||
|
* 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 3 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.,
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GCSSPLASHSCREEN_H
|
||||||
|
#define GCSSPLASHSCREEN_H
|
||||||
|
|
||||||
|
#include <QSplashScreen>
|
||||||
|
#include <QPixmap>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <extensionsystem/pluginspec.h>
|
||||||
|
|
||||||
|
class GCSSplashScreen : public QSplashScreen
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit GCSSplashScreen();
|
||||||
|
~GCSSplashScreen();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void showPluginLoadingProgress(ExtensionSystem::PluginSpec *pluginSpec);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPixmap *m_pixmap;
|
||||||
|
QPainter *m_painter;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GCSSPLASHSCREEN_H
|
Binary file not shown.
Before Width: | Height: | Size: 397 KiB |
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "qtsingleapplication.h"
|
#include "qtsingleapplication.h"
|
||||||
#include "utils/xmlconfig.h"
|
#include "utils/xmlconfig.h"
|
||||||
|
#include "gcssplashscreen.h"
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <extensionsystem/pluginspec.h>
|
#include <extensionsystem/pluginspec.h>
|
||||||
@ -47,6 +48,7 @@
|
|||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
#include <QtGui/QMainWindow>
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtGui/QSplashScreen>
|
#include <QtGui/QSplashScreen>
|
||||||
|
#include <QtGui/QPainter>
|
||||||
|
|
||||||
enum { OptionIndent = 4, DescriptionIndent = 24 };
|
enum { OptionIndent = 4, DescriptionIndent = 24 };
|
||||||
|
|
||||||
@ -252,8 +254,7 @@ int main(int argc, char **argv)
|
|||||||
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
|
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
|
||||||
|
|
||||||
//Open Splashscreen
|
//Open Splashscreen
|
||||||
QPixmap logoPixmap(":/app/loadingblue13.gif");
|
GCSSplashScreen splash;
|
||||||
QSplashScreen splash(logoPixmap);
|
|
||||||
splash.show();
|
splash.show();
|
||||||
|
|
||||||
QString locale = QLocale::system().name();
|
QString locale = QLocale::system().name();
|
||||||
@ -325,7 +326,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!coreplugin) {
|
if(!coreplugin){
|
||||||
QString nativePaths = QDir::toNativeSeparators(pluginPaths.join(QLatin1String(",")));
|
QString nativePaths = QDir::toNativeSeparators(pluginPaths.join(QLatin1String(",")));
|
||||||
const QString reason = QCoreApplication::translate("Application", "Could not find 'Core.pluginspec' in %1").arg(nativePaths);
|
const QString reason = QCoreApplication::translate("Application", "Could not find 'Core.pluginspec' in %1").arg(nativePaths);
|
||||||
displayError(msgCoreLoadFailure(reason));
|
displayError(msgCoreLoadFailure(reason));
|
||||||
@ -353,6 +354,8 @@ int main(int argc, char **argv)
|
|||||||
if (!isFirstInstance && foundAppOptions.contains(QLatin1String(CLIENT_OPTION)))
|
if (!isFirstInstance && foundAppOptions.contains(QLatin1String(CLIENT_OPTION)))
|
||||||
return sendArguments(app, pluginManager.arguments()) ? 0 : -1;
|
return sendArguments(app, pluginManager.arguments()) ? 0 : -1;
|
||||||
|
|
||||||
|
QObject::connect(&pluginManager, SIGNAL(pluginAboutToBeLoaded(ExtensionSystem::PluginSpec*)),
|
||||||
|
&splash, SLOT(showPluginLoadingProgress(ExtensionSystem::PluginSpec*)));
|
||||||
pluginManager.loadPlugins();
|
pluginManager.loadPlugins();
|
||||||
if (coreplugin->hasError()) {
|
if (coreplugin->hasError()) {
|
||||||
displayError(msgCoreLoadFailure(coreplugin->errorString()));
|
displayError(msgCoreLoadFailure(coreplugin->errorString()));
|
||||||
|
BIN
ground/openpilotgcs/src/app/splash.png
Normal file
BIN
ground/openpilotgcs/src/app/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 275 KiB |
@ -583,7 +583,9 @@ void PluginManagerPrivate::loadPlugins()
|
|||||||
QListIterator<PluginSpec *> it(queue);
|
QListIterator<PluginSpec *> it(queue);
|
||||||
it.toBack();
|
it.toBack();
|
||||||
while (it.hasPrevious()) {
|
while (it.hasPrevious()) {
|
||||||
loadPlugin(it.previous(), PluginSpec::Running);
|
PluginSpec* plugin = it.previous();
|
||||||
|
emit q->pluginAboutToBeLoaded(plugin);
|
||||||
|
loadPlugin(plugin, PluginSpec::Running);
|
||||||
}
|
}
|
||||||
emit q->pluginsChanged();
|
emit q->pluginsChanged();
|
||||||
q->m_allPluginsLoaded=true;
|
q->m_allPluginsLoaded=true;
|
||||||
|
@ -114,6 +114,7 @@ signals:
|
|||||||
void objectAdded(QObject *obj);
|
void objectAdded(QObject *obj);
|
||||||
void aboutToRemoveObject(QObject *obj);
|
void aboutToRemoveObject(QObject *obj);
|
||||||
|
|
||||||
|
void pluginAboutToBeLoaded(ExtensionSystem::PluginSpec* pluginSpec);
|
||||||
void pluginsChanged();
|
void pluginsChanged();
|
||||||
void pluginsLoadEnded();
|
void pluginsLoadEnded();
|
||||||
private slots:
|
private slots:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user