diff --git a/src/blackgui/components/cockpitcomponent.cpp b/src/blackgui/components/cockpitcomponent.cpp index 8e798d9fa..6ae3282ef 100644 --- a/src/blackgui/components/cockpitcomponent.cpp +++ b/src/blackgui/components/cockpitcomponent.cpp @@ -28,7 +28,7 @@ namespace BlackGui { ui->setupUi(this); this->m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight(); - connect(ui->wip_CockpitComPanelShowHideBar, &BlackGui::CShowHideBar::toggleShowHide, this, &CCockpitComponent::ps_onToggleShowHideDetails); + connect(ui->wip_CockpitComPanelShowHideBar, &BlackGui::CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails); } CCockpitComponent::~CCockpitComponent() @@ -40,7 +40,7 @@ namespace BlackGui bool ok = CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget); if (ok && parentDockableWidget) { - ok = connect(parentDockableWidget, &QDockWidget::topLevelChanged, this, &CCockpitComponent::ps_onToggleFloating); + ok = connect(parentDockableWidget, &QDockWidget::topLevelChanged, this, &CCockpitComponent::onToggleFloating); } return ok; } @@ -60,7 +60,7 @@ namespace BlackGui ui->comp_CockpitInfoArea->selectArea(CCockpitInfoAreaComponent::InfoAreaAudio); } - void CCockpitComponent::ps_onToggleShowHideDetails(bool show) + void CCockpitComponent::onToggleShowHideDetails(bool show) { // use the toggle method to set the sizes this->toggleShowHideDetails(show, true); @@ -116,7 +116,7 @@ namespace BlackGui } } - void CCockpitComponent::ps_onToggleFloating(bool floating) + void CCockpitComponent::onToggleFloating(bool floating) { ui->wip_CockpitComPanelShowHideBar->setVisible(floating); if (floating) diff --git a/src/blackgui/components/cockpitcomponent.h b/src/blackgui/components/cockpitcomponent.h index 83f9ac346..225d94b5b 100644 --- a/src/blackgui/components/cockpitcomponent.h +++ b/src/blackgui/components/cockpitcomponent.h @@ -53,14 +53,13 @@ namespace BlackGui //! Show the audio ui void showAudio(); - private slots: + private: //! Show or hide cockpit details - void ps_onToggleShowHideDetails(bool show); + void onToggleShowHideDetails(bool show); //! Toggle floating - void ps_onToggleFloating(bool floating); + void onToggleFloating(bool floating); - private: // toggle area on show/hide details void toggleShowHideDetails(bool show, bool considerCurrentSize); diff --git a/src/blackgui/components/voiceroomscomponent.cpp b/src/blackgui/components/voiceroomscomponent.cpp index 70823b302..25f75df4d 100644 --- a/src/blackgui/components/voiceroomscomponent.cpp +++ b/src/blackgui/components/voiceroomscomponent.cpp @@ -7,16 +7,18 @@ * contained in the LICENSE file. */ +#include "ui_voiceroomscomponent.h" +#include "blackgui/components/voiceroomscomponent.h" +#include "blackgui/views/userview.h" +#include "blackgui/guiapplication.h" +#include "blackgui/guiutility.h" #include "blackcore/context/contextaudio.h" #include "blackcore/context/contextownaircraft.h" -#include "blackgui/components/voiceroomscomponent.h" -#include "blackgui/guiapplication.h" -#include "blackgui/views/userview.h" #include "blackmisc/audio/notificationsounds.h" #include "blackmisc/audio/voiceroom.h" #include "blackmisc/aviation/comsystem.h" #include "blackmisc/sequence.h" -#include "ui_voiceroomscomponent.h" + #include #include @@ -37,25 +39,25 @@ namespace BlackGui { ui->setupUi(this); this->setVoiceRoomUrlFieldsReadOnlyState(); - connect(ui->cb_CockpitVoiceRoom1Override, &QCheckBox::toggled, this, &CVoiceRoomsComponent::ps_onVoiceRoomOverrideChanged); - connect(ui->cb_CockpitVoiceRoom2Override, &QCheckBox::toggled, this, &CVoiceRoomsComponent::ps_onVoiceRoomOverrideChanged); - connect(ui->le_CockpitVoiceRoomCom1, &QLineEdit::returnPressed, this, &CVoiceRoomsComponent::ps_onVoiceRoomUrlsReturnPressed); - connect(ui->le_CockpitVoiceRoomCom2, &QLineEdit::returnPressed, this, &CVoiceRoomsComponent::ps_onVoiceRoomUrlsReturnPressed); - connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CVoiceRoomsComponent::ps_updateAudioVoiceRoomsFromContext); - connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRoomMembers, this, &CVoiceRoomsComponent::ps_updateVoiceRoomMembers); + connect(ui->cb_CockpitVoiceRoom1Override, &QCheckBox::toggled, this, &CVoiceRoomsComponent::onVoiceRoomOverrideChanged); + connect(ui->cb_CockpitVoiceRoom2Override, &QCheckBox::toggled, this, &CVoiceRoomsComponent::onVoiceRoomOverrideChanged); + connect(ui->le_CockpitVoiceRoomCom1, &QLineEdit::returnPressed, this, &CVoiceRoomsComponent::onVoiceRoomUrlsReturnPressed); + connect(ui->le_CockpitVoiceRoomCom2, &QLineEdit::returnPressed, this, &CVoiceRoomsComponent::onVoiceRoomUrlsReturnPressed); + connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CVoiceRoomsComponent::updateAudioVoiceRoomsFromContext); + connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRoomMembers, this, &CVoiceRoomsComponent::updateVoiceRoomMembers); } CVoiceRoomsComponent::~CVoiceRoomsComponent() { } - void CVoiceRoomsComponent::ps_onVoiceRoomOverrideChanged(bool checked) + void CVoiceRoomsComponent::onVoiceRoomOverrideChanged(bool checked) { Q_UNUSED(checked); this->setVoiceRoomUrlFieldsReadOnlyState(); - this->ps_onVoiceRoomUrlsReturnPressed(); // use this function to update voicerooms + this->onVoiceRoomUrlsReturnPressed(); // use this function to update voicerooms } - void CVoiceRoomsComponent::ps_onVoiceRoomUrlsReturnPressed() + void CVoiceRoomsComponent::onVoiceRoomUrlsReturnPressed() { Q_ASSERT(sGui->getIContextOwnAircraft()); // voice room resolution is part of own aircraft QString url1; @@ -71,9 +73,10 @@ namespace BlackGui bool c2 = ui->cb_CockpitVoiceRoom2Override->isChecked(); ui->le_CockpitVoiceRoomCom1->setReadOnly(!c1); ui->le_CockpitVoiceRoomCom2->setReadOnly(!c2); + CGuiUtility::forceStyleSheetUpdate(this); } - void CVoiceRoomsComponent::ps_updateAudioVoiceRoomsFromContext(const CVoiceRoomList &selectedVoiceRooms, bool connected) + void CVoiceRoomsComponent::updateAudioVoiceRoomsFromContext(const CVoiceRoomList &selectedVoiceRooms, bool connected) { Q_ASSERT(selectedVoiceRooms.size() == 2); CVoiceRoom room1 = selectedVoiceRooms[0]; @@ -108,7 +111,7 @@ namespace BlackGui } if (changedUrl1 || changedUrl2) { - this->ps_updateVoiceRoomMembers(); + this->updateVoiceRoomMembers(); // notify if (sGui->getIContextAudio()) @@ -121,7 +124,7 @@ namespace BlackGui } } - void CVoiceRoomsComponent::ps_updateVoiceRoomMembers() + void CVoiceRoomsComponent::updateVoiceRoomMembers() { if (!sGui->getIContextAudio()) { return; } if (!ui->le_CockpitVoiceRoomCom1->text().trimmed().isEmpty()) diff --git a/src/blackgui/components/voiceroomscomponent.h b/src/blackgui/components/voiceroomscomponent.h index 2c3f62514..14b8af801 100644 --- a/src/blackgui/components/voiceroomscomponent.h +++ b/src/blackgui/components/voiceroomscomponent.h @@ -38,22 +38,21 @@ namespace BlackGui explicit CVoiceRoomsComponent(QWidget *parent = nullptr); //! Destructor - ~CVoiceRoomsComponent(); - - private slots: - //! Override for voice was changed - void ps_onVoiceRoomOverrideChanged(bool checked); - - //! Return pressed - void ps_onVoiceRoomUrlsReturnPressed(); - - //! Set the voice room url fields (checkboxes, line edits) - void ps_updateAudioVoiceRoomsFromContext(const BlackMisc::Audio::CVoiceRoomList &selectedVoiceRooms, bool connected); - - //! Update voice room views - void ps_updateVoiceRoomMembers(); + virtual ~CVoiceRoomsComponent(); private: + //! Override for voice was changed + void onVoiceRoomOverrideChanged(bool checked); + + //! Return pressed + void onVoiceRoomUrlsReturnPressed(); + + //! Set the voice room url fields (checkboxes, line edits) + void updateAudioVoiceRoomsFromContext(const BlackMisc::Audio::CVoiceRoomList &selectedVoiceRooms, bool connected); + + //! Update voice room views + void updateVoiceRoomMembers(); + //! Set the URL fields void setVoiceRoomUrlFieldsReadOnlyState();