Bug #3302 - GUI does not show/hide when tray icon is double clicked

This commit is contained in:
Nick Bolton 2012-07-28 23:27:28 +00:00
parent 377858334b
commit 57327fba19
3 changed files with 14 additions and 8 deletions

View File

@ -342,12 +342,18 @@
</action>
<action name="m_pActionMinimize">
<property name="text">
<string>&amp;Minimize</string>
<string>&amp;Hide</string>
</property>
<property name="toolTip">
<string>Hide</string>
</property>
</action>
<action name="m_pActionRestore">
<property name="text">
<string>&amp;Restore</string>
<string>&amp;Show</string>
</property>
<property name="toolTip">
<string>Show</string>
</property>
</action>
<action name="m_pActionSave">

View File

@ -112,7 +112,7 @@ void MainWindow::start(bool firstRun)
createTrayIcon();
// always show. auto-hide only happens when we have a connection.
show();
showNormal();
m_versionChecker.checkLatest();
}
@ -172,6 +172,9 @@ void MainWindow::createTrayIcon()
m_pTrayIcon = new QSystemTrayIcon(this);
m_pTrayIcon->setContextMenu(m_pTrayIconMenu);
connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason)));
setIcon(synergyDisconnected);
m_pTrayIcon->show();
@ -232,9 +235,6 @@ void MainWindow::initConnections()
connect(m_pActionStopSynergy, SIGNAL(triggered()), this, SLOT(stopSynergy()));
connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(&m_versionChecker, SIGNAL(updateFound(const QString&)), this, SLOT(updateFound(const QString&)));
if (m_pTrayIcon)
connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
void MainWindow::saveSettings()
@ -259,7 +259,7 @@ void MainWindow::setIcon(qSynergyState state)
m_pTrayIcon->setIcon(icon);
}
void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
void MainWindow::trayActivated(QSystemTrayIcon::ActivationReason reason)
{
if (reason == QSystemTrayIcon::DoubleClick)
{

View File

@ -106,7 +106,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void on_m_pActionWizard_triggered();
void on_m_pElevateCheckBox_toggled(bool checked);
void synergyFinished(int exitCode, QProcess::ExitStatus);
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void trayActivated(QSystemTrayIcon::ActivationReason reason);
void startSynergy();
void stopSynergy();
void logOutput();