Commit c952f7b5 authored by Don Gagne's avatar Don Gagne

Remove unnecessary QGCStatusBar

The derived class wasn’t really adding any capabilties
parent 10d9e376
......@@ -413,7 +413,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 \
......@@ -556,7 +555,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 \
......
......@@ -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)
......
......@@ -416,7 +416,6 @@ protected:
QPointer<QDockWidget> hudDockWidget;
QPointer<QGCToolBar> toolBar;
QPointer<QGCStatusBar> customStatusBar;
QPointer<QDockWidget> mavlinkInspectorWidget;
QPointer<MAVLinkDecoder> mavlinkDecoder;
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2013 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
#include <QToolButton>
#include <QLabel>
#include <QSpacerItem>
#include <QFileDialog>
#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();
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2013 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef QGCSTATUSBAR_H
#define QGCSTATUSBAR_H
#include <QStatusBar>
#include <QAction>
#include <QToolButton>
#include <QPushButton>
#include <QLabel>
#include <QProgressBar>
#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
......@@ -33,7 +33,6 @@ This file is part of the QGROUNDCONTROL project
#include <QComboBox>
#include <QTimer>
#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;
......
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