Skip to content
Permalink
Browse files

Merge PR #3604: Add tray menu action to show the main window

  • Loading branch information...
davidebeatrici committed Feb 22, 2019
2 parents ba08786 + 896d51a commit 755c2905c0c9ee6a21d816db6e66bc24a96f739d
Showing with 39 additions and 17 deletions.
  1. +10 −6 src/mumble/MainWindow.cpp
  2. +1 −1 src/mumble/MainWindow.h
  3. +9 −1 src/mumble/MainWindow.ui
  4. +19 −9 src/mumble/mumble_en.ts
@@ -138,6 +138,9 @@ MainWindow::MainWindow(QWidget *p) : QMainWindow(p) {
connect(qmChannel, SIGNAL(aboutToShow()), this, SLOT(qmChannel_aboutToShow()));
connect(qteChat, SIGNAL(entered(QString)), this, SLOT(sendChatbarMessage(QString)));

// Tray
connect(qstiIcon, SIGNAL(messageClicked()), this, SLOT(showRaiseWindow()));
connect(qaShow, SIGNAL(triggered()), this, SLOT(showRaiseWindow()));

// Explicitely add actions to mainwindow so their shortcuts are available
// if only the main window is visible (e.g. minimal mode)
@@ -3041,20 +3044,24 @@ void MainWindow::trayAboutToShow() {
qmTray->clear();
if (top) {
qmTray->addAction(qaQuit);
qmTray->addAction(qaShow);
qmTray->addSeparator();
qmTray->addAction(qaAudioDeaf);
qmTray->addAction(qaAudioMute);
} else {
qmTray->addAction(qaAudioMute);
qmTray->addAction(qaAudioDeaf);
qmTray->addSeparator();
qmTray->addAction(qaShow);
qmTray->addAction(qaQuit);
}
}

void MainWindow::on_Icon_messageClicked() {
if (isMinimized())
void MainWindow::showRaiseWindow() {
if (isMinimized()) {
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
}

show();
raise();
activateWindow();
@@ -3065,10 +3072,7 @@ void MainWindow::on_Icon_activated(QSystemTrayIcon::ActivationReason reason) {
case QSystemTrayIcon::Trigger:
case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::MiddleClick:
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
show();
raise();
activateWindow();
showRaiseWindow();
default: break;
}
}
@@ -262,7 +262,6 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void on_gsSendTextMessage_triggered(bool, QVariant);
void on_gsSendClipboardTextMessage_triggered(bool, QVariant);
void on_Reconnect_timeout();
void on_Icon_messageClicked();
void on_Icon_activated(QSystemTrayIcon::ActivationReason);
void voiceRecorderDialog_finished(int);
void qtvUserCurrentChanged(const QModelIndex &, const QModelIndex &);
@@ -283,6 +282,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void pttReleased();
void whisperReleased(QVariant scdata);
void onResetAudio();
void showRaiseWindow();
void on_qaFilterToggle_triggered();
/// Opens a save dialog for the image referenced by qtcSaveImageCursor.
void saveImageAs();
@@ -48,7 +48,7 @@
<x>0</x>
<y>0</y>
<width>671</width>
<height>21</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="qmConfig">
@@ -909,6 +909,14 @@ the channel's context menu.</string>
<bool>false</bool>
</property>
</action>
<action name="qaShow">
<property name="text">
<string>Show</string>
</property>
<property name="toolTip">
<string>Shows the main Mumble window.</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
@@ -4680,7 +4680,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<name>MainWindow</name>
<message>
<location filename="MainWindow.cpp" line="+107"/>
<location line="+2702"/>
<location line="+2705"/>
<source>Root</source>
<translation type="unfinished"></translation>
</message>
@@ -4838,13 +4838,13 @@ This field describes the size of an LCD device. The size is given either in pixe
</message>
<message>
<location line="+79"/>
<location line="+2798"/>
<location line="+2799"/>
<source>&lt;center&gt;Not connected&lt;/center&gt;</source>
<oldsource>Not connected</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2350"/>
<location line="-2351"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
@@ -5035,7 +5035,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<translation type="unfinished"></translation>
</message>
<message>
<location line="+80"/>
<location line="+81"/>
<source>&lt;center&gt;Type message to channel &apos;%1&apos; here&lt;/center&gt;</source>
<oldsource>Type message to channel &apos;%1&apos; here</oldsource>
<translation type="unfinished"></translation>
@@ -5070,7 +5070,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<translation type="unfinished"></translation>
</message>
<message>
<location line="-3104"/>
<location line="-3108"/>
<source>&amp;User</source>
<translation type="unfinished"></translation>
</message>
@@ -5080,7 +5080,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<translation type="unfinished"></translation>
</message>
<message>
<location line="+62"/>
<location line="+65"/>
<location line="+26"/>
<source>Use in conjunction with Whisper to.</source>
<comment>Global Shortcut</comment>
@@ -5416,7 +5416,7 @@ Otherwise abort and check your certificate and username.</source>
</message>
<message>
<location line="-2239"/>
<location line="+2451"/>
<location line="+2452"/>
<source>Images (*.png *.jpg *.jpeg)</source>
<translation type="unfinished"></translation>
</message>
@@ -6637,7 +6637,7 @@ the channel&apos;s context menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="MainWindow.cpp" line="-3068"/>
<location filename="MainWindow.cpp" line="-3072"/>
<source>&amp;Developer</source>
<translation type="unfinished"></translation>
</message>
@@ -6801,6 +6801,16 @@ the channel&apos;s context menu.</source>
<source>R&amp;egister...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location/>
<source>Show</source>
<translation type="unfinished"></translation>
</message>
<message>
<location/>
<source>Shows the main Mumble window.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
@@ -8816,7 +8826,7 @@ An access token is a text string, which can be used as a password for very simpl
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<location line="+19"/>
<source>Certificate details</source>
<translation type="unfinished"></translation>
</message>

0 comments on commit 755c290

Please sign in to comment.
You can’t perform that action at this time.