Skip to content

Commit

Permalink
Merge PR mumble-voip#6440: FIX(client): Correctly remember muted stat…
Browse files Browse the repository at this point in the history
…e across restarts
  • Loading branch information
Hartmnt authored Jun 2, 2024
2 parents 6bd2d2e + bab88eb commit 1c6e452
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/mumble/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ MainWindow::MainWindow(QWidget *p)
#endif
forceQuit = false;
restartOnQuit = false;
bAutoUnmute = false;

Channel::add(Channel::ROOT_ID, tr("Root"));

Expand Down Expand Up @@ -2716,7 +2715,7 @@ void MainWindow::on_qaAudioDeaf_triggered() {
return;
}

if (!qaAudioDeaf->isChecked() && bAutoUnmute) {
if (!qaAudioDeaf->isChecked() && Global::get().s.unmuteOnUndeaf) {
qaAudioDeaf->setChecked(true);
qaAudioMute->setChecked(false);
on_qaAudioMute_triggered();
Expand All @@ -2730,13 +2729,13 @@ void MainWindow::on_qaAudioDeaf_triggered() {
Global::get().s.bDeaf = qaAudioDeaf->isChecked();

if (Global::get().s.bDeaf && !Global::get().s.bMute) {
bAutoUnmute = true;
Global::get().s.bMute = true;
Global::get().s.unmuteOnUndeaf = true;
Global::get().s.bMute = true;
qaAudioMute->setChecked(true);
Global::get().l->log(Log::SelfDeaf, tr("Muted and deafened."));
} else if (Global::get().s.bDeaf) {
Global::get().l->log(Log::SelfDeaf, tr("Deafened."));
bAutoUnmute = false;
Global::get().s.unmuteOnUndeaf = false;
} else {
Global::get().l->log(Log::SelfUndeaf, tr("Undeafened."));
}
Expand Down
1 change: 0 additions & 1 deletion src/mumble/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class MainWindow : public QMainWindow, public Ui::MainWindow {
bool forceQuit;
/// Restart the client after shutdown
bool restartOnQuit;
bool bAutoUnmute;

/// Contains the cursor whose position is immediately before the image to
/// save when activating the "Save Image As..." context menu item.
Expand Down
1 change: 1 addition & 0 deletions src/mumble/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ struct Settings {
QString qsTxMuteCue = cqsDefaultMuteCue;

bool bTransmitPosition = false;
bool unmuteOnUndeaf = false;
bool bMute = false;
bool bDeaf = false;
bool bTTS = false;
Expand Down
1 change: 1 addition & 0 deletions src/mumble/SettingsKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace SettingsKeys {
*/

// Audio settings
const SettingsKey UNMUTE_ON_UNDEAF_KEY = { "unmute_on_undeaf" };
const SettingsKey MUTE_KEY = { "mute" };
const SettingsKey DEAF_KEY = { "deaf" };
const SettingsKey TRANSMIT_MODE_KEY = { "transmit_mode" };
Expand Down
1 change: 1 addition & 0 deletions src/mumble/SettingsMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
PROCESS(misc, CRASH_EMAIL_ADDRESS_KEY, crashReportEmail)

#define AUDIO_SETTINGS \
PROCESS(audio, UNMUTE_ON_UNDEAF_KEY, unmuteOnUndeaf) \
PROCESS(audio, MUTE_KEY, bMute) \
PROCESS(audio, DEAF_KEY, bDeaf) \
PROCESS(audio, TRANSMIT_MODE_KEY, atTransmit) \
Expand Down

0 comments on commit 1c6e452

Please sign in to comment.