refs #335, refs #288 some GUI finetuning

* turned log component (from toolbox) into tab widget (for consistency)
* made keypad ident/mute buttons checkable so style sheets can be applied
This commit is contained in:
Klaus Basan
2014-11-17 18:54:27 +01:00
committed by Roland Winklmeier
parent eb13c9d4ae
commit b8597ce8d8
4 changed files with 30 additions and 32 deletions

View File

@@ -42,24 +42,13 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QToolBox" name="tb_StatusPage">
<widget class="QTabWidget" name="tw_StatusPage">
<property name="currentIndex">
<number>0</number>
</property>
<property name="tabSpacing">
<number>3</number>
</property>
<widget class="QWidget" name="pg_StatusPageMessages">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>250</height>
</rect>
</property>
<attribute name="label">
<string>Messages</string>
<widget class="QWidget" name="pg_LogPage" native="true">
<attribute name="title">
<string>Log</string>
</attribute>
<layout class="QVBoxLayout" name="vl_StatusPageMessages">
<property name="spacing">
@@ -92,16 +81,8 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="pg_StatusPageConsole">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>250</height>
</rect>
</property>
<attribute name="label">
<widget class="QWidget" name="pg_LogConsole" native="true">
<attribute name="title">
<string>Console</string>
</attribute>
<layout class="QVBoxLayout" name="vl_StatusPageConsole">

View File

@@ -42,11 +42,11 @@ namespace BlackGui
// non info areas
connect(this->ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_CockpitIdent, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_CockpitIdent, &QPushButton::released, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_Opacity050, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_Opacity100, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_SoundMaxVolume, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_SoundMute, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_SoundMute, &QPushButton::released, this, &CMainKeypadAreaComponent::ps_buttonSelected);
// command line
this->connect(this->ui->le_CommandLineInput, &QLineEdit::returnPressed, this, &CMainKeypadAreaComponent::ps_commandEntered);
@@ -85,6 +85,7 @@ namespace BlackGui
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextOwnAircraft(), &IContextOwnAircraft::parseCommandLine);
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextNetwork(), &IContextNetwork::parseCommandLine);
@@ -163,13 +164,21 @@ namespace BlackGui
void CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged(const CAircraft &aircraft, const QString &originator)
{
Q_UNUSED(originator);
if (aircraft.getTransponder().getTransponderMode() == CTransponder::StateIdent)
bool ident = aircraft.getTransponder().getTransponderMode() == CTransponder::StateIdent;
//check state to avoid undelibarate signals
if (ident != this->ui->pb_CockpitIdent->isChecked())
{
this->ui->pb_CockpitIdent->setStyleSheet("background-color: yellow");
this->ui->pb_CockpitIdent->setChecked(ident);
}
else
}
void CMainKeypadAreaComponent::ps_muteChanged(bool muted)
{
//check state to avoid undelibarate signals
if (muted != this->ui->pb_SoundMute->isChecked())
{
this->ui->pb_CockpitIdent->setStyleSheet("");
this->ui->pb_SoundMute->setChecked(muted);
}
}
@@ -209,7 +218,6 @@ namespace BlackGui
return nullptr;
}
Aviation::CAircraft CMainKeypadAreaComponent::getOwnAircraft() const
{
if (!this->getIContextOwnAircraft()) { return CAircraft(); }

View File

@@ -80,6 +80,9 @@ namespace BlackGui
//! \copydoc BlackCore::IContextOwnAircraft::changedAircraftCockpit
void ps_ownAircraftCockpitChanged(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator);
//! \copydoc BlackCore::IContextAudio::changedMute
void ps_muteChanged(bool muted);
private:
//! If button is info area, identify it
CMainInfoAreaComponent::InfoArea buttonToMainInfoArea(const QObject *button) const;

View File

@@ -86,6 +86,9 @@
<property name="text">
<string>Mute</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="4">
@@ -269,6 +272,9 @@
<property name="text">
<string>Ident</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">