Misc. smaller UI adjustments/style

This commit is contained in:
Klaus Basan
2019-01-02 06:43:26 +01:00
committed by Mat Sutcliffe
parent e85680f1b0
commit cd095dbb3f
11 changed files with 130 additions and 138 deletions

View File

@@ -2,14 +2,6 @@
<ui version="4.0">
<class>CColorSelector</class>
<widget class="QFrame" name="CColorSelector">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>136</width>
<height>24</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>140</width>
@@ -22,12 +14,6 @@
<property name="whatsThis">
<string>select a color</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="hl_ColorSelector">
<property name="leftMargin">
<number>0</number>
@@ -77,19 +63,6 @@
</property>
</widget>
</item>
<item>
<spacer name="hs_ColorSelector">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>

View File

@@ -2,14 +2,6 @@
<ui version="4.0">
<class>CDbAircraftIcaoComponent</class>
<widget class="QFrame" name="CDbAircraftIcaoComponent">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Search and find aircraft ICAO codes</string>
</property>
@@ -46,11 +38,8 @@
<height>100</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>

View File

@@ -20,6 +20,7 @@
using namespace BlackCore;
using namespace BlackGui::Views;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::Network;
namespace BlackGui
@@ -57,7 +58,7 @@ namespace BlackGui
ui->filter_Livery->filter(livery);
}
void CDbLiveryComponent::filterByAirline(const BlackMisc::Aviation::CAirlineIcaoCode &icao)
void CDbLiveryComponent::filterByAirline(const CAirlineIcaoCode &icao)
{
ui->filter_Livery->filter(icao);
}

View File

@@ -41,8 +41,14 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item alignment="Qt::AlignLeft">
<widget class="BlackGui::Filters::CLiveryFilterBar" name="filter_Livery">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>

View File

@@ -16,6 +16,7 @@
#include "blackgui/views/distributorview.h"
#include "blackgui/uppercasevalidator.h"
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
#include "blackcore/webdataservices.h"
#include "blackcore/db/databasewriter.h"
@@ -44,6 +45,8 @@ namespace BlackGui
ui->selector_AirlineIcaoCode->displayWithIcaoDescription(false);
ui->editor_AircraftModel->allowDrop(false);
ui->editor_AircraftModel->setReadOnly(true);
CGuiUtility::checkBoxReadOnly(ui->cb_Military, true);
CGuiUtility::checkBoxReadOnly(ui->cb_VirtualAirline, true);
connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &CDbQuickMappingWizard::onWebDataRead, Qt::QueuedConnection);
connect(sGui->getWebDataServices()->getDatabaseWriter(), &CDatabaseWriter::publishedModels, this, &CDbQuickMappingWizard::onPublishedModels, Qt::QueuedConnection);
@@ -118,12 +121,12 @@ namespace BlackGui
ui->rb_ColorLivery->setChecked(true);
}
this->m_model = model;
m_model = model;
}
void CDbQuickMappingWizard::clear()
{
this->m_lastId = 0;
m_lastId = 0;
ui->editor_AircraftModel->clear();
ui->comp_Log->clear();
this->restart();
@@ -201,9 +204,9 @@ namespace BlackGui
void CDbQuickMappingWizard::currentWizardPageChanged(int id)
{
const bool forward = id > this->m_lastId;
const bool forward = id > m_lastId;
const bool colorMode = ui->rb_ColorLivery->isChecked();
this->m_lastId = id;
m_lastId = id;
const Pages page = static_cast<Pages>(id);
switch (page)
@@ -251,9 +254,15 @@ namespace BlackGui
ui->comp_Log->clear();
}
break;
case PageLastConfirmation:
{
// void
}
break;
case PageSendStatus:
{
this->writeModelToDb();
this->button(BackButton)->hide();
}
break;
default:
@@ -301,17 +310,17 @@ namespace BlackGui
void CDbQuickMappingWizard::consolidateModel()
{
CAircraftModel model = this->m_model;
CAircraftModel model = m_model;
model.setAircraftIcaoCode(ui->editor_AircraftModel->getAircraftIcao());
model.setDistributor(ui->editor_AircraftModel->getDistributor());
model.setLivery(ui->editor_AircraftModel->getLivery());
this->m_model = model;
m_model = model;
}
void CDbQuickMappingWizard::writeModelToDb()
{
this->consolidateModel();
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(this->m_model);
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(m_model);
ui->comp_Log->appendStatusMessagesToList(msgs);
}

View File

@@ -38,8 +38,9 @@ namespace BlackGui
PageColor,
PageLiverySelect,
PageDistributorSelect,
PageConfirmation,
PageConfirmation, //!< model from and validation
PageCredentials,
PageLastConfirmation, //!< just info to say data will be send
PageSendStatus
};
@@ -102,9 +103,9 @@ namespace BlackGui
//! Models published
void onPublishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished,
const BlackMisc::Simulation::CAircraftModelList &modelsSkipped,
const BlackMisc::CStatusMessageList &messages,
bool requestSuccessful, bool directWrite);
const BlackMisc::Simulation::CAircraftModelList &modelsSkipped,
const BlackMisc::CStatusMessageList &messages,
bool requestSuccessful, bool directWrite);
//! Web data have been read
void onWebDataRead();

View File

