show the number of connected clients in the MacOS task bar

This commit is contained in:
Volker Fischer 2015-12-18 20:17:31 +00:00
parent ef4ec1e261
commit 60a3f82912
4 changed files with 29 additions and 1 deletions

View file

@ -1,9 +1,13 @@
3.4.1 3.4.1
- show the number of connected clients in the MacOS task bar if more
than one client is connected
3.4.0
3.4.0 (2015-12-10)
- show the names of the connected clients in the server list - show the names of the connected clients in the server list

View file

@ -47,6 +47,7 @@ win32 {
winmm.lib \ winmm.lib \
ws2_32.lib ws2_32.lib
} else:macx { } else:macx {
QT += macextras
HEADERS += mac/sound.h HEADERS += mac/sound.h
SOURCES += mac/sound.cpp SOURCES += mac/sound.cpp
RC_FILE = mac/mainicon.icns RC_FILE = mac/mainicon.icns

View file

@ -778,6 +778,24 @@ void CClientDlg::SetMyWindowTitle ( const int iNumClients )
QString ( " (%1 users)" ).arg ( iNumClients ) ); QString ( " (%1 users)" ).arg ( iNumClients ) );
} }
} }
#if defined ( __APPLE__ ) || defined ( __MACOSX )
// for MacOS only we show the number of connected clients as a
// badge label text if more than one user is connected
// (only available in Qt5.2)
# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
if ( iNumClients > 1 )
{
// show the number of connected clients
QtMac::setBadgeLabelText ( QString ( "%1" ).arg ( iNumClients ) );
}
else
{
// clear the text (apply an empty string)
QtMac::setBadgeLabelText ( "" );
}
# endif
#endif
} }
void CClientDlg::ShowConnectionSetupDialog() void CClientDlg::ShowConnectionSetupDialog()

View file

@ -43,6 +43,11 @@
#include "connectdlg.h" #include "connectdlg.h"
#include "analyzerconsole.h" #include "analyzerconsole.h"
#include "ui_clientdlgbase.h" #include "ui_clientdlgbase.h"
#if defined ( __APPLE__ ) || defined ( __MACOSX )
# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
# include <QtMac>
# endif
#endif
/* Definitions ****************************************************************/ /* Definitions ****************************************************************/