diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 2ba3c145565c32b0b9886d4a129c25331e1e0169..93e3da8b278dbc27d55d3a0c4fb2dc8525794bfa 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -106,7 +106,7 @@ MainWindow* MainWindow::instance_mode(QSplashScreen* screen, enum MainWindow::CU MainWindow* MainWindow::instance(QSplashScreen* screen) { - instance_mode(screen, CUSTOM_MODE_NONE); + return instance_mode(screen, CUSTOM_MODE_UNCHANGED); } /** @@ -131,7 +131,7 @@ MainWindow::MainWindow(QWidget *parent): isAdvancedMode(false), mavlink(new MAVLinkProtocol()), dockWidgetTitleBarEnabled(true), - customMode(CUSTOM_MODE_WIFI) + customMode(CUSTOM_MODE_NONE) { this->setAttribute(Qt::WA_DeleteOnClose); //TODO: move protocol outside UI @@ -1344,6 +1344,7 @@ bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile) // And trigger any changes to other UI elements that are watching for // theme changes. emit styleChanged(style); + emit styleChanged(); // Finally restore the cursor before returning. qApp->restoreOverrideCursor(); diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index b31cc32d1c7109d9d8fe94afadde9f0673f4dbe5..08b8937ce8828ed94cad1b456197a79e54cc3349 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -98,7 +98,8 @@ class MainWindow : public QMainWindow public: enum CUSTOM_MODE { - CUSTOM_MODE_NONE = 0, + CUSTOM_MODE_UNCHANGED = 0, + CUSTOM_MODE_NONE, CUSTOM_MODE_PX4, CUSTOM_MODE_APM, CUSTOM_MODE_WIFI @@ -177,7 +178,10 @@ public: void setCustomMode(enum MainWindow::CUSTOM_MODE mode) { - customMode = mode; + if (mode != CUSTOM_MODE_UNCHANGED) + { + customMode = mode; + } } enum MainWindow::CUSTOM_MODE getCustomMode() @@ -307,6 +311,7 @@ public slots: signals: void styleChanged(MainWindow::QGC_MAINWINDOW_STYLE newTheme); + void styleChanged(); void initStatusChanged(const QString& message, int alignment, const QColor &color); #ifdef MOUSE_ENABLED_LINUX /** @brief Forward X11Event to catch 3DMouse inputs */ @@ -502,6 +507,7 @@ protected: bool lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets QGCFlightGearLink* fgLink; QTimer windowNameUpdateTimer; + CUSTOM_MODE customMode; private: QList commsWidgetList; @@ -511,7 +517,6 @@ private: QMap > centralWidgetToDockWidgetsMap; bool isAdvancedMode; ///< If enabled dock widgets can be moved and floated. bool dockWidgetTitleBarEnabled; ///< If enabled, dock widget titlebars are displayed when NOT in advanced mode. - CUSTOM_MODE customMode; Ui::MainWindow ui; /** @brief Set the appropriate titlebar for a given dock widget. diff --git a/src/ui/linechart/LinechartWidget.cc b/src/ui/linechart/LinechartWidget.cc index e29b655321f24f339aed0d6dfc60ba2a854df252..53dcac360cb7fe268483dfc9abc80c845d2708f6 100644 --- a/src/ui/linechart/LinechartWidget.cc +++ b/src/ui/linechart/LinechartWidget.cc @@ -137,14 +137,7 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent // Create the layout createLayout(); - // Add the last actions - //connect(this, SIGNAL(plotWindowPositionUpdated(int)), scrollbar, SLOT(setValue(int))); - //connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(setPlotWindowPosition(int))); - - // And make sure we're listening for future style changes - connect(MainWindow::instance(), SIGNAL(styleChanged(MainWindow::QGC_MAINWINDOW_STYLE)), - this, SLOT(styleChanged(MainWindow::QGC_MAINWINDOW_STYLE))); connect(MainWindow::instance(), SIGNAL(styleChanged()), this, SLOT(recolor())); updateTimer->setInterval(updateInterval);