mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
FEAT(client): Toggle positional audio shortcut
Added new global shortcut that toggles the state of positional audio Fixes #6133
This commit is contained in:
parent
1a630e171b
commit
5c9ebfa943
@ -57,6 +57,7 @@ enum Type {
|
||||
HelpAbout,
|
||||
HelpAboutQt,
|
||||
HelpVersionCheck,
|
||||
TogglePositionalAudio,
|
||||
};
|
||||
|
||||
// A few assertions meant to catch, if anyone inserts a new value in-between instead of appending
|
||||
@ -65,6 +66,7 @@ static_assert(PushToTalk == 1, "You may only append to the end of the enum!");
|
||||
static_assert(ToggleMinimalView == 9, "You may only append to the end of the enum!");
|
||||
static_assert(ToggleSearch == 22, "You may only append to the end of the enum!");
|
||||
static_assert(HelpVersionCheck == 43, "You may only append to the end of the enum!");
|
||||
static_assert(TogglePositionalAudio == 44, "You may only append to the end of the enum!");
|
||||
} // namespace GlobalShortcutType
|
||||
|
||||
#endif // MUMBLE_MUMBLE_GLOBALSHORTCUTTYPES_H_
|
||||
|
||||
@ -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("gsTogglePositionalAudio");
|
||||
gsTogglePositionalAudio->qsWhatsThis = tr("This will toggle positional audio on/off");
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
qstiIcon->show();
|
||||
#endif
|
||||
@ -3386,6 +3391,14 @@ void MainWindow::on_gsHelpVersionCheck_triggered(bool down, QVariant) {
|
||||
versionCheck();
|
||||
}
|
||||
|
||||
void MainWindow::on_gsTogglePositionalAudio_triggered(bool down, QVariant) {
|
||||
if (!down) {
|
||||
return;
|
||||
}
|
||||
|
||||
enablePositionalAudio(!Global::get().s.bPositionalAudio);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::whisperReleased(QVariant scdata) {
|
||||
if (Global::get().iPushToTalk <= 0)
|
||||
@ -4188,6 +4201,10 @@ void MainWindow::versionCheck() {
|
||||
new VersionCheck(false, this);
|
||||
}
|
||||
|
||||
void MainWindow::enablePositionalAudio(bool enable) {
|
||||
Global::get().s.bPositionalAudio = enable;
|
||||
}
|
||||
|
||||
void MainWindow::on_muteCuePopup_triggered() {
|
||||
if (Global::get().s.muteCueShown || Global::get().inConfigUI) {
|
||||
return;
|
||||
|
||||
@ -108,6 +108,7 @@ public:
|
||||
GlobalShortcut *gsConfigDialog, *gsAudioWizard, *gsConfigCert;
|
||||
GlobalShortcut *gsAudioTTS;
|
||||
GlobalShortcut *gsHelpAbout, *gsHelpAboutQt, *gsHelpVersionCheck;
|
||||
GlobalShortcut *gsTogglePositionalAudio;
|
||||
|
||||
DockTitleBar *dtbLogDockTitle, *dtbChatDockTitle;
|
||||
|
||||
@ -342,6 +343,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);
|
||||
@ -437,6 +439,7 @@ public:
|
||||
void openAboutDialog();
|
||||
void openAboutQtDialog();
|
||||
void versionCheck();
|
||||
void enablePositionalAudio(bool enable);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user