mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 19:35:33 +08:00
refs #599, fixes and improvements (assert/checks) for https://dev.vatsim-germany.org/issues/599#note-5
This commit is contained in:
@@ -27,19 +27,24 @@ namespace BlackGui
|
|||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
ui(new Ui::CDbDistributorSelectorComponent)
|
ui(new Ui::CDbDistributorSelectorComponent)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setAcceptDrops(true);
|
this->setAcceptDrops(true);
|
||||||
this->setAcceptedMetaTypeIds({qMetaTypeId<CDistributor>(), qMetaTypeId<CDistributorList>()});
|
this->setAcceptedMetaTypeIds({qMetaTypeId<CDistributor>(), qMetaTypeId<CDistributorList>()});
|
||||||
this->ui->le_Distributor->setValidator(new CUpperCaseValidator(this));
|
this->ui->le_Distributor->setValidator(new CUpperCaseValidator(this));
|
||||||
|
|
||||||
connect(ui->le_Distributor, &QLineEdit::returnPressed, this, &CDbDistributorSelectorComponent::ps_dataChanged);
|
bool c = connect(ui->le_Distributor, &QLineEdit::returnPressed, this, &CDbDistributorSelectorComponent::ps_dataChanged);
|
||||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorSelectorComponent::ps_distributorsRead);
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
c = connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorSelectorComponent::ps_distributorsRead);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
Q_UNUSED(c);
|
||||||
|
|
||||||
this->ps_distributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getDistributorsCount());
|
this->ps_distributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getDistributorsCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
CDbDistributorSelectorComponent::~CDbDistributorSelectorComponent()
|
CDbDistributorSelectorComponent::~CDbDistributorSelectorComponent()
|
||||||
{
|
{
|
||||||
//
|
// void
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbDistributorSelectorComponent::setDistributor(const CDistributor &distributor)
|
void CDbDistributorSelectorComponent::setDistributor(const CDistributor &distributor)
|
||||||
|
|||||||
@@ -26,13 +26,18 @@ namespace BlackGui
|
|||||||
CInfoBarWebReadersStatusComponent::CInfoBarWebReadersStatusComponent(QWidget *parent) :
|
CInfoBarWebReadersStatusComponent::CInfoBarWebReadersStatusComponent(QWidget *parent) :
|
||||||
QFrame(parent), ui(new Ui::CInfoBarWebReadersStatusComponent)
|
QFrame(parent), ui(new Ui::CInfoBarWebReadersStatusComponent)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "No sGui");
|
||||||
|
Q_ASSERT_X(sGui->hasWebDataServices(), Q_FUNC_INFO, "No web data services");
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->initLeds();
|
this->initLeds();
|
||||||
connect(&m_timer, &QTimer::timeout, this, &CInfoBarWebReadersStatusComponent::ps_checkServerAndData);
|
bool c = connect(&m_timer, &QTimer::timeout, this, &CInfoBarWebReadersStatusComponent::ps_checkServerAndData);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||||
m_timer.setInterval(30 * 1000);
|
m_timer.setInterval(30 * 1000);
|
||||||
m_timer.start();
|
m_timer.start();
|
||||||
m_timer.setObjectName("CInfoBarWebReadersStatusComponent::CheckSwiftDbTimer");
|
m_timer.setObjectName("CInfoBarWebReadersStatusComponent::CheckSwiftDbTimer");
|
||||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CInfoBarWebReadersStatusComponent::ps_dataRead);
|
c = connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CInfoBarWebReadersStatusComponent::ps_dataRead);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||||
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
CInfoBarWebReadersStatusComponent::~CInfoBarWebReadersStatusComponent()
|
CInfoBarWebReadersStatusComponent::~CInfoBarWebReadersStatusComponent()
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
|
|
||||||
CTextMessageComponent::CTextMessageComponent(QWidget *parent) :
|
CTextMessageComponent::CTextMessageComponent(QWidget *parent) :
|
||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
ui(new Ui::CTextMessageComponent)
|
ui(new Ui::CTextMessageComponent)
|
||||||
@@ -42,18 +41,28 @@ namespace BlackGui
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
this->ui->le_textMessages->setVisible(false);
|
this->ui->le_textMessages->setVisible(false);
|
||||||
connect(this->ui->le_textMessages, &QLineEdit::returnPressed, this, &CTextMessageComponent::ps_textMessageEntered);
|
|
||||||
|
|
||||||
this->ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
|
this->ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
|
||||||
|
|
||||||
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
bool c = connect(this->ui->le_textMessages, &QLineEdit::returnPressed, this, &CTextMessageComponent::ps_textMessageEntered);
|
||||||
connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
connect(this, &CTextMessageComponent::commandEntered, sApp->getCoreFacade(), &CCoreFacade::parseCommandLine);
|
c = connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
c = connect(this, &CTextMessageComponent::commandEntered, sApp->getCoreFacade(), &CCoreFacade::parseCommandLine);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTextMessageComponent::~CTextMessageComponent()
|
CTextMessageComponent::~CTextMessageComponent()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
bool CTextMessageComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||||
|
{
|
||||||
|
bool c = CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||||
|
c = c && connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *CTextMessageComponent::getTabWidget(CTextMessageComponent::Tab tab) const
|
QWidget *CTextMessageComponent::getTabWidget(CTextMessageComponent::Tab tab) const
|
||||||
{
|
{
|
||||||
switch (tab)
|
switch (tab)
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
|||||||
//! Destructor
|
//! Destructor
|
||||||
~CTextMessageComponent();
|
~CTextMessageComponent();
|
||||||
|
|
||||||
|
//! copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
|
||||||
|
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Message to be displayed in info window
|
//! Message to be displayed in info window
|
||||||
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs) const;
|
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user