Skip to content
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

FR#1119 Transmission mode switching in toolbar #174

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/mumble/MainWindow.cpp
Expand Up @@ -355,6 +355,7 @@ void MainWindow::setupGui() {
qstiIcon->setContextMenu(qmTray);

updateTrayIcon();
updateTransmitModeIcons();

#ifdef USE_COCOA
setWindowOpacity(1.0f);
Expand Down Expand Up @@ -500,6 +501,29 @@ void MainWindow::updateTrayIcon() {
}
}

void MainWindow::updateTransmitModeIcons() {

switch (g.s.atTransmit)
{
case Settings::Continous:
qaSetTransmitModeContinous->setChecked(true);
qaSetTransmitModePushToTalk->setChecked(false);
qaSetTransmitModeVAD->setChecked(false);
return;
case Settings::VAD:
qaSetTransmitModeContinous->setChecked(false);
qaSetTransmitModePushToTalk->setChecked(false);
qaSetTransmitModeVAD->setChecked(true);
return;
case Settings::PushToTalk:
qaSetTransmitModeContinous->setChecked(false);
qaSetTransmitModePushToTalk->setChecked(true);
qaSetTransmitModeVAD->setChecked(false);
return;
}

}

Channel *MainWindow::getContextMenuChannel() {
if (cContextChannel)
return cContextChannel.data();
Expand Down Expand Up @@ -1000,6 +1024,30 @@ void MainWindow::on_qaSelfRegister_triggered() {
g.sh->registerUser(p->uiSession);
}

void MainWindow::on_qaSetTransmitModeContinous_triggered() {
g.s.atTransmit = Settings::Continous;

g.l->log(Log::Information, tr("Transmit Mode set to Continuous"));

updateTransmitModeIcons();
}

void MainWindow::on_qaSetTransmitModePushToTalk_triggered() {
g.s.atTransmit = Settings::PushToTalk;

g.l->log(Log::Information, tr("Transmit Mode set to Push to Talk"));

updateTransmitModeIcons();
}

void MainWindow::on_qaSetTransmitModeVAD_triggered() {
g.s.atTransmit = Settings::VAD;

g.l->log(Log::Information, tr("Transmit Mode set to Voice Activity"));

updateTransmitModeIcons();
}

void MainWindow::on_qmServer_aboutToShow() {
qmServer->clear();
qmServer->addAction(qaServerConnect);
Expand Down Expand Up @@ -2362,6 +2410,8 @@ void MainWindow::on_gsCycleTransmitMode_triggered(bool down, QVariant scdata)

g.l->log(Log::Information, tr("Cycled Transmit Mode to %1").arg(qsNewMode));
}

updateTransmitModeIcons();
}

void MainWindow::whisperReleased(QVariant scdata) {
Expand Down
4 changes: 4 additions & 0 deletions src/mumble/MainWindow.h
Expand Up @@ -130,6 +130,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void setOnTop(bool top);
void setShowDockTitleBars(bool doShow);
void updateTrayIcon();
void MainWindow::updateTransmitModeIcons();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void updateTransmitModeIcons();

QPair<QByteArray, QImage> openImageFile();
static const QString defaultStyleSheet;

Expand Down Expand Up @@ -184,6 +185,9 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void on_qmSelf_aboutToShow();
void on_qaSelfComment_triggered();
void on_qaSelfRegister_triggered();
void on_qaSetTransmitModeContinous_triggered();
void on_qaSetTransmitModePushToTalk_triggered();
void on_qaSetTransmitModeVAD_triggered();
void qmUser_aboutToShow();
void on_qaUserCommentReset_triggered();
void on_qaUserCommentView_triggered();
Expand Down
55 changes: 55 additions & 0 deletions src/mumble/MainWindow.ui
Expand Up @@ -182,6 +182,10 @@
<addaction name="separator"/>
<addaction name="qaSelfComment"/>
<addaction name="separator"/>
<addaction name="qaSetTransmitModeVAD"/>
<addaction name="qaSetTransmitModePushToTalk"/>
<addaction name="qaSetTransmitModeContinous"/>
<addaction name="separator"/>
<addaction name="qaConfigDialog"/>
<addaction name="separator"/>
<addaction name="qaFilterToggle"/>
Expand Down Expand Up @@ -826,6 +830,57 @@
<bool>false</bool>
</property>
</action>
<action name="qaSetTransmitModeContinous">
<property name="checkable">
<bool>true</bool>
</property>
<property name="iconText">
<string>C</string>
</property>
<property name="text">
<string>&amp;Continuous</string>
</property>
<property name="toolTip">
<string>Set Transmit Mode to Continuous</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
</action>
<action name="qaSetTransmitModeVAD">
<property name="checkable">
<bool>true</bool>
</property>
<property name="iconText">
<string>VA</string>
</property>
<property name="text">
<string>&amp;Voice Activity</string>
</property>
<property name="toolTip">
<string>Set Transmit Mode to Voice Activity</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
</action>
<action name="qaSetTransmitModePushToTalk">
<property name="checkable">
<bool>true</bool>
</property>
<property name="iconText">
<string>PTT</string>
</property>
<property name="text">
<string>&amp;Push to Talk</string>
</property>
<property name="toolTip">
<string>Set Transmit Mode to Push to Talk</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
</action>
<action name="qaSelfRegister">
<property name="text">
<string>R&amp;egister</string>
Expand Down