Some fixes:

* Cockpit, max frequency corrected to 136,975
* Text message components, tabs show cockpit frequencies
* fixed icons
* some aggresive sound for voice room joined/left, until full testing is complete
This commit is contained in:
Klaus Basan
2014-06-05 18:49:32 +02:00
parent cafc3f37f6
commit 27a697c307
7 changed files with 36 additions and 13 deletions

View File

@@ -90,7 +90,7 @@
<double>118.000000000000000</double> <double>118.000000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>136.000000000000000</double> <double>136.974999999999994</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.025000000000000</double> <double>0.025000000000000</double>
@@ -141,7 +141,7 @@
<double>118.000000000000000</double> <double>118.000000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>136.000000000000000</double> <double>136.974999999999994</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.025000000000000</double> <double>0.025000000000000</double>
@@ -175,7 +175,7 @@
<double>118.000000000000000</double> <double>118.000000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>136.000000000000000</double> <double>136.974999999999994</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.025000000000000</double> <double>0.025000000000000</double>
@@ -206,7 +206,7 @@
<double>118.000000000000000</double> <double>118.000000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>136.000000000000000</double> <double>136.974999999999994</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.025000000000000</double> <double>0.025000000000000</double>

View File

@@ -42,11 +42,6 @@ namespace BlackGui
delete ui; delete ui;
} }
void CTextMessageComponent::setToolTip(const QString &tooltipText, CTextMessageComponent::Tab tab)
{
this->getTab(tab)->setToolTip(tooltipText);
}
QWidget *CTextMessageComponent::getTab(CTextMessageComponent::Tab tab) QWidget *CTextMessageComponent::getTab(CTextMessageComponent::Tab tab)
{ {
switch (tab) switch (tab)
@@ -137,6 +132,16 @@ namespace BlackGui
} }
} }
void CTextMessageComponent::changedAircraftCockpit()
{
this->showCurrentFrequenciesFromCockpit();
}
void CTextMessageComponent::runtimeHasBeenSet()
{
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::changedAircraftCockpit);
}
/* /*
* Is the tab of the message's receiver selected? * Is the tab of the message's receiver selected?
*/ */
@@ -166,6 +171,17 @@ namespace BlackGui
} }
} }
void CTextMessageComponent::showCurrentFrequenciesFromCockpit()
{
CAircraft ownAircraft = this->getOwnAircraft();
const QString f1 = QString("COM1: %1").arg(ownAircraft.getCom1System().getFrequencyActive().valueRounded(CFrequencyUnit::MHz(), 3));
const QString f2 = QString("COM2: %1").arg(ownAircraft.getCom2System().getFrequencyActive().valueRounded(CFrequencyUnit::MHz(), 3));
this->ui->tb_TextMessagesCOM1->setToolTip(f1);
this->ui->tb_TextMessagesCOM1->setToolTip(f2);
this->setTabText(this->indexOf(this->ui->tb_TextMessagesCOM1), f1);
this->setTabText(this->indexOf(this->ui->tb_TextMessagesCOM2), f2);
}
/* /*
* Add new text message tab * Add new text message tab
*/ */

View File

@@ -34,9 +34,6 @@ namespace BlackGui
//! Destructor //! Destructor
~CTextMessageComponent(); ~CTextMessageComponent();
//! Set tooltip
void setToolTip(const QString &tooltipText, Tab tab);
//! SELCAL callback, SELCAL is obtained by that //! SELCAL callback, SELCAL is obtained by that
void setSelcalCallback(const std::function<const QString(void)> &selcalCallback) { this->m_selcalCallback = selcalCallback; } void setSelcalCallback(const std::function<const QString(void)> &selcalCallback) { this->m_selcalCallback = selcalCallback; }
@@ -55,6 +52,13 @@ namespace BlackGui
*/ */
void appendTextMessagesToGui(const BlackMisc::Network::CTextMessageList &messages, bool sending = false); void appendTextMessagesToGui(const BlackMisc::Network::CTextMessageList &messages, bool sending = false);
//! Cockpit values changed, used to updated some components
void changedAircraftCockpit();
protected:
//! \copydoc CRuntimeBasedComponent::runtimeHasBeenSet
void runtimeHasBeenSet() override;
private: private:
Ui::CTextMessageComponent *ui; Ui::CTextMessageComponent *ui;
QWidget *getTab(Tab tab); //!< enum to widget QWidget *getTab(Tab tab); //!< enum to widget
@@ -94,6 +98,9 @@ namespace BlackGui
//! Network connected? //! Network connected?
bool isNetworkConnected() const { return this->getIContextNetwork() && this->getIContextNetwork()->isConnected() ; } bool isNetworkConnected() const { return this->getIContextNetwork() && this->getIContextNetwork()->isConnected() ; }
//! Show current frequencies
void showCurrentFrequenciesFromCockpit();
private slots: private slots:
//! Close text message tab //! Close text message tab
void closeTextMessageTab(); void closeTextMessageTab();

View File

@@ -28,7 +28,7 @@ namespace BlackMisc
const QPixmap &CCallsign::convertToIcon(const CCallsign &callsign) const QPixmap &CCallsign::convertToIcon(const CCallsign &callsign)
{ {
static const QPixmap app(QPixmap(":/blackmisc/icons/aircraft_arrival.jpg").scaledToWidth(16, Qt::SmoothTransformation)); static const QPixmap app(QPixmap(":/blackmisc/icons/aircraft_arrival.jpg").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap gnd(QPixmap(":/blackmisc/icons/tower.png").scaledToWidth(16, Qt::SmoothTransformation)); static const QPixmap gnd(QPixmap(":/blackmisc/icons/gnd_framed.jpg").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap del(QPixmap(":/blackmisc/icons/aircraft_departure.jpg").scaledToWidth(16, Qt::SmoothTransformation)); static const QPixmap del(QPixmap(":/blackmisc/icons/aircraft_departure.jpg").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap twr(QPixmap(":/blackmisc/icons/tower_framed.jpg").scaledToWidth(16, Qt::SmoothTransformation)); static const QPixmap twr(QPixmap(":/blackmisc/icons/tower_framed.jpg").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap ctr(QPixmap(":/blackmisc/icons/sky.jpg").scaledToWidth(16, Qt::SmoothTransformation)); static const QPixmap ctr(QPixmap(":/blackmisc/icons/sky.jpg").scaledToWidth(16, Qt::SmoothTransformation));

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB