mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Renaming to ..component*
* mainkeypadareacomponent * audiovolumecomponent * audiosetupcomponent
This commit is contained in:
committed by
Roland Winklmeier
parent
11e9b37326
commit
efb89dd7be
@@ -99,52 +99,10 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="fl_AudioVolume">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_AudioSound">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sound:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_VolumeCom1">
|
||||
<property name="text">
|
||||
<string>Volume COM1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="hs_VolumeCom1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_VolumeCom2">
|
||||
<property name="text">
|
||||
<string>Volume COM2:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSlider" name="hs_VolumeCom2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="BlackGui::Components::CAudioVolumeComponent" name="comp_AudioVolume"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CAudioSetup" name="comp_AudioSetup">
|
||||
<widget class="BlackGui::Components::CAudioSetupComponent" name="comp_AudioSetup">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
@@ -164,9 +122,15 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CAudioSetup</class>
|
||||
<class>BlackGui::Components::CAudioSetupComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/audiosetup.h</header>
|
||||
<header>blackgui/components/audiosetupcomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CAudioVolumeComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/audiovolumecomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "audiosetup.h"
|
||||
#include "ui_audiosetup.h"
|
||||
#include "audiosetupcomponent.h"
|
||||
#include "ui_audiosetupcomponent.h"
|
||||
#include "blackcore/context_settings.h"
|
||||
#include "blackcore/context_audio.h"
|
||||
#include "blackmisc/setaudio.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -24,27 +26,27 @@ namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CAudioSetup::CAudioSetup(QWidget *parent) :
|
||||
CAudioSetupComponent::CAudioSetupComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
CEnableForRuntime(nullptr, false),
|
||||
ui(new Ui::CAudioSetup)
|
||||
ui(new Ui::CAudioSetupComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->ui->prb_SetupAudioTestProgress->hide();
|
||||
this->m_timerAudioTests = new QTimer(this);
|
||||
}
|
||||
|
||||
CAudioSetup::~CAudioSetup()
|
||||
CAudioSetupComponent::~CAudioSetupComponent()
|
||||
{ }
|
||||
|
||||
/*
|
||||
* Runtime set
|
||||
*/
|
||||
void CAudioSetup::runtimeHasBeenSet()
|
||||
void CAudioSetupComponent::runtimeHasBeenSet()
|
||||
{
|
||||
if (!this->getIContextSettings()) qFatal("Settings missing");
|
||||
this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CAudioSetup::ps_changedSettings);
|
||||
this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &CAudioSetup::ps_audioTestUpdate);
|
||||
this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CAudioSetupComponent::ps_changedSettings);
|
||||
this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &CAudioSetupComponent::ps_audioTestUpdate);
|
||||
|
||||
// based on audio context
|
||||
Q_ASSERT(this->getIContextAudio());
|
||||
@@ -52,19 +54,19 @@ namespace BlackGui
|
||||
if (this->getIContextAudio())
|
||||
{
|
||||
this->initAudioDeviceLists();
|
||||
connected = this->connect(this->getIContextAudio(), &IContextAudio::audioTestCompleted, this, &CAudioSetup::ps_audioTestUpdate);
|
||||
connected = this->connect(this->getIContextAudio(), &IContextAudio::audioTestCompleted, this, &CAudioSetupComponent::ps_audioTestUpdate);
|
||||
Q_ASSERT(connected);
|
||||
connected = this->connect(this->ui->cb_SetupAudioInputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int)));
|
||||
Q_ASSERT(connected);
|
||||
connected = this->connect(this->ui->cb_SetupAudioOutputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int)));
|
||||
Q_ASSERT(connected);
|
||||
this->connect(this->ui->pb_SetupAudioMicrophoneTest, &QPushButton::clicked, this, &CAudioSetup::ps_startAudioTest);
|
||||
this->connect(this->ui->pb_SetupAudioSquelchTest, &QPushButton::clicked, this, &CAudioSetup::ps_startAudioTest);
|
||||
this->connect(this->ui->pb_SetupAudioMicrophoneTest, &QPushButton::clicked, this, &CAudioSetupComponent::ps_startAudioTest);
|
||||
this->connect(this->ui->pb_SetupAudioSquelchTest, &QPushButton::clicked, this, &CAudioSetupComponent::ps_startAudioTest);
|
||||
}
|
||||
this->reloadSettings();
|
||||
}
|
||||
|
||||
void CAudioSetup::ps_changedSettings(uint typeValue)
|
||||
void CAudioSetupComponent::ps_changedSettings(uint typeValue)
|
||||
{
|
||||
IContextSettings::SettingsType type = static_cast<IContextSettings::SettingsType>(typeValue);
|
||||
this->reloadSettings();
|
||||
@@ -74,7 +76,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Reload settings
|
||||
*/
|
||||
void CAudioSetup::reloadSettings()
|
||||
void CAudioSetupComponent::reloadSettings()
|
||||
{
|
||||
// local copy
|
||||
CSettingsAudio as = this->getIContextSettings()->getAudioSettings();
|
||||
@@ -88,7 +90,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Set audio device lists
|
||||
*/
|
||||
void CAudioSetup::initAudioDeviceLists()
|
||||
void CAudioSetupComponent::initAudioDeviceLists()
|
||||
{
|
||||
if (!this->getIContextAudio()) return;
|
||||
this->ui->cb_SetupAudioOutputDevice->clear();
|
||||
@@ -122,7 +124,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Notification sounds
|
||||
*/
|
||||
bool CAudioSetup::playNotificationSounds() const
|
||||
bool CAudioSetupComponent::playNotificationSounds() const
|
||||
{
|
||||
return this->ui->cb_SetupAudioPlayNotificationSounds->isChecked();
|
||||
}
|
||||
@@ -130,7 +132,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Start the voice tests
|
||||
*/
|
||||
void CAudioSetup::ps_startAudioTest()
|
||||
void CAudioSetupComponent::ps_startAudioTest()
|
||||
{
|
||||
if (!this->getIContextAudio())
|
||||
{
|
||||
@@ -167,7 +169,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Start the voice tests
|
||||
*/
|
||||
void CAudioSetup::ps_audioTestUpdate()
|
||||
void CAudioSetupComponent::ps_audioTestUpdate()
|
||||
{
|
||||
Q_ASSERT(this->getIContextAudio());
|
||||
if (!this->getIContextAudio()) return;
|
||||
@@ -209,7 +211,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Select audio device
|
||||
*/
|
||||
void CAudioSetup::ps_audioDeviceSelected(int index)
|
||||
void CAudioSetupComponent::ps_audioDeviceSelected(int index)
|
||||
{
|
||||
if (!this->getIContextAudio()) return;
|
||||
if (index < 0)return;
|
||||
@@ -9,21 +9,22 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_AUDIOSETUP_H
|
||||
#define BLACKGUI_AUDIOSETUP_H
|
||||
#ifndef BLACKGUI_AUDIOSETUPCOMPONENT_H
|
||||
#define BLACKGUI_AUDIOSETUPCOMPONENT_H
|
||||
|
||||
#include "enableforruntime.h"
|
||||
#include "blackmisc/audiodevicelist.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CAudioSetup; }
|
||||
namespace Ui { class CAudioSetupComponent; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
//! Audio setup such as input / output devices
|
||||
class CAudioSetup :
|
||||
class CAudioSetupComponent :
|
||||
public QFrame,
|
||||
public CEnableForRuntime
|
||||
{
|
||||
@@ -31,10 +32,10 @@ namespace BlackGui
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAudioSetup(QWidget *parent = nullptr);
|
||||
explicit CAudioSetupComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CAudioSetup();
|
||||
~CAudioSetupComponent();
|
||||
|
||||
//! Play notification sounds (at all)
|
||||
bool playNotificationSounds() const;
|
||||
@@ -76,7 +77,7 @@ namespace BlackGui
|
||||
//! Audio device lists from settings
|
||||
void initAudioDeviceLists();
|
||||
|
||||
QScopedPointer<Ui::CAudioSetup> ui;
|
||||
QScopedPointer<Ui::CAudioSetupComponent> ui;
|
||||
QTimer *m_timerAudioTests; //!< audio tests: progress bar, disable/enable buttons
|
||||
AudioTest m_audioTestRunning = NoAudioTest;
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CAudioSetup</class>
|
||||
<widget class="QFrame" name="CAudioSetup">
|
||||
<class>CAudioSetupComponent</class>
|
||||
<widget class="QFrame" name="CAudioSetupComponent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -40,6 +40,9 @@
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
61
src/blackgui/components/audiovolumecomponent.cpp
Normal file
61
src/blackgui/components/audiovolumecomponent.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/context_audio.h"
|
||||
#include "audiovolumecomponent.h"
|
||||
#include "ui_audiovolumecomponent.h"
|
||||
|
||||
using namespace BlackCore;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
CAudioVolumeComponent::CAudioVolumeComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CAudioVolumeComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
bool c = connect(this->ui->pb_ShowWinMixer, &QPushButton::pressed, this, &CAudioVolumeComponent::ps_onWindowsMixer);
|
||||
Q_ASSERT(c);
|
||||
}
|
||||
|
||||
CAudioVolumeComponent::~CAudioVolumeComponent()
|
||||
{ }
|
||||
|
||||
void CAudioVolumeComponent::runtimeHasBeenSet()
|
||||
{
|
||||
bool c = connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CAudioVolumeComponent::ps_onMuteChanged);
|
||||
Q_ASSERT(c);
|
||||
c = connect(this->ui->pb_Mute, &QPushButton::toggled, this->getIContextAudio(), &IContextAudio::setMute);
|
||||
Q_ASSERT(c);
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_onMuteChanged(bool muted)
|
||||
{
|
||||
if (muted == this->ui->pb_Mute->isChecked()) { return; } // avoid roundtrips
|
||||
this->ui->pb_Mute->setChecked(muted);
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_onVolumeChanged(QList<qint32> volumes)
|
||||
{
|
||||
Q_ASSERT(volumes.length() == 2);
|
||||
if (volumes.length() != 2) return;
|
||||
this->ui->hs_VolumeCom1->setValue(volumes.at(0));
|
||||
this->ui->hs_VolumeCom2->setValue(volumes.at(1));
|
||||
}
|
||||
|
||||
void CAudioVolumeComponent::ps_onWindowsMixer()
|
||||
{
|
||||
BlackMisc::Audio::startWindowsMixer();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
61
src/blackgui/components/audiovolumecomponent.h
Normal file
61
src/blackgui/components/audiovolumecomponent.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_AUDIOVOLUME_H
|
||||
#define BLACKGUI_AUDIOVOLUME_H
|
||||
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include "enableforruntime.h"
|
||||
|
||||
namespace Ui { class CAudioVolumeComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
//! Audio volume, mixer
|
||||
class CAudioVolumeComponent :
|
||||
public QFrame,
|
||||
public CEnableForRuntime
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAudioVolumeComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CAudioVolumeComponent();
|
||||
|
||||
protected:
|
||||
//! \copydoc CEnableForRuntime::runtimeHasBeenSet
|
||||
void runtimeHasBeenSet() override;
|
||||
|
||||
private slots:
|
||||
//! Mute toggle
|
||||
void ps_onMuteChanged(bool muted);
|
||||
|
||||
//! Volumes changed
|
||||
void ps_onVolumeChanged(QList<qint32> volumes);
|
||||
|
||||
//! Requested windows mixer
|
||||
void ps_onWindowsMixer();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CAudioVolumeComponent> ui;
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
200
src/blackgui/components/audiovolumecomponent.ui
Normal file
200
src/blackgui/components/audiovolumecomponent.ui
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CAudioVolumeComponent</class>
|
||||
<widget class="QFrame" name="CAudioVolumeComponent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_AudioVolume">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="fl_AudioVolume">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_AudioSound">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sound:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_VolumeCom1">
|
||||
<property name="text">
|
||||
<string>Volume COM1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="hs_VolumeCom1">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_VolumeCom2">
|
||||
<property name="text">
|
||||
<string>Volume COM2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSlider" name="hs_VolumeCom2">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QWidget" name="wi_AudioSoundButtons" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_AudioSoundButtons">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_Mute">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Toggle mute</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||
<normaloff>:/diagona/icons/diagona/icons/speaker-volume.png</normaloff>
|
||||
<normalon>:/diagona/icons/diagona/icons/speaker-volume-control-mute.png</normalon>:/diagona/icons/diagona/icons/speaker-volume.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_ShowWinMixer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Windows sound mixer</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||
<normaloff>:/diagona/icons/diagona/icons/speaker--pencil.png</normaloff>:/diagona/icons/diagona/icons/speaker--pencil.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
73
src/blackgui/components/mainkeypadareacomponent.cpp
Normal file
73
src/blackgui/components/mainkeypadareacomponent.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "mainkeypadareacomponent.h"
|
||||
#include "ui_mainkeypadareacomponent.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
CMainKeypadAreaComponent::CMainKeypadAreaComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CMainKeypadAreaComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// Info areas
|
||||
connect(this->ui->pb_MainAircrafts, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainAtc, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainCockpit, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainFlightplan, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainLog, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainMappings, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainSettings, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainSimulator, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainTextMessages, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainUsers, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
connect(this->ui->pb_MainWeather, &QPushButton::pressed, this, &CMainKeypadAreaComponent::ps_buttonPressed);
|
||||
}
|
||||
|
||||
CMainKeypadAreaComponent::~CMainKeypadAreaComponent()
|
||||
{ }
|
||||
|
||||
void CMainKeypadAreaComponent::ps_buttonPressed()
|
||||
{
|
||||
const QObject *sender = QObject::sender();
|
||||
CMainInfoAreaComponent::InfoArea ia = buttonToMainInfoArea(sender);
|
||||
if (ia != CMainInfoAreaComponent::InfoAreaNone)
|
||||
{
|
||||
emit selectMainInfoAreaDockWidget(ia);
|
||||
}
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::ps_buttonDoubleClicked()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CMainInfoAreaComponent::InfoArea CMainKeypadAreaComponent::buttonToMainInfoArea(const QObject *button) const
|
||||
{
|
||||
if (button == ui->pb_MainAircrafts) return CMainInfoAreaComponent::InfoAreaAircrafts;
|
||||
if (button == ui->pb_MainAtc) return CMainInfoAreaComponent::InfoAreaAtc;
|
||||
if (button == ui->pb_MainCockpit) return CMainInfoAreaComponent::InfoAreaCockpit;
|
||||
if (button == ui->pb_MainFlightplan) return CMainInfoAreaComponent::InfoAreaFlightPlan;
|
||||
if (button == ui->pb_MainLog) return CMainInfoAreaComponent::InfoAreaLog;
|
||||
if (button == ui->pb_MainMappings) return CMainInfoAreaComponent::InfoAreaMappings;
|
||||
if (button == ui->pb_MainSettings) return CMainInfoAreaComponent::InfoAreaSettings;
|
||||
if (button == ui->pb_MainSimulator) return CMainInfoAreaComponent::InfoAreaSimulator;
|
||||
if (button == ui->pb_MainTextMessages) return CMainInfoAreaComponent::InfoAreaTextMessages;
|
||||
if (button == ui->pb_MainUsers) return CMainInfoAreaComponent::InfoAreaUsers;
|
||||
if (button == ui->pb_MainWeather) return CMainInfoAreaComponent::InfoAreaWeather;
|
||||
return CMainInfoAreaComponent::InfoAreaNone;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
60
src/blackgui/components/mainkeypadareacomponent.h
Normal file
60
src/blackgui/components/mainkeypadareacomponent.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_MAINKEYPADAREACOMPONENT_H
|
||||
#define BLACKGUI_MAINKEYPADAREACOMPONENT_H
|
||||
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include "maininfoareacomponent.h"
|
||||
|
||||
namespace Ui { class CMainKeypadAreaComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
//! Main keypad area as used with main info area
|
||||
//! \sa CMainInfoAreaComponent
|
||||
class CMainKeypadAreaComponent : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CMainKeypadAreaComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CMainKeypadAreaComponent();
|
||||
|
||||
signals:
|
||||
//! Button to select main info area has been pressed
|
||||
//! \sa CMainInfoAreaComponent
|
||||
void selectMainInfoAreaDockWidget(CMainInfoAreaComponent::InfoArea infoArea);
|
||||
|
||||
private slots:
|
||||
//! Button was clicked
|
||||
void ps_buttonPressed();
|
||||
|
||||
//! Button was double clicked
|
||||
void ps_buttonDoubleClicked();
|
||||
|
||||
private:
|
||||
// if button is info area, identify it
|
||||
CMainInfoAreaComponent::InfoArea buttonToMainInfoArea(const QObject *button) const;
|
||||
|
||||
QScopedPointer<Ui::CMainKeypadAreaComponent> ui;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
378
src/blackgui/components/mainkeypadareacomponent.ui
Normal file
378
src/blackgui/components/mainkeypadareacomponent.ui
Normal file
@@ -0,0 +1,378 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CMainKeypadAreaComponent</class>
|
||||
<widget class="QFrame" name="CMainKeypadAreaComponent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>407</width>
|
||||
<height>144</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_MainKeypadArea">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="wi_MainKeypadArea" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gl_MainKeypadArea">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<widget class="QLineEdit" name="le_CommandLineInput">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><commands go here></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QPushButton" name="pb_SoundMute">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mute</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pb_MainKeypadOpacity050">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>62</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>50%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="pb_MainConnect">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QPushButton" name="pb_SoundMaxVolume">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Maximum volume</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max.vol.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="pb_MainKeypadOpacity100">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>62</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>100%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="pb_MainAircrafts">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Aircrafts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="pb_MainAtc">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ATC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="pb_MainUsers">
|
||||
<property name="text">
|
||||
<string>Users</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pb_MainCockpit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cockpit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pb_CockpitIdent">
|
||||
<property name="text">
|
||||
<string>Ident</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pb_MainTextMessages">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Text/Chat</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="pb_MainSimulator">
|
||||
<property name="text">
|
||||
<string>Simulator</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="pb_MainWeather">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Weather</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="pb_MainFlightplan">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Flightplan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pb_MainMappings">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mappings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pb_MainSettings">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pb_MainLog">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user