refs #394, LED to display when mapper is ready

* function in context for models count
* adjusted status bar component
* in same step: menu to toggle "window on top"
This commit is contained in:
Klaus Basan
2015-03-21 02:42:46 +01:00
parent 3c077ef579
commit 66da4d7353
13 changed files with 83 additions and 16 deletions

View File

@@ -47,6 +47,7 @@ namespace BlackGui
this->ui->led_DBus->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DBus connected", "DBus disconnected", 14);
this->ui->led_Network->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Network connected", "Network disconnected", 14);
this->ui->led_Simulator->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Simulator running", "Simulator disconnected", "Simulator connected", 14);
this->ui->led_MapperReady->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Mapper ready", "Mappings loading", "Mappings loading", 14);
shape = CLedWidget::Rounded;
this->ui->led_Ptt->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Ptt", "Silence", 18);
@@ -75,6 +76,7 @@ namespace BlackGui
if (this->getIContextSimulator())
{
connect(this->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this, &CInfoBarStatusComponent::ps_onSimulatorStatusChanged);
connect(this->getIContextSimulator(), &IContextSimulator::installedAircraftModelsChanged, this, &CInfoBarStatusComponent::ps_onMapperReady);
}
if (this->getIContextNetwork())
@@ -92,7 +94,6 @@ namespace BlackGui
{
this->ui->led_Audio->setOn(!this->getIContextAudio()->isMuted());
connect(getIContextAudio(), &IContextAudio::changedMute, this, &CInfoBarStatusComponent::ps_onMuteChanged);
// connect(getIContextAudio(), &IContextAudio::changedAudioVolumes, this, &CInfoBarStatusComponent::ps_onVolumesChanged);
}
}
@@ -169,15 +170,21 @@ namespace BlackGui
}
}
void CInfoBarStatusComponent::ps_onVolumesChanged(qint32 com1Volume, qint32 com2Volume)
{
bool pseudoMute = (com1Volume < 1 && com2Volume < 1);
this->ps_onMuteChanged(pseudoMute);
}
void CInfoBarStatusComponent::ps_onMuteChanged(bool muted)
{
this->ui->led_Audio->setOn(!muted);
}
void CInfoBarStatusComponent::ps_onMapperReady()
{
if (!getIContextSimulator())
{
this->ui->led_MapperReady->setOn(false);
return;
}
bool on = this->getIContextSimulator()->getInstalledModelsCount() > 0;
this->ui->led_MapperReady->setOn(on);
}
} // namespace
} // namespace

View File

@@ -62,11 +62,11 @@ namespace BlackGui
//! Context menu requested
void ps_customAudioContextMenuRequested(const QPoint &position);
//! Volumes changed 0..100
void ps_onVolumesChanged(qint32 com1Volume, qint32 com2Volume);
//! Mute changed
void ps_onMuteChanged(bool muted);
//! Mapper is ready
void ps_onMapperReady();
};
}
}

View File

@@ -25,7 +25,7 @@
</property>
<layout class="QHBoxLayout" name="hl_InfoBarStatus">
<property name="spacing">
<number>3</number>
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
@@ -51,7 +51,7 @@
<string>Network</string>
</property>
<property name="text">
<string>Net</string>
<string>nt.</string>
</property>
</widget>
</item>
@@ -70,7 +70,7 @@
<string>Simulator</string>
</property>
<property name="text">
<string>Sim</string>
<string>sm.</string>
</property>
</widget>
</item>
@@ -84,6 +84,19 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lb_MapperReady">
<property name="toolTip">
<string>Mappings ready</string>
</property>
<property name="text">
<string>mp.</string>
</property>
</widget>
</item>
<item>
<widget class="BlackGui::CLedWidget" name="led_MapperReady" native="true"/>
</item>
<item>
<widget class="QLabel" name="lbl_DBus">
<property name="sizePolicy">
@@ -93,7 +106,7 @@
</sizepolicy>
</property>
<property name="text">
<string>DBus</string>
<string>DB</string>
</property>
</widget>
</item>
@@ -119,7 +132,7 @@
<string>Push to talk</string>
</property>
<property name="text">
<string>Ptt</string>
<string>ptt</string>
</property>
</widget>
</item>
@@ -135,7 +148,7 @@
<number>0</number>
</property>
<property name="text">
<string>Audio</string>
<string>au.</string>
</property>
<property name="margin">
<number>0</number>