Skip to content

Commit

Permalink
Hide and show system tray icon on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Mar 24, 2017
1 parent 4c0ace9 commit 2dac2d3
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/app/qgisapp.cpp
Expand Up @@ -1135,17 +1135,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

mTray = new QSystemTrayIcon();
mTray->setIcon( QIcon( QgsApplication::appIconPath() ) );
mTray->show();
#ifdef Q_OS_MAC
// We only want the system notifications, no need for constant menubar icon
mTray->hide();
#endif

#ifdef Q_OS_WIN
// We only want the system notifications, no need for constant menubar icon
mTray->hide();
#endif


connect( QgsApplication::taskManager(), &QgsTaskManager::statusChanged, this, &QgisApp::onTaskCompleteShowNotify );

Expand Down Expand Up @@ -12419,23 +12409,11 @@ QMenu *QgisApp::createPopupMenu()

void QgisApp::showSystemNotification( const QString title, const QString message )
{
#ifdef Q_OS_MAC
// Menubar icon is hidden on macOS, by default. Show to enable notification bubbles
// Menubar icon is hidden by default. Show to enable notification bubbles
mTray->show();
#endif
#ifdef Q_OS_WIN
// Menubar icon is hidden on macOS, by default. Show to enable notification bubbles
mTray->show();
#endif
mTray->showMessage( title, message );
#ifdef Q_OS_MAC
// Re-hide menubar icon
mTray->hide();
#endif
#ifdef Q_OS_WIN
// Re-hide menubar icon
mTray->hide();
#endif
}

void QgisApp::osmDownloadDialog()
Expand Down

0 comments on commit 2dac2d3

Please sign in to comment.