1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +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:
Fredrik Arvidsson 2013-01-22 07:16:14 +01:00
parent 1b5bd0d884
commit 365e087128
9 changed files with 134 additions and 6 deletions

View File

@ -5,7 +5,8 @@ TEMPLATE = app
TARGET = $$GCS_APP_TARGET
DESTDIR = $$GCS_APP_PATH
QT += xml
SOURCES += main.cpp
SOURCES += main.cpp \
gcssplashscreen.cpp
include(../rpath.pri)
include(../libs/utils/utils.pri)
@ -31,3 +32,6 @@ OTHER_FILES += openpilotgcs.rc
RESOURCES += \
appresources.qrc
HEADERS += \
gcssplashscreen.h

View File

@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/app">
<file>loadingblue13.gif</file>
<file>splash.png</file>
</qresource>
</RCC>

View 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);
}

View 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

View File

@ -28,6 +28,7 @@
#include "qtsingleapplication.h"
#include "utils/xmlconfig.h"
#include "gcssplashscreen.h"
#include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h>
@ -47,6 +48,7 @@
#include <QtGui/QApplication>
#include <QtGui/QMainWindow>
#include <QtGui/QSplashScreen>
#include <QtGui/QPainter>
enum { OptionIndent = 4, DescriptionIndent = 24 };
@ -252,8 +254,7 @@ int main(int argc, char **argv)
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
//Open Splashscreen
QPixmap logoPixmap(":/app/loadingblue13.gif");
QSplashScreen splash(logoPixmap);
GCSSplashScreen splash;
splash.show();
QString locale = QLocale::system().name();
@ -325,7 +326,7 @@ int main(int argc, char **argv)
break;
}
}
if (!coreplugin) {
if(!coreplugin){
QString nativePaths = QDir::toNativeSeparators(pluginPaths.join(QLatin1String(",")));
const QString reason = QCoreApplication::translate("Application", "Could not find 'Core.pluginspec' in %1").arg(nativePaths);
displayError(msgCoreLoadFailure(reason));
@ -353,6 +354,8 @@ int main(int argc, char **argv)
if (!isFirstInstance && foundAppOptions.contains(QLatin1String(CLIENT_OPTION)))
return sendArguments(app, pluginManager.arguments()) ? 0 : -1;
QObject::connect(&pluginManager, SIGNAL(pluginAboutToBeLoaded(ExtensionSystem::PluginSpec*)),
&splash, SLOT(showPluginLoadingProgress(ExtensionSystem::PluginSpec*)));
pluginManager.loadPlugins();
if (coreplugin->hasError()) {
displayError(msgCoreLoadFailure(coreplugin->errorString()));

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

View File

@ -583,7 +583,9 @@ void PluginManagerPrivate::loadPlugins()
QListIterator<PluginSpec *> it(queue);
it.toBack();
while (it.hasPrevious()) {
loadPlugin(it.previous(), PluginSpec::Running);
PluginSpec* plugin = it.previous();
emit q->pluginAboutToBeLoaded(plugin);
loadPlugin(plugin, PluginSpec::Running);
}
emit q->pluginsChanged();
q->m_allPluginsLoaded=true;

View File

@ -114,6 +114,7 @@ signals:
void objectAdded(QObject *obj);
void aboutToRemoveObject(QObject *obj);
void pluginAboutToBeLoaded(ExtensionSystem::PluginSpec* pluginSpec);
void pluginsChanged();
void pluginsLoadEnded();
private slots: