mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: re-format and cleanup
This commit is contained in:
parent
0ea409054a
commit
c6a197feca
@ -258,8 +258,6 @@ set(${PROJECT_NAME}_SOURCES
|
|||||||
src/core/dhtserver.cpp
|
src/core/dhtserver.cpp
|
||||||
src/core/dhtserver.h
|
src/core/dhtserver.h
|
||||||
src/core/icoresettings.h
|
src/core/icoresettings.h
|
||||||
src/core/recursivesignalblocker.cpp
|
|
||||||
src/core/recursivesignalblocker.h
|
|
||||||
src/core/toxcall.cpp
|
src/core/toxcall.cpp
|
||||||
src/core/toxcall.h
|
src/core/toxcall.h
|
||||||
src/core/toxencrypt.cpp
|
src/core/toxencrypt.cpp
|
||||||
@ -472,6 +470,8 @@ set(${PROJECT_NAME}_SOURCES
|
|||||||
src/widget/tool/movablewidget.h
|
src/widget/tool/movablewidget.h
|
||||||
src/widget/tool/profileimporter.cpp
|
src/widget/tool/profileimporter.cpp
|
||||||
src/widget/tool/profileimporter.h
|
src/widget/tool/profileimporter.h
|
||||||
|
src/widget/tool/recursivesignalblocker.cpp
|
||||||
|
src/widget/tool/recursivesignalblocker.h
|
||||||
src/widget/tool/removefrienddialog.cpp
|
src/widget/tool/removefrienddialog.cpp
|
||||||
src/widget/tool/removefrienddialog.h
|
src/widget/tool/removefrienddialog.h
|
||||||
src/widget/tool/screengrabberchooserrectitem.cpp
|
src/widget/tool/screengrabberchooserrectitem.cpp
|
||||||
|
@ -71,7 +71,6 @@ public:
|
|||||||
~History();
|
~History();
|
||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
void import(const HistoryKeeper& oldHistory);
|
|
||||||
|
|
||||||
bool isHistoryExistence(const QString& friendPk);
|
bool isHistoryExistence(const QString& friendPk);
|
||||||
|
|
||||||
@ -85,7 +84,8 @@ public:
|
|||||||
const QDateTime& to);
|
const QDateTime& to);
|
||||||
QList<HistMessage> getChatHistoryDefaultNum(const QString& friendPk);
|
QList<HistMessage> getChatHistoryDefaultNum(const QString& friendPk);
|
||||||
QList<DateMessages> getChatHistoryCounts(const ToxPk& friendPk, const QDate& from, const QDate& to);
|
QList<DateMessages> getChatHistoryCounts(const ToxPk& friendPk, const QDate& from, const QDate& to);
|
||||||
QDateTime getDateWhereFindPhrase(const QString& friendPk, const QDateTime& from, QString phrase, const ParameterSearch ¶meter);
|
QDateTime getDateWhereFindPhrase(const QString& friendPk, const QDateTime& from, QString phrase,
|
||||||
|
const ParameterSearch& parameter);
|
||||||
QDateTime getStartDateChatHistory(const QString& friendPk);
|
QDateTime getStartDateChatHistory(const QString& friendPk);
|
||||||
|
|
||||||
void markAsSent(qint64 messageId);
|
void markAsSent(qint64 messageId);
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <tox/tox.h>
|
#include <tox/tox.h>
|
||||||
|
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/net/autoupdate.h"
|
#include "src/net/autoupdate.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
|
|
||||||
#include "src/core/core.h"
|
#include "src/core/core.h"
|
||||||
#include "src/core/coreav.h"
|
#include "src/core/coreav.h"
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/nexus.h"
|
#include "src/nexus.h"
|
||||||
#include "src/persistence/profile.h"
|
#include "src/persistence/profile.h"
|
||||||
#include "src/persistence/settings.h"
|
#include "src/persistence/settings.h"
|
||||||
#include "src/widget/gui.h"
|
#include "src/widget/gui.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -157,8 +157,7 @@ void AdvancedForm::on_btnCopyDebug_clicked()
|
|||||||
void AdvancedForm::on_resetButton_clicked()
|
void AdvancedForm::on_resetButton_clicked()
|
||||||
{
|
{
|
||||||
const QString titile = tr("Reset settings");
|
const QString titile = tr("Reset settings");
|
||||||
bool result =
|
bool result = GUI::askQuestion(titile, tr("All settings will be reset to default. Are you sure?"),
|
||||||
GUI::askQuestion(titile, tr("All settings will be reset to default. Are you sure?"),
|
|
||||||
tr("Yes"), tr("No"));
|
tr("Yes"), tr("No"));
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
#include "src/audio/iaudiosettings.h"
|
#include "src/audio/iaudiosettings.h"
|
||||||
#include "src/core/core.h"
|
#include "src/core/core.h"
|
||||||
#include "src/core/coreav.h"
|
#include "src/core/coreav.h"
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/video/cameradevice.h"
|
#include "src/video/cameradevice.h"
|
||||||
#include "src/video/camerasource.h"
|
#include "src/video/camerasource.h"
|
||||||
#include "src/video/ivideosettings.h"
|
#include "src/video/ivideosettings.h"
|
||||||
#include "src/video/videosurface.h"
|
#include "src/video/videosurface.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/tool/screenshotgrabber.h"
|
#include "src/widget/tool/screenshotgrabber.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
|
|
||||||
@ -43,8 +43,8 @@
|
|||||||
#define ALC_ALL_DEVICES_SPECIFIER ALC_DEVICE_SPECIFIER
|
#define ALC_ALL_DEVICES_SPECIFIER ALC_DEVICE_SPECIFIER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AVForm::AVForm(Audio* audio, CoreAV* coreAV, CameraSource& camera,
|
AVForm::AVForm(Audio* audio, CoreAV* coreAV, CameraSource& camera, IAudioSettings* audioSettings,
|
||||||
IAudioSettings* audioSettings, IVideoSettings* videoSettings)
|
IVideoSettings* videoSettings)
|
||||||
: GenericForm(QPixmap(":/img/settings/av.png"))
|
: GenericForm(QPixmap(":/img/settings/av.png"))
|
||||||
, audio{audio}
|
, audio{audio}
|
||||||
, coreAV{coreAV}
|
, coreAV{coreAV}
|
||||||
@ -72,7 +72,8 @@ AVForm::AVForm(Audio* audio, CoreAV* coreAV, CameraSource& camera,
|
|||||||
playbackSlider->setTracking(false);
|
playbackSlider->setTracking(false);
|
||||||
playbackSlider->setMaximum(totalSliderSteps);
|
playbackSlider->setMaximum(totalSliderSteps);
|
||||||
playbackSlider->setValue(getStepsFromValue(audioSettings->getOutVolume(),
|
playbackSlider->setValue(getStepsFromValue(audioSettings->getOutVolume(),
|
||||||
audioSettings->getOutVolumeMin(), audioSettings->getOutVolumeMax()));
|
audioSettings->getOutVolumeMin(),
|
||||||
|
audioSettings->getOutVolumeMax()));
|
||||||
playbackSlider->installEventFilter(this);
|
playbackSlider->installEventFilter(this);
|
||||||
|
|
||||||
microphoneSlider->setToolTip(tr("Use slider to set the gain of your input device ranging"
|
microphoneSlider->setToolTip(tr("Use slider to set the gain of your input device ranging"
|
||||||
@ -85,13 +86,15 @@ AVForm::AVForm(Audio* audio, CoreAV* coreAV, CameraSource& camera,
|
|||||||
microphoneSlider->setTickInterval(totalSliderSteps / numTicks);
|
microphoneSlider->setTickInterval(totalSliderSteps / numTicks);
|
||||||
microphoneSlider->setTracking(false);
|
microphoneSlider->setTracking(false);
|
||||||
microphoneSlider->installEventFilter(this);
|
microphoneSlider->installEventFilter(this);
|
||||||
microphoneSlider->setValue(getStepsFromValue(audio->inputGain(), audio->minInputGain(), audio->maxInputGain()));
|
microphoneSlider->setValue(
|
||||||
|
getStepsFromValue(audio->inputGain(), audio->minInputGain(), audio->maxInputGain()));
|
||||||
|
|
||||||
audioThresholdSlider->setToolTip(tr("Use slider to set the activation volume for your"
|
audioThresholdSlider->setToolTip(tr("Use slider to set the activation volume for your"
|
||||||
" input device."));
|
" input device."));
|
||||||
audioThresholdSlider->setMaximum(totalSliderSteps);
|
audioThresholdSlider->setMaximum(totalSliderSteps);
|
||||||
audioThresholdSlider->setValue(getStepsFromValue(audioSettings->getAudioThreshold(),
|
audioThresholdSlider->setValue(getStepsFromValue(audioSettings->getAudioThreshold(),
|
||||||
audio->minInputThreshold(), audio->maxInputThreshold()));
|
audio->minInputThreshold(),
|
||||||
|
audio->maxInputThreshold()));
|
||||||
audioThresholdSlider->setTracking(false);
|
audioThresholdSlider->setTracking(false);
|
||||||
audioThresholdSlider->installEventFilter(this);
|
audioThresholdSlider->installEventFilter(this);
|
||||||
|
|
||||||
@ -167,7 +170,8 @@ void AVForm::rescanDevices()
|
|||||||
|
|
||||||
void AVForm::setVolume(float value)
|
void AVForm::setVolume(float value)
|
||||||
{
|
{
|
||||||
volumeDisplay->setValue(getStepsFromValue(value, audio->minOutputVolume(), audio->maxOutputVolume()));
|
volumeDisplay->setValue(
|
||||||
|
getStepsFromValue(value, audio->minOutputVolume(), audio->maxOutputVolume()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::on_cbEnableBackend2_stateChanged()
|
void AVForm::on_cbEnableBackend2_stateChanged()
|
||||||
@ -544,7 +548,6 @@ void AVForm::on_inDevCombobox_currentIndexChanged(int deviceIndex)
|
|||||||
if (!inputEnabled) {
|
if (!inputEnabled) {
|
||||||
volumeDisplay->setValue(volumeDisplay->minimum());
|
volumeDisplay->setValue(volumeDisplay->minimum());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::on_outDevCombobox_currentIndexChanged(int deviceIndex)
|
void AVForm::on_outDevCombobox_currentIndexChanged(int deviceIndex)
|
||||||
@ -561,18 +564,19 @@ void AVForm::on_outDevCombobox_currentIndexChanged(int deviceIndex)
|
|||||||
|
|
||||||
audio->reinitOutput(deviceName);
|
audio->reinitOutput(deviceName);
|
||||||
playbackSlider->setEnabled(outputEnabled);
|
playbackSlider->setEnabled(outputEnabled);
|
||||||
playbackSlider->setSliderPosition(getStepsFromValue(audio->outputVolume(),
|
playbackSlider->setSliderPosition(
|
||||||
audio->minOutputVolume(), audio->maxOutputVolume()));
|
getStepsFromValue(audio->outputVolume(), audio->minOutputVolume(), audio->maxOutputVolume()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::on_playbackSlider_valueChanged(int sliderSteps)
|
void AVForm::on_playbackSlider_valueChanged(int sliderSteps)
|
||||||
{
|
{
|
||||||
const int settingsVolume = getValueFromSteps(sliderSteps,
|
const int settingsVolume = getValueFromSteps(sliderSteps, audioSettings->getOutVolumeMin(),
|
||||||
audioSettings->getOutVolumeMin(),audioSettings->getOutVolumeMax());
|
audioSettings->getOutVolumeMax());
|
||||||
audioSettings->setOutVolume(settingsVolume);
|
audioSettings->setOutVolume(settingsVolume);
|
||||||
|
|
||||||
if (audio->isOutputReady()) {
|
if (audio->isOutputReady()) {
|
||||||
const qreal volume = getValueFromSteps(sliderSteps, audio->minOutputVolume(), audio->maxOutputVolume());
|
const qreal volume =
|
||||||
|
getValueFromSteps(sliderSteps, audio->minOutputVolume(), audio->maxOutputVolume());
|
||||||
audio->setOutputVolume(volume);
|
audio->setOutputVolume(volume);
|
||||||
|
|
||||||
if (cbEnableTestSound->isChecked())
|
if (cbEnableTestSound->isChecked())
|
||||||
@ -597,7 +601,8 @@ void AVForm::on_microphoneSlider_valueChanged(int sliderSteps)
|
|||||||
|
|
||||||
void AVForm::on_audioThresholdSlider_valueChanged(int sliderSteps)
|
void AVForm::on_audioThresholdSlider_valueChanged(int sliderSteps)
|
||||||
{
|
{
|
||||||
const qreal normThreshold = getValueFromSteps(sliderSteps, audio->minInputThreshold(), audio->maxInputThreshold());
|
const qreal normThreshold =
|
||||||
|
getValueFromSteps(sliderSteps, audio->minInputThreshold(), audio->maxInputThreshold());
|
||||||
audioSettings->setAudioThreshold(normThreshold);
|
audioSettings->setAudioThreshold(normThreshold);
|
||||||
Audio::getInstance().setInputThreshold(normThreshold);
|
Audio::getInstance().setInputThreshold(normThreshold);
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#include "src/core/core.h"
|
#include "src/core/core.h"
|
||||||
#include "src/core/coreav.h"
|
#include "src/core/coreav.h"
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/net/autoupdate.h"
|
#include "src/net/autoupdate.h"
|
||||||
#include "src/persistence/profile.h"
|
#include "src/persistence/profile.h"
|
||||||
#include "src/persistence/settings.h"
|
#include "src/persistence/settings.h"
|
||||||
#include "src/persistence/smileypack.h"
|
#include "src/persistence/smileypack.h"
|
||||||
#include "src/widget/form/settingswidget.h"
|
#include "src/widget/form/settingswidget.h"
|
||||||
#include "src/widget/style.h"
|
#include "src/widget/style.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
#include "src/widget/widget.h"
|
#include "src/widget/widget.h"
|
||||||
|
|
||||||
@ -153,7 +153,8 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
|
|||||||
|
|
||||||
|
|
||||||
#ifndef QTOX_PLATFORM_EXT
|
#ifndef QTOX_PLATFORM_EXT
|
||||||
bodyUI->autoAwayLabel->setEnabled(false); // these don't seem to change the appearance of the widgets,
|
bodyUI->autoAwayLabel->setEnabled(
|
||||||
|
false); // these don't seem to change the appearance of the widgets,
|
||||||
bodyUI->autoAwaySpinBox->setEnabled(false); // though they are unusable
|
bodyUI->autoAwaySpinBox->setEnabled(false); // though they are unusable
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "src/core/core.h"
|
#include "src/core/core.h"
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/nexus.h"
|
#include "src/nexus.h"
|
||||||
#include "src/persistence/history.h"
|
#include "src/persistence/history.h"
|
||||||
#include "src/persistence/profile.h"
|
#include "src/persistence/profile.h"
|
||||||
@ -33,6 +32,7 @@
|
|||||||
#include "src/widget/form/setpassworddialog.h"
|
#include "src/widget/form/setpassworddialog.h"
|
||||||
#include "src/widget/form/settingswidget.h"
|
#include "src/widget/form/settingswidget.h"
|
||||||
#include "src/widget/gui.h"
|
#include "src/widget/gui.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
#include "src/widget/widget.h"
|
#include "src/widget/widget.h"
|
||||||
|
|
||||||
|
@ -32,13 +32,13 @@
|
|||||||
|
|
||||||
#include "src/core/core.h"
|
#include "src/core/core.h"
|
||||||
#include "src/core/coreav.h"
|
#include "src/core/coreav.h"
|
||||||
#include "src/core/recursivesignalblocker.h"
|
|
||||||
#include "src/net/autoupdate.h"
|
#include "src/net/autoupdate.h"
|
||||||
#include "src/persistence/profile.h"
|
#include "src/persistence/profile.h"
|
||||||
#include "src/persistence/settings.h"
|
#include "src/persistence/settings.h"
|
||||||
#include "src/persistence/smileypack.h"
|
#include "src/persistence/smileypack.h"
|
||||||
#include "src/widget/form/settingswidget.h"
|
#include "src/widget/form/settingswidget.h"
|
||||||
#include "src/widget/style.h"
|
#include "src/widget/style.h"
|
||||||
|
#include "src/widget/tool/recursivesignalblocker.h"
|
||||||
#include "src/widget/translator.h"
|
#include "src/widget/translator.h"
|
||||||
#include "src/widget/widget.h"
|
#include "src/widget/widget.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user