From e19a9c69a31c4999b3244abcbcb696bc8771305e Mon Sep 17 00:00:00 2001 From: Gene Payne Date: Thu, 27 Jan 2022 16:18:35 -0700 Subject: [PATCH] Removed redundant callback, fixed some warnings --- .../OpenSpace/ext/launcher/include/launcherwindow.h | 2 +- .../ext/launcher/include/sgctedit/display.h | 4 +--- .../ext/launcher/include/sgctedit/windowcontrol.h | 2 +- .../OpenSpace/ext/launcher/src/sgctedit/display.cpp | 4 +--- .../ext/launcher/src/sgctedit/sgctedit.cpp | 13 ++++--------- .../ext/launcher/src/sgctedit/windowcontrol.cpp | 4 ++-- 6 files changed, 10 insertions(+), 19 deletions(-) diff --git a/apps/OpenSpace/ext/launcher/include/launcherwindow.h b/apps/OpenSpace/ext/launcher/include/launcherwindow.h index 83ac6854f5..caa6d107f0 100644 --- a/apps/OpenSpace/ext/launcher/include/launcherwindow.h +++ b/apps/OpenSpace/ext/launcher/include/launcherwindow.h @@ -89,6 +89,7 @@ private: void populateProfilesList(std::string preset); void populateWindowConfigsList(std::string preset); + QApplication& _qApp; const std::string _assetPath; const std::string _userAssetPath; const std::string _configPath; @@ -101,7 +102,6 @@ private: int _userConfigCount = 0; const std::string _sgctConfigName; - QApplication& _qApp; QComboBox* _profileBox = nullptr; QComboBox* _windowConfigBox = nullptr; QLabel* _backgroundImage = nullptr; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/display.h b/apps/OpenSpace/ext/launcher/include/sgctedit/display.h index 91ec541803..40bf35a55c 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/display.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/display.h @@ -27,8 +27,7 @@ class Display : public QWidget Q_OBJECT public: explicit Display(MonitorBox* monitorRenderBox, std::vector& monitorSizeList, - std::function webGuiCallback, unsigned int nMaxWindows, - QString* winColors); + unsigned int nMaxWindows, QString* winColors); ~Display(); std::vector windowControls(); unsigned int nWindows(); @@ -45,7 +44,6 @@ private: void initializeLayout(); void showWindows(); void addDisplayLayout(unsigned int column, MonitorBox* monBox, QVBoxLayout* layout); - std::function _webGuiCheckCallback; std::vector& _monitorResolutions; QRect _widgetDims = {0, 0, 400, 400}; QString* _winColors; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h index f95f18e06b..d941c637a9 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h @@ -122,6 +122,7 @@ private: unsigned int _nMonitors = 1; unsigned int _monIndex = 0; unsigned int _index = 0; + std::vector& _monitorResolutions; int _maxWindowSizePixels = 10000; QString* _colorsForWindows = nullptr; @@ -141,7 +142,6 @@ private: QIntValidator* _validatorOffset_x = nullptr; QIntValidator* _validatorOffset_y = nullptr; - std::vector& _monitorResolutions; QRectF _windowDims; QPushButton* _fullscreenButton = nullptr; QCheckBox* _checkBoxWindowDecor = nullptr; diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp index ec3954299a..9665846c23 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp @@ -9,11 +9,9 @@ Display::Display(MonitorBox* monitorRenderBox, std::vector& monitorSizeList, - std::function webGuiCallback, unsigned int nMaxWindows, - QString* winColors) + unsigned int nMaxWindows, QString* winColors) : _monBox(monitorRenderBox) , _monitorResolutions(monitorSizeList) - , _webGuiCheckCallback(webGuiCallback) , _nMaxWindows(nMaxWindows) , _winColors(winColors) { diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index 0e1c418b65..15b54866fc 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -8,9 +8,9 @@ namespace { SgctEdit::SgctEdit(QWidget* parent, std::vector& windowList, sgct::config::Cluster& cluster, QApplication& qtApp) - : _cluster(cluster) + : QDialog(parent) + , _cluster(cluster) , _windowList(windowList) - , QDialog(parent) { setWindowTitle("Display/Window Editor"); systemMonitorConfiguration(qtApp); @@ -23,8 +23,8 @@ void SgctEdit::systemMonitorConfiguration(QApplication& qtApp) { std::cerr << "Error: Qt reports no screens available." << std::endl; return; } - - for (size_t s = 0; s < std::min(screenList.length(), 2); ++s) { + size_t nScreensManaged = std::min(screenList.length(), 2); + for (size_t s = 0; s < nScreensManaged; ++s) { int actualWidth = std::max(screenList[s]->size().width(), screenList[s]->availableGeometry().width()); int actualHeight = std::max(screenList[s]->size().height(), @@ -92,11 +92,6 @@ void SgctEdit::addDisplayLayout(MonitorBox* monBox, QHBoxLayout* layout) _displayWidget = new Display( monBox, _monitorSizeList, - [this](unsigned int monIndex) { - if (_monitorSizeList.size() > 1) { - _displayWidget->uncheckWebGuiOptions(); - } - }, _nMaxWindows, _colorsForWindows ); diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp index cad60cb8cd..d227769900 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp @@ -5,12 +5,12 @@ WindowControl::WindowControl(unsigned int nMonitors, unsigned int monitorIndex, unsigned int windowIndex, QRect& widgetDims, std::vector& monitorDims, QString* winColors, QWidget *parent) - : _nMonitors(nMonitors) + : QWidget(parent) + , _nMonitors(nMonitors) , _monIndex(monitorIndex) , _index(windowIndex) , _monitorResolutions(monitorDims) , _colorsForWindows(winColors) - , QWidget(parent) { _windowDims = defaultWindowSizes[windowIndex]; _size_x = new QLineEdit(