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

View File

@@ -42,11 +42,11 @@ namespace BlackGui
// non info areas // non info areas
connect(this->ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected); 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_Opacity050, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonSelected);
connect(this->ui->pb_Opacity100, &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_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 // command line
this->connect(this->ui->le_CommandLineInput, &QLineEdit::returnPressed, this, &CMainKeypadAreaComponent::ps_commandEntered); 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->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged); 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->getIContextOwnAircraft(), &IContextOwnAircraft::parseCommandLine);
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getIContextNetwork(), &IContextNetwork::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) void CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged(const CAircraft &aircraft, const QString &originator)
{ {
Q_UNUSED(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; return nullptr;
} }
Aviation::CAircraft CMainKeypadAreaComponent::getOwnAircraft() const Aviation::CAircraft CMainKeypadAreaComponent::getOwnAircraft() const
{ {
if (!this->getIContextOwnAircraft()) { return CAircraft(); } if (!this->getIContextOwnAircraft()) { return CAircraft(); }

View File

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

View File

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