Commit e2982eb0 authored by lm's avatar lm

Updated splash screen

parent 45e5ae38
images/splash.png

25.5 KB | W: | H:

images/splash.png

25.2 KB | W: | H:

images/splash.png
images/splash.png
images/splash.png
images/splash.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -110,6 +110,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv) ...@@ -110,6 +110,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv)
// Delete splash screen after mainWindow was displayed // Delete splash screen after mainWindow was displayed
splashScreen->setAttribute(Qt::WA_DeleteOnClose); splashScreen->setAttribute(Qt::WA_DeleteOnClose);
splashScreen->show(); splashScreen->show();
processEvents();
splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
// Exit main application when last window is closed // Exit main application when last window is closed
...@@ -159,7 +160,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv) ...@@ -159,7 +160,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv)
simulationLink->disconnect(); simulationLink->disconnect();
//mainWindow->addLink(simulationLink); //mainWindow->addLink(simulationLink);
mainWindow = MainWindow::instance(); mainWindow = MainWindow::instance(splashScreen);
// Remove splash screen // Remove splash screen
splashScreen->finish(mainWindow); splashScreen->finish(mainWindow);
......
...@@ -34,6 +34,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -34,6 +34,7 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QTimer>
#include <QHostInfo> #include <QHostInfo>
#include <QSplashScreen>
#include "QGC.h" #include "QGC.h"
#include "MAVLinkSimulationLink.h" #include "MAVLinkSimulationLink.h"
...@@ -62,12 +63,13 @@ This file is part of the QGROUNDCONTROL project ...@@ -62,12 +63,13 @@ This file is part of the QGROUNDCONTROL project
#include "LogCompressor.h" #include "LogCompressor.h"
MainWindow* MainWindow::instance() MainWindow* MainWindow::instance(QSplashScreen* screen)
{ {
static MainWindow* _instance = 0; static MainWindow* _instance = 0;
if(_instance == 0) if(_instance == 0)
{ {
_instance = new MainWindow(); _instance = new MainWindow();
if (screen) connect(_instance, SIGNAL(initStatusChanged(QString)), screen, SLOT(showMessage(QString)));
/* Set the application as parent to ensure that this object /* Set the application as parent to ensure that this object
* will be destroyed when the main application exits */ * will be destroyed when the main application exits */
...@@ -94,6 +96,8 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -94,6 +96,8 @@ MainWindow::MainWindow(QWidget *parent):
centerStackActionGroup(this), centerStackActionGroup(this),
lowPowerMode(false) lowPowerMode(false)
{ {
hide();
emit initStatusChanged("Loading UI Settings..");
loadSettings(); loadSettings();
if (!settings.contains("CURRENT_VIEW")) if (!settings.contains("CURRENT_VIEW"))
{ {
...@@ -115,10 +119,14 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -115,10 +119,14 @@ MainWindow::MainWindow(QWidget *parent):
settings.sync(); settings.sync();
emit initStatusChanged("Loading Style.");
loadStyle(currentStyle); loadStyle(currentStyle);
emit initStatusChanged("Setting up user interface.");
// Setup user interface // Setup user interface
ui.setupUi(this); ui.setupUi(this);
hide();
// Set dock options // Set dock options
setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks); setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks);
...@@ -143,13 +151,18 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -143,13 +151,18 @@ MainWindow::MainWindow(QWidget *parent):
toolBar->addPerspectiveChangeAction(ui.actionEngineersView); toolBar->addPerspectiveChangeAction(ui.actionEngineersView);
toolBar->addPerspectiveChangeAction(ui.actionPilotsView); toolBar->addPerspectiveChangeAction(ui.actionPilotsView);
emit initStatusChanged("Building common widgets.");
buildCommonWidgets(); buildCommonWidgets();
connectCommonWidgets(); connectCommonWidgets();
emit initStatusChanged("Building common actions.");
// Create actions // Create actions
connectCommonActions(); connectCommonActions();
// Populate link menu // Populate link menu
emit initStatusChanged("Populating link menu");
QList<LinkInterface*> links = LinkManager::instance()->getLinks(); QList<LinkInterface*> links = LinkManager::instance()->getLinks();
foreach(LinkInterface* link, links) foreach(LinkInterface* link, links)
{ {
...@@ -159,6 +172,7 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -159,6 +172,7 @@ MainWindow::MainWindow(QWidget *parent):
connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*))); connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*)));
// Connect user interface devices // Connect user interface devices
emit initStatusChanged("Initializing joystick interface.");
joystickWidget = 0; joystickWidget = 0;
joystick = new JoystickInput(); joystick = new JoystickInput();
...@@ -178,9 +192,12 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -178,9 +192,12 @@ MainWindow::MainWindow(QWidget *parent):
// Initialize window state // Initialize window state
windowStateVal = windowState(); windowStateVal = windowState();
emit initStatusChanged("Restoring last view state.");
// Restore the window setup // Restore the window setup
loadViewState(); loadViewState();
emit initStatusChanged("Restoring last window size.");
// Restore the window position and size // Restore the window position and size
if (settings.contains(getWindowGeometryKey())) if (settings.contains(getWindowGeometryKey()))
{ {
...@@ -208,6 +225,8 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -208,6 +225,8 @@ MainWindow::MainWindow(QWidget *parent):
connect(&windowNameUpdateTimer, SIGNAL(timeout()), this, SLOT(configureWindowName())); connect(&windowNameUpdateTimer, SIGNAL(timeout()), this, SLOT(configureWindowName()));
windowNameUpdateTimer.start(15000); windowNameUpdateTimer.start(15000);
emit initStatusChanged("Done.");
show();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
......
...@@ -80,6 +80,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -80,6 +80,7 @@ This file is part of the QGROUNDCONTROL project
#include "MAVLinkDecoder.h" #include "MAVLinkDecoder.h"
class QGCMapTool; class QGCMapTool;
class QSplashScreen;
/** /**
* @brief Main Application Window * @brief Main Application Window
...@@ -90,7 +91,7 @@ class MainWindow : public QMainWindow ...@@ -90,7 +91,7 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
static MainWindow* instance(); static MainWindow* instance(QSplashScreen* screen = 0);
~MainWindow(); ~MainWindow();
enum QGC_MAINWINDOW_STYLE { enum QGC_MAINWINDOW_STYLE {
...@@ -216,6 +217,9 @@ public slots: ...@@ -216,6 +217,9 @@ public slots:
/** @brief Update the window name */ /** @brief Update the window name */
void configureWindowName(); void configureWindowName();
signals:
void initStatusChanged(const QString& message);
public: public:
QGCMAVLinkLogPlayer* getLogPlayer() QGCMAVLinkLogPlayer* getLogPlayer()
{ {
......
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