@@ -188,6 +188,47 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="wi_HintAirlineIcao" native="true">
<layout class="QHBoxLayout" name="hl_HintAirlineIcao">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lbl_HintIconAirlineIcao">
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../blackmisc/blackmisc.qrc">:/pastel/icons/pastel/16/infomation.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_HintAirlineIcao">
<property name="text">
<string>Hint: Start virtual airlines with &quot;V&quot;, e.g. &quot;VLHA&quot;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="fr_IntroAirlineSelection">
<layout class="QFormLayout" name="fl_AircraftIcaoIntro">
@@ -242,7 +283,14 @@
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="cb_VirtualAirline"/>
<widget class="QCheckBox" name="cb_VirtualAirline">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lbl_Military">
@@ -252,47 +300,13 @@
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="cb_Military"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="wi_HintAirlineIcao" native="true">
<layout class="QHBoxLayout" name="hl_HintAirlineIcao">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lbl_HintIconAirlineIcao">
<widget class="QCheckBox" name="cb_Military">
<property name="maximumSize">
<size>
<width>20</width>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../blackmisc/blackmisc.qrc">:/pastel/icons/pastel/16/infomation.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_HintAirlineIcao">
<property name="text">
<string>Hint: Start virtual airlines with &quot;V&quot;, e.g. &quot;VLHA&quot;</string>
</property>
</widget>
</item>
</layout>
@@ -356,25 +370,34 @@
</widget>
</item>
<item>
<widget class="BlackGui::Components::CDbLiveryColorSearch" name="comp_ColorSearch">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<widget class="QGroupBox" name="gb_ColorSearch">
<property name="title">
<string>Select color</string>
</property>
<layout class="QVBoxLayout" name="vl_ColorSearch">
<item>
<widget class="BlackGui::Components::CDbLiveryColorSearch" name="comp_ColorSearch">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@@ -408,7 +431,14 @@
</property>
<layout class="QVBoxLayout" name="vl_DistributorPage">
<item>
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributor"/>
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributor">
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>

View File

@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
<string>Aircraft model form</string>
</property>
<layout class="QHBoxLayout" name="vl_AircraftModelForm" stretch="1,1">
<property name="leftMargin">
@@ -28,12 +28,6 @@
</property>
<item>
<widget class="QFrame" name="fr_AircraftModelLeft">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="vl_AircraftModelFormLeft">
<property name="leftMargin">
<number>0</number>
@@ -125,12 +119,6 @@
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>

View File

@@ -32,10 +32,10 @@ namespace BlackGui
this->setFrameStyle(QFrame::StyledPanel);
this->setFrameShadow(QFrame::Raised);
this->setAutoFillBackground(true);
this->m_originalStyleSheet = this->styleSheet();
connect(&this->m_resetTimer, &QTimer::timeout, this, &CValidationIndicator::clear);
this->m_resetTimer.setObjectName(this->objectName().append(":").append("resetTimer"));
this->m_resetTimer.start(ResetInterval);
m_originalStyleSheet = this->styleSheet();
connect(&m_resetTimer, &QTimer::timeout, this, &CValidationIndicator::clear);
m_resetTimer.setObjectName(this->objectName().append(":").append("resetTimer"));
m_resetTimer.start(ResetInterval);
}
CValidationIndicator::~CValidationIndicator()
@@ -44,27 +44,27 @@ namespace BlackGui
void CValidationIndicator::passed()
{
this->show();
setBackgroundColor("green");
this->setBackgroundColor("green");
ui->lbl_Icon->setPixmap(CIcons::tick16());
}
void CValidationIndicator::failed()
{
this->show();
setBackgroundColor("red");
this->setBackgroundColor("red");
ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityError));
}
void CValidationIndicator::warnings()
{
this->show();
setBackgroundColor("yellow");
this->setBackgroundColor("yellow");
ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityWarning));
}
void CValidationIndicator::clear()
{
setBackgroundColor("");
this->setBackgroundColor("");
ui->lbl_Icon->clear();
this->hide();
}
@@ -107,7 +107,7 @@ namespace BlackGui
{
if (colorName.isEmpty())
{
this->setStyleSheet(this->m_originalStyleSheet);
this->setStyleSheet(m_originalStyleSheet);
}
else
{

View File

@@ -20,8 +20,7 @@
#include <QScopedPointer>
#include <memory>
class QWidget;
namespace Ui { class CAircraftIcaoFilterBar; }
namespace BlackMisc
{
namespace Aviation
@@ -30,7 +29,6 @@ namespace BlackMisc
class CAircraftIcaoCodeList;
}
}
namespace Ui { class CAircraftIcaoFilterBar; }
namespace BlackGui
{
namespace Filters
@@ -40,7 +38,7 @@ namespace BlackGui
*/
class BLACKGUI_EXPORT CAircraftIcaoFilterBar :
public CFilterWidget,
public BlackGui::Models::IModelFilterProvider<BlackMisc::Aviation::CAircraftIcaoCodeList>
public Models::IModelFilterProvider<BlackMisc::Aviation::CAircraftIcaoCodeList>
{
Q_OBJECT

View File

@@ -278,10 +278,7 @@ namespace BlackGui
const QString c = combinedStyleAndWeight.toLower();
for (const QString &w : fontWeights())
{
if (c.contains(w))
{
return w;
}
if (c.contains(w)) { return w; }
}
return n;
}