From 1f5eb16bb103d01f699bfad11f3083b3e92c6a73 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 10 Apr 2015 00:04:28 +0200 Subject: [PATCH] refs #400, 2nd stage for Qt 541 * GUI finetuning after folder split and migration to Qt 5.4.1 * Doxygen fixes --- .../components/audiosetupcomponent.ui | 23 +- .../components/invisibleinfoareacomponent.ui | 12 + .../components/maininfoareacomponent.ui | 6 +- .../components/navigatordockwidget.cpp | 1 + src/blackgui/components/settingscomponent.ui | 110 ++-- .../components/settingsfsxcomponent.cpp | 45 +- .../components/settingsfsxcomponent.h | 3 +- .../components/settingsfsxcomponent.ui | 330 ++++++----- .../components/settingssimulatorcomponent.ui | 513 +++++++++--------- src/blackgui/enableforframelesswindow.h | 2 +- src/blackgui/qss/mainwindow.qss | 1 + src/swiftgui_standard/swiftguistd.ui | 12 +- 12 files changed, 597 insertions(+), 461 deletions(-) diff --git a/src/blackgui/components/audiosetupcomponent.ui b/src/blackgui/components/audiosetupcomponent.ui index bb89231c6..954abf7fb 100644 --- a/src/blackgui/components/audiosetupcomponent.ui +++ b/src/blackgui/components/audiosetupcomponent.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 263 + 343 @@ -68,14 +68,23 @@ - + 0 0 + + + 16777215 + 16777215 + + QComboBox::AdjustToMinimumContentsLength + + true + @@ -88,11 +97,17 @@ - + 0 0 + + + 16777215 + 16777215 + + QComboBox::AdjustToMinimumContentsLength diff --git a/src/blackgui/components/invisibleinfoareacomponent.ui b/src/blackgui/components/invisibleinfoareacomponent.ui index 1044e675b..659f0ce5a 100644 --- a/src/blackgui/components/invisibleinfoareacomponent.ui +++ b/src/blackgui/components/invisibleinfoareacomponent.ui @@ -15,6 +15,18 @@ + + + 80 + 80 + + + + false + + + QDockWidget::AllDockWidgetFeatures + Qt::LeftDockWidgetArea diff --git a/src/blackgui/components/maininfoareacomponent.ui b/src/blackgui/components/maininfoareacomponent.ui index e5f664b21..71f65c5f4 100644 --- a/src/blackgui/components/maininfoareacomponent.ui +++ b/src/blackgui/components/maininfoareacomponent.ui @@ -376,7 +376,7 @@ 0 - 0 + 2 0 @@ -523,7 +523,7 @@ 0 - 0 + 2 0 @@ -572,7 +572,7 @@ 0 - 0 + 2 0 diff --git a/src/blackgui/components/navigatordockwidget.cpp b/src/blackgui/components/navigatordockwidget.cpp index 4ba6bf9a9..648300633 100644 --- a/src/blackgui/components/navigatordockwidget.cpp +++ b/src/blackgui/components/navigatordockwidget.cpp @@ -20,6 +20,7 @@ namespace BlackGui CDockWidgetInfoArea(parent), ui(new Ui::CNavigatorDockWidget) { + this->allowStatusBar(false); ui->setupUi(this); } diff --git a/src/blackgui/components/settingscomponent.ui b/src/blackgui/components/settingscomponent.ui index 35f5773b4..166574cb9 100644 --- a/src/blackgui/components/settingscomponent.ui +++ b/src/blackgui/components/settingscomponent.ui @@ -92,19 +92,19 @@ - 0 + 2 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 @@ -124,19 +124,19 @@ - 0 + 2 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 @@ -156,13 +156,13 @@ - 1 + 3 - 1 + 3 - 1 + 3 1 @@ -182,7 +182,7 @@ - + 0 0 @@ -214,7 +214,7 @@ - + 0 0 @@ -255,7 +255,7 @@ - + 0 0 @@ -293,7 +293,7 @@ - + 0 0 @@ -327,12 +327,6 @@ - - - 0 - 0 - - QComboBox::AdjustToMinimumContentsLength @@ -347,6 +341,12 @@ + + + 150 + 16777215 + + 6 @@ -403,6 +403,12 @@ + + + 150 + 16777215 + + normal @@ -433,28 +439,42 @@ - - - - - ... - - - - - - - - 0 - 0 - - - - true - - - - + + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + ... + + + + + + + 200 + + + true + + + + + diff --git a/src/blackgui/components/settingsfsxcomponent.cpp b/src/blackgui/components/settingsfsxcomponent.cpp index 1afb39ed4..d419b1ca5 100644 --- a/src/blackgui/components/settingsfsxcomponent.cpp +++ b/src/blackgui/components/settingsfsxcomponent.cpp @@ -11,6 +11,7 @@ #include "ui_settingsfsxcomponent.h" #include "blackcore/context_simulator.h" #include "blackcore/context_application.h" +#include "blackmisc/simulation/fsx/simconnectutilities.h" #include "blackmisc/networkutils.h" #include "blackmisc/statusmessage.h" #include "blackmisc/logmessage.h" @@ -42,9 +43,7 @@ namespace BlackGui } CSettingsFsxComponent::~CSettingsFsxComponent() - { - delete ui; - } + { } /* * SimConnect working? @@ -56,28 +55,28 @@ namespace BlackGui if (address.isEmpty() || port.isEmpty()) { - CLogMessage(this).warning("no address or port"); + CLogMessage(this).validationWarning("No address or port"); return; } if (!CNetworkUtils::isValidIPv4Address(address)) { - CLogMessage(this).warning("IPv4 address invalid"); + CLogMessage(this).validationWarning("IPv4 address invalid"); return; } if (!CNetworkUtils::isValidPort(port)) { - CLogMessage(this).warning("invalid port"); + CLogMessage(this).validationWarning("Invalid port"); return; } int p = port.toInt(); QString msg; if (!CNetworkUtils::canConnect(address, p, msg)) { - CLogMessage(this).warning(msg); + CLogMessage(this).validationWarning(msg); return; } - CLogMessage(this).info("Connected to %1:%2") << address << port; + CLogMessage(this).validationInfo("Connected to %1:%2") << address << port; } /* @@ -85,9 +84,9 @@ namespace BlackGui */ void CSettingsFsxComponent::saveSimConnectCfg() { - if (!this->getIContextSimulator() || !this->getIContextSimulator()->isSimulatorAvailable()) + if (!this->getIContextSimulator()) { - CLogMessage(this).error("Simulator not available"); + CLogMessage(this).validationError("Simulator driver not available"); return; } QString address = this->ui->le_SettingsFsxAddress->text().trimmed(); @@ -95,22 +94,27 @@ namespace BlackGui if (address.isEmpty() || port.isEmpty()) { - CLogMessage(this).warning("no address or port"); + CLogMessage(this).validationError("No address or port"); return; } if (!CNetworkUtils::isValidIPv4Address(address)) { - CLogMessage(this).warning("IPv4 address invalid"); + CLogMessage(this).validationError("IPv4 address invalid"); return; } if (!CNetworkUtils::isValidPort(port)) { - CLogMessage(this).warning("invalid port"); + CLogMessage(this).validationError("Invalid port"); return; } int p = port.toInt(); QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile); - Q_ASSERT(!fileName.isEmpty()); + if (fileName.isEmpty()) + { + CLogMessage(this).validationError("Invalid filename or filename empty"); + return; + } + // write either local or remote file bool localSimulatorObject = this->getIContextSimulator()->isUsingImplementingObject(); bool success = localSimulatorObject ? @@ -118,11 +122,11 @@ namespace BlackGui this->getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p)); if (success) { - CLogMessage(this).info(localSimulatorObject ? "Written local %1" : "Written remote %1") << fileName; + CLogMessage(this).validationInfo(localSimulatorObject ? "Written local %1" : "Written remote %1") << fileName; } else { - CLogMessage(this).error("Cannot write %1") << fileName; + CLogMessage(this).validationError("Cannot write %1") << fileName; } this->ui->pb_SettingsFsxExistsSimconncetCfg->click(); // update status } @@ -132,9 +136,9 @@ namespace BlackGui */ void CSettingsFsxComponent::simConnectCfgFile() { - if (!this->getIContextSimulator() || !this->getIContextSimulator()->isSimulatorAvailable()) + if (!this->getIContextSimulator()) { - CLogMessage(this).error("Simulator not available"); + CLogMessage(this).validationError("Simulator driver not available"); return; } @@ -149,7 +153,6 @@ namespace BlackGui { if (!this->getIContextSimulator()) return; QString fileName = BlackMisc::Simulation::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename(); - QString m = QString("Deleted %1 ").append(fileName); if (this->getIContextSimulator()->isUsingImplementingObject()) { QFile f(fileName); @@ -180,5 +183,5 @@ namespace BlackGui } } } - } -} + } // ns +} // ns diff --git a/src/blackgui/components/settingsfsxcomponent.h b/src/blackgui/components/settingsfsxcomponent.h index be816c533..495afe5e6 100644 --- a/src/blackgui/components/settingsfsxcomponent.h +++ b/src/blackgui/components/settingsfsxcomponent.h @@ -14,6 +14,7 @@ #include "blackgui/components/enableforruntime.h" #include +#include namespace Ui { class CSettingsFsxComponent; } @@ -44,7 +45,7 @@ namespace BlackGui void simConnectCfgFile(); private: - Ui::CSettingsFsxComponent *ui; + QScopedPointer ui; }; } } diff --git a/src/blackgui/components/settingsfsxcomponent.ui b/src/blackgui/components/settingsfsxcomponent.ui index 970265893..64d50e89b 100644 --- a/src/blackgui/components/settingsfsxcomponent.ui +++ b/src/blackgui/components/settingsfsxcomponent.ui @@ -6,10 +6,16 @@ 0 0 - 324 - 150 + 317 + 141 + + + 16777215 + 16777215 + + Frame @@ -21,7 +27,7 @@ - 6 + 0 0 @@ -36,153 +42,217 @@ 0 - - - QFormLayout::AllNonFixedFieldsGrow + + + FSX SimConnect config file - - - - FSX address - - - - - - - 127.0.0.1 - - - - - - - FSX port - - - - - - - 500 - - - - - - - - - - 0 - 0 - + + + + + FSX address + + + + + + + + 0 + 0 + + + + 127.0.0.1 + + + 128 + + + + + + + FSX port + + + + + + + + 0 + 0 + + + + 500 + + + + + + + is 'SimConnect.cfg' available? + + + .cfg? + + + + + + + + 4 - - Open + + 0 - - - - - - - 0 - 0 - + + 0 - - Delete + + 0 - - - - - - - 0 - 0 - + + 0 - - Save - - - - - - - - 0 - 0 - - - - Test con. - - - - - - - - - "simconnect.cfg"? - - - - - - + + + + + 0 + 0 + + + + true + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + check + + + + + + + + - 4 - - - 0 - - - 0 - - - 0 - - - 0 + 3 - - - true - - - - - + 0 0 + + + 50 + 0 + + - Check + open + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + del. + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + save + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Test connection + + + test - - - - - - "simconnect.cfg" exists? - - - <html><head/><body><p><span style=" font-size:10pt; font-weight:600;">FSX simconnect config files</span></p></body></html> - - - - + + + diff --git a/src/blackgui/components/settingssimulatorcomponent.ui b/src/blackgui/components/settingssimulatorcomponent.ui index 28731bf34..af2f0b317 100644 --- a/src/blackgui/components/settingssimulatorcomponent.ui +++ b/src/blackgui/components/settingssimulatorcomponent.ui @@ -6,233 +6,132 @@ 0 0 - 308 - 285 + 377 + 346 Frame - QFrame::StyledPanel + QFrame::NoFrame - QFrame::Raised + QFrame::Plain + + + 0 - + 2 - - 0 - - 0 + 2 - 0 + 2 - 0 + 2 - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 10 - - - 6 - - - - - <html><head/><body><p><span style=" font-size:10pt; font-weight:600;">All simulators</span></p></body></html> + + + + QFormLayout::AllNonFixedFieldsGrow + + + 10 + + + 6 + + + + + Driver + + + + + + + + 16777215 + 16777215 + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + Time synchronization + + + Time synch. + + + + + + + + 0 - - - - - - Driver + + 0 - - - - - - QComboBox::AdjustToMinimumContentsLength + + 0 - - - - - - Time synchronization - - - Time synch. - - - - - - - - 4 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - false - - - - - - - - 0 - 0 - - - - - 75 - 16777215 - - - - offset +/-hh:mm - - - #99:99 - - - +00:00 - - - 6 - - - - - - - - 0 - 0 - - - - - 75 - 0 - - - - - 75 - 16777215 - - - - apply - - - - - - - - - - Current rendering restrictions (if any) - - - Restrictions - - - - - - - 4 + + 0 - - - - + + + Enable time syncronization + - rest.text goes here + - + - + 0 0 - - - 75 - 0 - - 75 16777215 + + offset +/-hh:mm + + + #99:99 + - clear + +00:00 - - - - - - - - Max.aircraft - - - - - - - 4 - - - - - 100 + + 6 - + 0 @@ -241,13 +140,13 @@ - 75 + 60 0 - 75 + 60 16777215 @@ -257,73 +156,191 @@ - - - - - Max.distance (NM) - - - - - - - 4 - - - - - 100 - - - 100 - - - - - - - - 0 - 0 - - - - - 75 - 0 - - - - - 75 - 16777215 - - - - apply - - - - - - - - + + + + + + Current rendering restrictions (if any) + + + Restrictions + + + + + + + 4 + + + + + + + + rest.text goes here + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + clear + + + + + + + + + Max.aircraft + + + + + + + 4 + + + + + 100 + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + apply + + + + + + + + + Max.distance (NM) + + + + + + + 4 + + + + + 100 + + + 100 + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + apply + + + + + + + - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + diff --git a/src/blackgui/enableforframelesswindow.h b/src/blackgui/enableforframelesswindow.h index 49a0aade9..3ff969f9f 100644 --- a/src/blackgui/enableforframelesswindow.h +++ b/src/blackgui/enableforframelesswindow.h @@ -75,7 +75,7 @@ namespace BlackGui WindowMode m_windowMode = WindowNormal; //!< Window mode, \sa WindowMode bool m_mainApplicationWindow = false; //!< is the main application window (only 1) QWidget *m_widget = nullptr; //!< corresponding main window or dock widget - QSizeGrip *m_framelessSizeGrip = nullptr; + QSizeGrip *m_framelessSizeGrip = nullptr; //!< size grip object //! Mouse press, required for frameless window bool handleMousePressEvent(QMouseEvent *event); diff --git a/src/blackgui/qss/mainwindow.qss b/src/blackgui/qss/mainwindow.qss index f466cc8c6..18f65833d 100644 --- a/src/blackgui/qss/mainwindow.qss +++ b/src/blackgui/qss/mainwindow.qss @@ -326,6 +326,7 @@ QComboBox { QComboBox QAbstractItemView { background-color: lightgray; color: black; + qproperty-textElideMode: ElideMiddle; } QDoubleSpinBox { diff --git a/src/swiftgui_standard/swiftguistd.ui b/src/swiftgui_standard/swiftguistd.ui index 0105d0f51..3ff1b4ee2 100644 --- a/src/swiftgui_standard/swiftguistd.ui +++ b/src/swiftgui_standard/swiftguistd.ui @@ -18,16 +18,12 @@ - 20 - 100 + 325 + 550 - Black GUI - - - - :/blackgui/icons/aircraftdeparture.png:/blackgui/icons/aircraftdeparture.png + swift GUI @@ -128,7 +124,7 @@ QFrame::NoFrame - 3 + 0