1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Completely remove filteraudio checkbox from the ui

This commit is contained in:
sudden6 2016-02-27 14:59:21 +01:00
parent e5cc004edf
commit 685d91f0a3
3 changed files with 38 additions and 60 deletions

View File

@ -1239,7 +1239,8 @@ void Settings::setOutVolume(int volume)
bool Settings::getFilterAudio() const bool Settings::getFilterAudio() const
{ {
QMutexLocker locker{&bigLock}; QMutexLocker locker{&bigLock};
return filterAudio; // temporary disable filteraudio, as it doesn't work as expected
return false;
} }
void Settings::setFilterAudio(bool newValue) void Settings::setFilterAudio(bool newValue)

View File

@ -47,20 +47,12 @@ AVForm::AVForm() :
bodyUI->btnPlayTestSound->setToolTip( bodyUI->btnPlayTestSound->setToolTip(
tr("Play a test sound while changing the output volume.")); tr("Play a test sound while changing the output volume."));
#ifdef QTOX_FILTER_AUDIO
bodyUI->filterAudio->setChecked(Settings::getInstance().getFilterAudio());
#else
bodyUI->filterAudio->setDisabled(true);
#endif
auto qcbxIndexChangedStr = (void(QComboBox::*)(const QString&)) &QComboBox::currentIndexChanged; auto qcbxIndexChangedStr = (void(QComboBox::*)(const QString&)) &QComboBox::currentIndexChanged;
auto qcbxIndexChangedInt = (void(QComboBox::*)(int)) &QComboBox::currentIndexChanged; auto qcbxIndexChangedInt = (void(QComboBox::*)(int)) &QComboBox::currentIndexChanged;
connect(bodyUI->inDevCombobox, qcbxIndexChangedStr, this, &AVForm::onInDevChanged); connect(bodyUI->inDevCombobox, qcbxIndexChangedStr, this, &AVForm::onInDevChanged);
connect(bodyUI->outDevCombobox, qcbxIndexChangedStr, this, &AVForm::onOutDevChanged); connect(bodyUI->outDevCombobox, qcbxIndexChangedStr, this, &AVForm::onOutDevChanged);
connect(bodyUI->videoDevCombobox, qcbxIndexChangedInt, this, &AVForm::onVideoDevChanged); connect(bodyUI->videoDevCombobox, qcbxIndexChangedInt, this, &AVForm::onVideoDevChanged);
connect(bodyUI->videoModescomboBox, qcbxIndexChangedInt, this, &AVForm::onVideoModesIndexChanged); connect(bodyUI->videoModescomboBox, qcbxIndexChangedInt, this, &AVForm::onVideoModesIndexChanged);
connect(bodyUI->filterAudio, &QCheckBox::toggled, this, &AVForm::onFilterAudioToggled);
connect(bodyUI->rescanButton, &QPushButton::clicked, this, [=]() connect(bodyUI->rescanButton, &QPushButton::clicked, this, [=]()
{ {
getAudioInDevices(); getAudioInDevices();
@ -87,11 +79,6 @@ AVForm::AVForm() :
cb->setFocusPolicy(Qt::StrongFocus); cb->setFocusPolicy(Qt::StrongFocus);
} }
for (QCheckBox *cb : findChildren<QCheckBox*>()) // this one is to allow scrolling on checkboxes
{
cb->installEventFilter(this);
}
Translator::registerHandler(std::bind(&AVForm::retranslateUi, this), this); Translator::registerHandler(std::bind(&AVForm::retranslateUi, this), this);
} }
@ -415,7 +402,7 @@ void AVForm::killVideoSurface()
bool AVForm::eventFilter(QObject *o, QEvent *e) bool AVForm::eventFilter(QObject *o, QEvent *e)
{ {
if ((e->type() == QEvent::Wheel) && if ((e->type() == QEvent::Wheel) &&
(qobject_cast<QComboBox*>(o) || qobject_cast<QAbstractSpinBox*>(o) || qobject_cast<QCheckBox*>(o) || qobject_cast<QSlider*>(o))) (qobject_cast<QComboBox*>(o) || qobject_cast<QAbstractSpinBox*>(o) || qobject_cast<QSlider*>(o)))
{ {
e->ignore(); e->ignore();
return true; return true;

View File

@ -30,8 +30,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>830</width> <width>824</width>
<height>495</height> <height>489</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
@ -41,27 +41,13 @@
<string>Audio Settings</string> <string>Audio Settings</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="outDevLabel">
<property name="text">
<string>Playback device</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2"> <item row="0" column="1" colspan="2">
<widget class="QComboBox" name="outDevCombobox"/> <widget class="QComboBox" name="outDevCombobox"/>
</item> </item>
<item row="1" column="0"> <item row="3" column="1" colspan="2">
<widget class="QLabel" name="playbackLabel"> <widget class="QSlider" name="microphoneSlider">
<property name="text">
<string>Volume</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="playbackSlider">
<property name="toolTip"> <property name="toolTip">
<string>Use slider to set volume of your speakers.</string> <string>Use slider to set volume of your microphone.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
@ -71,6 +57,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QLabel" name="microphoneLabel">
<property name="text">
<string>Gain</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="inDevCombobox"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="outDevLabel">
<property name="text">
<string>Playback device</string>
</property>
</widget>
</item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QToolButton" name="btnPlayTestSound"> <widget class="QToolButton" name="btnPlayTestSound">
<property name="text"> <property name="text">
@ -85,27 +88,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="1" column="1">
<widget class="QLabel" name="inDevLabel"> <widget class="QSlider" name="playbackSlider">
<property name="text">
<string>Capture device</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="inDevCombobox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="microphoneLabel">
<property name="text">
<string>Gain</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QSlider" name="microphoneSlider">
<property name="toolTip"> <property name="toolTip">
<string>Use slider to set volume of your microphone.</string> <string>Use slider to set volume of your speakers.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
@ -115,13 +101,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="filterAudio"> <widget class="QLabel" name="inDevLabel">
<property name="toolTip">
<string>Filter sound from your microphone, so that people hearing you would get better sound.</string>
</property>
<property name="text"> <property name="text">
<string>Filter audio</string> <string>Capture device</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="playbackLabel">
<property name="text">
<string>Volume</string>
</property> </property>
</widget> </widget>
</item> </item>