mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +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),
|
||||
ui(new Ui::CDbDistributorSelectorComponent)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||
ui->setupUi(this);
|
||||
this->setAcceptDrops(true);
|
||||
this->setAcceptedMetaTypeIds({qMetaTypeId<CDistributor>(), qMetaTypeId<CDistributorList>()});
|
||||
this->ui->le_Distributor->setValidator(new CUpperCaseValidator(this));
|
||||
|
||||
connect(ui->le_Distributor, &QLineEdit::returnPressed, this, &CDbDistributorSelectorComponent::ps_dataChanged);
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorSelectorComponent::ps_distributorsRead);
|
||||
bool c = connect(ui->le_Distributor, &QLineEdit::returnPressed, this, &CDbDistributorSelectorComponent::ps_dataChanged);
|
||||
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());
|
||||
}
|
||||
|
||||
CDbDistributorSelectorComponent::~CDbDistributorSelectorComponent()
|
||||
{
|
||||
//
|
||||
// void
|
||||
}
|
||||
|
||||
void CDbDistributorSelectorComponent::setDistributor(const CDistributor &distributor)
|
||||
|
||||
@@ -26,13 +26,18 @@ namespace BlackGui
|
||||
CInfoBarWebReadersStatusComponent::CInfoBarWebReadersStatusComponent(QWidget *parent) :
|
||||
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);
|
||||
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.start();
|
||||
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()
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
CTextMessageComponent::CTextMessageComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CTextMessageComponent)
|
||||
@@ -42,18 +41,28 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
|
||||
this->ui->le_textMessages->setVisible(false);
|
||||
connect(this->ui->le_textMessages, &QLineEdit::returnPressed, this, &CTextMessageComponent::ps_textMessageEntered);
|
||||
|
||||
this->ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
|
||||
|
||||
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
||||
connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
||||
connect(this, &CTextMessageComponent::commandEntered, sApp->getCoreFacade(), &CCoreFacade::parseCommandLine);
|
||||
bool c = connect(this->ui->le_textMessages, &QLineEdit::returnPressed, this, &CTextMessageComponent::ps_textMessageEntered);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
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()
|
||||
{ }
|
||||
|
||||
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
|
||||
{
|
||||
switch (tab)
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
~CTextMessageComponent();
|
||||
|
||||
//! copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
|
||||
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;
|
||||
|
||||
signals:
|
||||
//! Message to be displayed in info window
|
||||
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs) const;
|
||||
|
||||
Reference in New Issue
Block a user