diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 4db5dd404122d6f6418488397bdb6d942eb0fb4c..6ae0c9e415ac300505c0a44227e6a3e3cefab800 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -414,7 +414,6 @@ HEADERS += \ src/ui/map/QGCMapToolBar.h \ src/QGCGeo.h \ src/ui/QGCToolBar.h \ - src/ui/QGCStatusBar.h \ src/ui/QGCMAVLinkInspector.h \ src/ui/MAVLinkDecoder.h \ src/ui/WaypointViewOnlyView.h \ @@ -558,7 +557,6 @@ SOURCES += \ src/ui/map/QGCMapTool.cc \ src/ui/map/QGCMapToolBar.cc \ src/ui/QGCToolBar.cc \ - src/ui/QGCStatusBar.cc \ src/ui/QGCMAVLinkInspector.cc \ src/ui/MAVLinkDecoder.cc \ src/ui/WaypointViewOnlyView.cc \ diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index d43ec0750043b71ced897500f4b541366c36c5aa..9be412641f1d59ecee1dbb1c8e7ca503734827e7 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -57,7 +57,6 @@ This file is part of the QGROUNDCONTROL project #include "MAVLinkDecoder.h" #include "QGCMAVLinkMessageSender.h" #include "QGCRGBDView.h" -#include "QGCStatusBar.h" #include "UASQuickView.h" #include "QGCDataPlot2D.h" #include "Linecharts.h" @@ -225,8 +224,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE advancedActions << ui.actionSimulationView; toolBar->setPerspectiveChangeAdvancedActions(advancedActions); - customStatusBar = new QGCStatusBar(this); - setStatusBar(customStatusBar); + setStatusBar(new QStatusBar(this)); statusBar()->setSizeGripEnabled(true); emit initStatusChanged(tr("Building common widgets."), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); @@ -503,8 +501,8 @@ void MainWindow::buildCommonWidgets() this, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64))); // Log player - logPlayer = new QGCMAVLinkLogPlayer(mavlink, customStatusBar); - customStatusBar->setLogPlayer(logPlayer); + logPlayer = new QGCMAVLinkLogPlayer(mavlink, statusBar()); + statusBar()->addPermanentWidget(logPlayer); // Initialize all of the views, if they haven't been already, and add their central widgets if (!plannerView) diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 0933431e5eb6d6b08fe545d3ecc6403b575e6279..df2a12982f9404da2d50e04fd6cc4eb3731d8ee5 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -416,7 +416,6 @@ protected: QPointer hudDockWidget; QPointer toolBar; - QPointer customStatusBar; QPointer mavlinkInspectorWidget; QPointer mavlinkDecoder; diff --git a/src/ui/QGCStatusBar.cc b/src/ui/QGCStatusBar.cc deleted file mode 100644 index 4e964ff49bb0fb1ef3d09d2b909c3ffd9e7a4dd1..0000000000000000000000000000000000000000 --- a/src/ui/QGCStatusBar.cc +++ /dev/null @@ -1,78 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009 - 2013 QGROUNDCONTROL PROJECT - -This file is part of the QGROUNDCONTROL project - - QGROUNDCONTROL 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. - - QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . - -======================================================================*/ - -#include -#include -#include -#include - -#include "QGCStatusBar.h" -#include "UASManager.h" -#include "MainWindow.h" -#include "QGCApplication.h" - -QGCStatusBar::QGCStatusBar(QWidget *parent) : - QStatusBar(parent), - player(NULL), - changed(true), - lastLogDirectory(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)) -{ - setObjectName("QGC_STATUSBAR"); - loadSettings(); -} - -void QGCStatusBar::paintEvent(QPaintEvent * event) -{ - Q_UNUSED(event); - QPainter p(this); - QStyleOption opt; - opt.initFrom(this); - style()->drawPrimitive(QStyle::PE_PanelStatusBar, &opt, &p, this); -} - -void QGCStatusBar::setLogPlayer(QGCMAVLinkLogPlayer* player) -{ - this->player = player; - addPermanentWidget(player); -} - -void QGCStatusBar::loadSettings() -{ - QSettings settings; - settings.beginGroup("QGC_MAVLINKLOGPLAYER"); - lastLogDirectory = settings.value("LAST_LOG_DIRECTORY", lastLogDirectory).toString(); - settings.endGroup(); -} - -void QGCStatusBar::storeSettings() -{ - QSettings settings; - settings.beginGroup("QGC_MAVLINKLOGPLAYER"); - settings.setValue("LAST_LOG_DIRECTORY", lastLogDirectory); - settings.endGroup(); -} - -QGCStatusBar::~QGCStatusBar() -{ - storeSettings(); -} diff --git a/src/ui/QGCStatusBar.h b/src/ui/QGCStatusBar.h deleted file mode 100644 index 20874240f8d92119dc659a2b648fded6fc68921e..0000000000000000000000000000000000000000 --- a/src/ui/QGCStatusBar.h +++ /dev/null @@ -1,59 +0,0 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009 - 2013 QGROUNDCONTROL PROJECT - -This file is part of the QGROUNDCONTROL project - - QGROUNDCONTROL 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. - - QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . - -======================================================================*/ - -#ifndef QGCSTATUSBAR_H -#define QGCSTATUSBAR_H - -#include -#include -#include -#include -#include -#include -#include "UASInterface.h" -#include "QGCMAVLinkLogPlayer.h" - -class QGCStatusBar : public QStatusBar -{ - Q_OBJECT - -public: - explicit QGCStatusBar(QWidget* parent = 0); - void addPerspectiveChangeAction(QAction* action); - ~QGCStatusBar(); - -public slots: - /** @brief Set log playing component */ - void setLogPlayer(QGCMAVLinkLogPlayer* player); - virtual void paintEvent(QPaintEvent * event); - -protected: - void storeSettings(); - void loadSettings(); - - QGCMAVLinkLogPlayer* player; - bool changed; - QString lastLogDirectory; -}; - -#endif // QGCSTATUSBAR_H diff --git a/src/ui/QGCToolBar.h b/src/ui/QGCToolBar.h index 7482c4ad461cf0ebc2a2c3ee05e39a250d04847f..e4d04836e0df8da99299c14514e3955a1510ae3f 100644 --- a/src/ui/QGCToolBar.h +++ b/src/ui/QGCToolBar.h @@ -33,7 +33,6 @@ This file is part of the QGROUNDCONTROL project #include #include #include "UASInterface.h" -#include "QGCMAVLinkLogPlayer.h" #include "SerialLink.h" class QGCToolBar : public QToolBar @@ -124,7 +123,6 @@ protected: QProgressBar* toolBarBatteryBar; QLabel* toolBarBatteryVoltageLabel; - QGCMAVLinkLogPlayer* player; QComboBox *portComboBox; QComboBox *baudcomboBox; QTimer portBoxTimer;