Removed redundant callback, fixed some warnings

This commit is contained in:
Gene Payne
2022-01-27 16:18:35 -07:00
parent 025b61f7af
commit e19a9c69a3
6 changed files with 10 additions and 19 deletions
@@ -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;
@@ -27,8 +27,7 @@ class Display : public QWidget
Q_OBJECT
public:
explicit Display(MonitorBox* monitorRenderBox, std::vector<QRect>& monitorSizeList,
std::function<void(unsigned int)> webGuiCallback, unsigned int nMaxWindows,
QString* winColors);
unsigned int nMaxWindows, QString* winColors);
~Display();
std::vector<WindowControl*> windowControls();
unsigned int nWindows();
@@ -45,7 +44,6 @@ private:
void initializeLayout();
void showWindows();
void addDisplayLayout(unsigned int column, MonitorBox* monBox, QVBoxLayout* layout);
std::function<void(unsigned int)> _webGuiCheckCallback;
std::vector<QRect>& _monitorResolutions;
QRect _widgetDims = {0, 0, 400, 400};
QString* _winColors;
@@ -122,6 +122,7 @@ private:
unsigned int _nMonitors = 1;
unsigned int _monIndex = 0;
unsigned int _index = 0;
std::vector<QRect>& _monitorResolutions;
int _maxWindowSizePixels = 10000;
QString* _colorsForWindows = nullptr;
@@ -141,7 +142,6 @@ private:
QIntValidator* _validatorOffset_x = nullptr;
QIntValidator* _validatorOffset_y = nullptr;
std::vector<QRect>& _monitorResolutions;
QRectF _windowDims;
QPushButton* _fullscreenButton = nullptr;
QCheckBox* _checkBoxWindowDecor = nullptr;
@@ -9,11 +9,9 @@
Display::Display(MonitorBox* monitorRenderBox, std::vector<QRect>& monitorSizeList,
std::function<void(unsigned int)> webGuiCallback, unsigned int nMaxWindows,
QString* winColors)
unsigned int nMaxWindows, QString* winColors)
: _monBox(monitorRenderBox)
, _monitorResolutions(monitorSizeList)
, _webGuiCheckCallback(webGuiCallback)
, _nMaxWindows(nMaxWindows)
, _winColors(winColors)
{
@@ -8,9 +8,9 @@ namespace {
SgctEdit::SgctEdit(QWidget* parent, std::vector<sgct::config::Window>& 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
);
@@ -5,12 +5,12 @@
WindowControl::WindowControl(unsigned int nMonitors, unsigned int monitorIndex,
unsigned int windowIndex, QRect& widgetDims, std::vector<QRect>& 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(