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

refactor(widget): make PrivacyForm use signals for clearAllReceipts()

This commit is contained in:
jenli669 2019-06-29 09:53:58 +02:00
parent 20979744c9
commit adab063a49
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E
3 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,7 @@ void PrivacyForm::on_cbKeepHistory_stateChanged()
{ {
Settings::getInstance().setEnableLogging(bodyUI->cbKeepHistory->isChecked()); Settings::getInstance().setEnableLogging(bodyUI->cbKeepHistory->isChecked());
if (!bodyUI->cbKeepHistory->isChecked()) { if (!bodyUI->cbKeepHistory->isChecked()) {
Widget::getInstance()->clearAllReceipts(); emit clearAllReceipts();
QMessageBox::StandardButton dialogDelHistory; QMessageBox::StandardButton dialogDelHistory;
dialogDelHistory = dialogDelHistory =
QMessageBox::question(nullptr, tr("Confirmation"), QMessageBox::question(nullptr, tr("Confirmation"),

View File

@ -37,6 +37,9 @@ public:
return tr("Privacy"); return tr("Privacy");
} }
signals:
void clearAllReceipts();
private slots: private slots:
void on_cbKeepHistory_stateChanged(); void on_cbKeepHistory_stateChanged();
void on_cbTypingNotification_stateChanged(); void on_cbTypingNotification_stateChanged();

View File

@ -62,6 +62,8 @@ SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, W
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());
connect(pfrm.get(), &PrivacyForm::clearAllReceipts, parent, &Widget::clearAllReceipts);
AVForm* rawAvfrm = new AVForm(audio, coreAV, camera, audioSettings, videoSettings); AVForm* rawAvfrm = new AVForm(audio, coreAV, camera, audioSettings, videoSettings);
std::unique_ptr<AVForm> avfrm(rawAvfrm); std::unique_ptr<AVForm> avfrm(rawAvfrm);
std::unique_ptr<AdvancedForm> expfrm(new AdvancedForm()); std::unique_ptr<AdvancedForm> expfrm(new AdvancedForm());