Browse Source

Updated splash screen

QGC4.4
lm 14 years ago
parent
commit
e2982eb086
  1. BIN
      images/splash.png
  2. 3
      src/QGCCore.cc
  3. 21
      src/ui/MainWindow.cc
  4. 6
      src/ui/MainWindow.h

BIN
images/splash.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 25 KiB

3
src/QGCCore.cc

@ -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
splashScreen->setAttribute(Qt::WA_DeleteOnClose);
splashScreen->show();
processEvents();
splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
// 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();
//mainWindow->addLink(simulationLink);
mainWindow = MainWindow::instance();
mainWindow = MainWindow::instance(splashScreen);
// Remove splash screen
splashScreen->finish(mainWindow);

21
src/ui/MainWindow.cc

@ -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 <QTimer>
#include <QHostInfo>
#include <QSplashScreen>
#include "QGC.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"
MainWindow* MainWindow::instance()
MainWindow* MainWindow::instance(QSplashScreen* screen)
{
static MainWindow* _instance = 0;
if(_instance == 0)
{
_instance = new MainWindow();
if (screen) connect(_instance, SIGNAL(initStatusChanged(QString)), screen, SLOT(showMessage(QString)));
/* Set the application as parent to ensure that this object
* 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),
lowPowerMode(false)
{
hide();
emit initStatusChanged("Loading UI Settings..");
loadSettings();
if (!settings.contains("CURRENT_VIEW"))
{
@ -115,10 +119,14 @@ MainWindow::MainWindow(QWidget *parent): @@ -115,10 +119,14 @@ MainWindow::MainWindow(QWidget *parent):
settings.sync();
emit initStatusChanged("Loading Style.");
loadStyle(currentStyle);
emit initStatusChanged("Setting up user interface.");
// Setup user interface
ui.setupUi(this);
hide();
// Set dock options
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.actionPilotsView);
emit initStatusChanged("Building common widgets.");
buildCommonWidgets();
connectCommonWidgets();
emit initStatusChanged("Building common actions.");
// Create actions
connectCommonActions();
// Populate link menu
emit initStatusChanged("Populating link menu");
QList<LinkInterface*> links = LinkManager::instance()->getLinks();
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 user interface devices
emit initStatusChanged("Initializing joystick interface.");
joystickWidget = 0;
joystick = new JoystickInput();
@ -178,9 +192,12 @@ MainWindow::MainWindow(QWidget *parent): @@ -178,9 +192,12 @@ MainWindow::MainWindow(QWidget *parent):
// Initialize window state
windowStateVal = windowState();
emit initStatusChanged("Restoring last view state.");
// Restore the window setup
loadViewState();
emit initStatusChanged("Restoring last window size.");
// Restore the window position and size
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()));
windowNameUpdateTimer.start(15000);
emit initStatusChanged("Done.");
show();
}
MainWindow::~MainWindow()

6
src/ui/MainWindow.h

@ -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"
class QGCMapTool;
class QSplashScreen;
/**
* @brief Main Application Window
@ -90,7 +91,7 @@ class MainWindow : public QMainWindow @@ -90,7 +91,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
static MainWindow* instance();
static MainWindow* instance(QSplashScreen* screen = 0);
~MainWindow();
enum QGC_MAINWINDOW_STYLE {
@ -216,6 +217,9 @@ public slots: @@ -216,6 +217,9 @@ public slots:
/** @brief Update the window name */
void configureWindowName();
signals:
void initStatusChanged(const QString& message);
public:
QGCMAVLinkLogPlayer* getLogPlayer()
{

Loading…
Cancel
Save