mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 03:45:30 +08:00
refs #335, indicator for valid SELCAL code
This commit is contained in:
committed by
Roland Winklmeier
parent
ae79af5300
commit
f4e8b40bf9
@@ -10,7 +10,9 @@
|
|||||||
#include "selcalcodeselector.h"
|
#include "selcalcodeselector.h"
|
||||||
#include "ui_selcalcodeselector.h"
|
#include "ui_selcalcodeselector.h"
|
||||||
#include "blackmisc/avselcal.h"
|
#include "blackmisc/avselcal.h"
|
||||||
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
@@ -20,12 +22,14 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
this->ui->setupUi(this);
|
this->ui->setupUi(this);
|
||||||
this->resetSelcalCodes(true);
|
this->resetSelcalCodes(true);
|
||||||
|
this->setValidityHint();
|
||||||
|
|
||||||
bool c;
|
bool c;
|
||||||
c = connect(this->ui->cb_SelcalPairs1, SIGNAL(currentIndexChanged(int)), this, SIGNAL(valueChanged()));
|
c = connect(this->ui->cb_SelcalPairs1, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged()));
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(this->ui->cb_SelcalPairs2, SIGNAL(currentIndexChanged(int)), this, SIGNAL(valueChanged()));
|
c = connect(this->ui->cb_SelcalPairs2, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged()));
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSelcalCodeSelector::~CSelcalCodeSelector()
|
CSelcalCodeSelector::~CSelcalCodeSelector()
|
||||||
@@ -90,4 +94,24 @@ namespace BlackGui
|
|||||||
this->ui->cb_SelcalPairs1->setCurrentIndex(0);
|
this->ui->cb_SelcalPairs1->setCurrentIndex(0);
|
||||||
this->ui->cb_SelcalPairs2->setCurrentIndex(0);
|
this->ui->cb_SelcalPairs2->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void CSelcalCodeSelector::ps_selcalIndexChanged()
|
||||||
|
{
|
||||||
|
this->setValidityHint();
|
||||||
|
emit valueChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSelcalCodeSelector::setValidityHint()
|
||||||
|
{
|
||||||
|
if (this->hasValidCode())
|
||||||
|
{
|
||||||
|
this->ui->lbl_ValidCodeIcon->setPixmap(CIcons::tick16());
|
||||||
|
this->ui->lbl_ValidCodeIcon->setToolTip("valid SELCAL");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->ui->lbl_ValidCodeIcon->setPixmap(CIcons::cross16());
|
||||||
|
this->ui->lbl_ValidCodeIcon->setToolTip("invalid SELCAL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|||||||
@@ -57,8 +57,15 @@ namespace BlackGui
|
|||||||
//! Value has been changed
|
//! Value has been changed
|
||||||
void valueChanged();
|
void valueChanged();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
//! SELCAL changed
|
||||||
|
void ps_selcalIndexChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CSelcalCodeSelector> ui;
|
QScopedPointer<Ui::CSelcalCodeSelector> ui;
|
||||||
|
|
||||||
|
//! Set valid/invalid icon
|
||||||
|
void setValidityHint();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,26 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="cb_SelcalPairs2"/>
|
<widget class="QComboBox" name="cb_SelcalPairs2"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ValidCodeIcon">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../blackmisc/blackmisc.qrc">:/diagona/icons/diagona/icons/tick-button.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../blackmisc/blackmisc.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user