Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(UI): Add UI For controlling group join and leave system messages…
Browse files Browse the repository at this point in the history
… setting

Backported from 069ab92
  • Loading branch information
anthonybilinski committed Mar 5, 2022
1 parent 916e797 commit 423049d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/widget/form/settings/generalform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
bodyUI->closeToTray->setEnabled(showSystemTray);

bodyUI->statusChanges->setChecked(s.getStatusChangeNotificationEnabled());
bodyUI->groupJoinLeaveMessages->setChecked(s.getShowGroupJoinLeaveMessages());

bodyUI->autoAwaySpinBox->setValue(s.getAutoAwayTime());
bodyUI->autoSaveFilesDir->setText(s.getGlobalAutoAcceptDir());
Expand Down Expand Up @@ -215,6 +216,11 @@ void GeneralForm::on_statusChanges_stateChanged()
Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChanges->isChecked());
}

void GeneralForm::on_groupJoinLeaveMessages_stateChanged()
{
Settings::getInstance().setShowGroupJoinLeaveMessages(bodyUI->groupJoinLeaveMessages->isChecked());
}

void GeneralForm::on_autoAwaySpinBox_editingFinished()
{
int minutes = bodyUI->autoAwaySpinBox->value();
Expand Down
1 change: 1 addition & 0 deletions src/widget/form/settings/generalform.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private slots:
void on_autoAwaySpinBox_editingFinished();
void on_minimizeToTray_stateChanged();
void on_statusChanges_stateChanged();
void on_groupJoinLeaveMessages_stateChanged();
void on_autoacceptFiles_stateChanged();
void on_maxAutoAcceptSizeMB_editingFinished();
void on_autoSaveFilesDir_clicked();
Expand Down
8 changes: 8 additions & 0 deletions src/widget/form/settings/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ instead of closing itself.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="groupJoinLeaveMessages">
<property name="text">
<string>Add a chat message when a user joins or leaves a group</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -364,6 +371,7 @@ instead of closing itself.</string>
<tabstop>minimizeToTray</tabstop>
<tabstop>closeToTray</tabstop>
<tabstop>statusChanges</tabstop>
<tabstop>groupJoinLeaveMessages</tabstop>
<tabstop>autoAwaySpinBox</tabstop>
<tabstop>autoSaveFilesDir</tabstop>
<tabstop>autoacceptFiles</tabstop>
Expand Down

0 comments on commit 423049d

Please sign in to comment.