FEAT(client): Global shortcut to toggle TalkingUI

This commit is contained in:
Robert Adam 2021-04-30 17:15:10 +02:00
parent 86525e4bb9
commit de8bfcd0dd
2 changed files with 12 additions and 0 deletions

View File

@ -284,6 +284,10 @@ void MainWindow::createActions() {
gsSendClipboardTextMessage->qsWhatsThis =
tr("This will send your Clipboard content to the channel you are currently in.", "Global Shortcut");
gsToggleTalkingUI = new GlobalShortcut(this, idx++, tr("Toggle TalkingUI", "Global shortcut"));
gsToggleTalkingUI->setObjectName(QLatin1String("gsToggleTalkingUI"));
gsToggleTalkingUI->qsWhatsThis = tr("Toggles the visibility of the TalkingUI.", "Global Shortcut");
#ifndef Q_OS_MAC
qstiIcon->show();
#endif
@ -3056,6 +3060,12 @@ void MainWindow::on_gsSendClipboardTextMessage_triggered(bool down, QVariant) {
sendChatbarMessage(QApplication::clipboard()->text());
}
void MainWindow::on_gsToggleTalkingUI_triggered(bool down, QVariant) {
if (down) {
qaTalkingUIToggle->trigger();
}
}
void MainWindow::whisperReleased(QVariant scdata) {
if (Global::get().iPushToTalk <= 0)
return;

View File

@ -84,6 +84,7 @@ public:
GlobalShortcut *gsCycleTransmitMode, *gsToggleMainWindowVisibility, *gsTransmitModePushToTalk,
*gsTransmitModeContinuous, *gsTransmitModeVAD;
GlobalShortcut *gsSendTextMessage, *gsSendClipboardTextMessage;
GlobalShortcut *gsToggleTalkingUI;
DockTitleBar *dtbLogDockTitle, *dtbChatDockTitle;
ACLEditor *aclEdit;
@ -279,6 +280,7 @@ public slots:
void on_gsTransmitModeVAD_triggered(bool, QVariant);
void on_gsSendTextMessage_triggered(bool, QVariant);
void on_gsSendClipboardTextMessage_triggered(bool, QVariant);
void on_gsToggleTalkingUI_triggered(bool, QVariant);
void on_Reconnect_timeout();
void on_Icon_activated(QSystemTrayIcon::ActivationReason);
void on_qaTalkingUIToggle_triggered();