-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT(client): Toggle positional audio shortcut #6133 #6326
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -412,6 +412,11 @@ void MainWindow::createActions() { | |
gsHelpVersionCheck->setObjectName(QLatin1String("gsHelpVersionCheck")); | ||
gsHelpVersionCheck->qsWhatsThis = tr("This will check if mumble is up to date"); | ||
|
||
gsTogglePositionalAudio = new GlobalShortcut(this, GlobalShortcutType::TogglePositionalAudio, | ||
tr("Toggle positional audio", "Global Shortcut")); | ||
gsTogglePositionalAudio->setObjectName(QLatin1String("gsTogglePositionalAudio")); | ||
gsTogglePositionalAudio->qsWhatsThis = tr("This will turn on/off positional audio"); | ||
|
||
#ifndef Q_OS_MAC | ||
qstiIcon->show(); | ||
#endif | ||
|
@@ -3350,6 +3355,14 @@ void MainWindow::on_gsHelpVersionCheck_triggered(bool down, QVariant) { | |
versionCheck(); | ||
} | ||
|
||
void MainWindow::on_gsTogglePositionalAudio_triggered(bool down, QVariant) { | ||
if (!down) { | ||
return; | ||
} | ||
|
||
togglePositionalAudio(!Global::get().s.bPositionalAudio); | ||
} | ||
|
||
|
||
void MainWindow::whisperReleased(QVariant scdata) { | ||
if (Global::get().iPushToTalk <= 0) | ||
|
@@ -4152,6 +4165,10 @@ void MainWindow::versionCheck() { | |
new VersionCheck(false, this); | ||
} | ||
|
||
void MainWindow::togglePositionalAudio(const bool &newState) { | ||
Global::get().s.bPositionalAudio = newState; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not what the name suggests. If it is supposed to toggle the positional audio state, this function shouldn't take a parameter for the new state as the new state is simply the inverted old state (e.g. |
||
} | ||
|
||
void MainWindow::on_muteCuePopup_triggered() { | ||
if (Global::get().s.muteCueShown || Global::get().inConfigUI) { | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindow { | |
GlobalShortcut *gsConfigDialog, *gsAudioWizard, *gsConfigCert; | ||
GlobalShortcut *gsAudioTTS; | ||
GlobalShortcut *gsHelpAbout, *gsHelpAboutQt, *gsHelpVersionCheck; | ||
GlobalShortcut *gsTogglePositionalAudio; | ||
|
||
DockTitleBar *dtbLogDockTitle, *dtbChatDockTitle; | ||
|
||
|
@@ -336,6 +337,7 @@ public slots: | |
void on_gsHelpAbout_triggered(bool, QVariant); | ||
void on_gsHelpAboutQt_triggered(bool, QVariant); | ||
void on_gsHelpVersionCheck_triggered(bool, QVariant); | ||
void on_gsTogglePositionalAudio_triggered(bool, QVariant); | ||
|
||
void on_Reconnect_timeout(); | ||
void on_Icon_activated(QSystemTrayIcon::ActivationReason); | ||
|
@@ -431,6 +433,7 @@ public slots: | |
void openAboutDialog(); | ||
void openAboutQtDialog(); | ||
void versionCheck(); | ||
void togglePositionalAudio(const bool &newState); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you take the boolean parameter by reference? This seems unnecessary as the size of a boolean is quite a bit smaller than the size of a pointer (which is what a reference really is, under the hood) and therefore passing the boolean by value should be more efficient. So in short: Unless you have good reason to do so, I would prefer if we passed the boolean by value instead of by reference. |
||
}; | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.