mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(widget): remove Widget singleton access from GeneralForm
This commit is contained in:
parent
e57693fa8f
commit
c28b2604cd
|
@ -152,8 +152,7 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
|
||||||
|
|
||||||
|
|
||||||
#ifndef QTOX_PLATFORM_EXT
|
#ifndef QTOX_PLATFORM_EXT
|
||||||
bodyUI->autoAwayLabel->setEnabled(
|
bodyUI->autoAwayLabel->setEnabled(false); // these don't seem to change the appearance of the widgets,
|
||||||
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
|
||||||
|
|
||||||
|
@ -203,7 +202,7 @@ void GeneralForm::on_closeToTray_stateChanged()
|
||||||
void GeneralForm::on_lightTrayIcon_stateChanged()
|
void GeneralForm::on_lightTrayIcon_stateChanged()
|
||||||
{
|
{
|
||||||
Settings::getInstance().setLightTrayIcon(bodyUI->lightTrayIcon->isChecked());
|
Settings::getInstance().setLightTrayIcon(bodyUI->lightTrayIcon->isChecked());
|
||||||
Widget::getInstance()->updateIcons();
|
emit updateIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralForm::on_minimizeToTray_stateChanged()
|
void GeneralForm::on_minimizeToTray_stateChanged()
|
||||||
|
|
|
@ -38,6 +38,8 @@ public:
|
||||||
{
|
{
|
||||||
return tr("General");
|
return tr("General");
|
||||||
}
|
}
|
||||||
|
signals:
|
||||||
|
void updateIcons();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_transComboBox_currentIndexChanged(int index);
|
void on_transComboBox_currentIndexChanged(int index);
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, QWidget* parent)
|
SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Widget* parent)
|
||||||
: QWidget(parent, Qt::Window)
|
: QWidget(parent, Qt::Window)
|
||||||
{
|
{
|
||||||
CoreAV* coreAV = Core::getInstance()->getAv();
|
CoreAV* coreAV = Core::getInstance()->getAv();
|
||||||
|
@ -58,6 +58,8 @@ SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Q
|
||||||
bodyLayout->addWidget(settingsWidgets.get());
|
bodyLayout->addWidget(settingsWidgets.get());
|
||||||
|
|
||||||
std::unique_ptr<GeneralForm> gfrm(new GeneralForm(this));
|
std::unique_ptr<GeneralForm> gfrm(new GeneralForm(this));
|
||||||
|
connect(gfrm.get(), &GeneralForm::updateIcons, parent, &Widget::updateIcons);
|
||||||
|
|
||||||
std::unique_ptr<UserInterfaceForm> uifrm(new UserInterfaceForm(this));
|
std::unique_ptr<UserInterfaceForm> uifrm(new UserInterfaceForm(this));
|
||||||
std::unique_ptr<PrivacyForm> pfrm(new PrivacyForm());
|
std::unique_ptr<PrivacyForm> pfrm(new PrivacyForm());
|
||||||
AVForm* rawAvfrm = new AVForm(audio, coreAV, camera, audioSettings, videoSettings);
|
AVForm* rawAvfrm = new AVForm(audio, coreAV, camera, audioSettings, videoSettings);
|
||||||
|
|
|
@ -37,12 +37,13 @@ class QLabel;
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
class ContentLayout;
|
class ContentLayout;
|
||||||
class UpdateCheck;
|
class UpdateCheck;
|
||||||
|
class Widget;
|
||||||
|
|
||||||
class SettingsWidget : public QWidget
|
class SettingsWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, QWidget* parent = nullptr);
|
SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Widget* parent = nullptr);
|
||||||
~SettingsWidget();
|
~SettingsWidget();
|
||||||
|
|
||||||
bool isShown() const;
|
bool isShown() const;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user