Merge branch 'statico-statico-icons' into v1-dev
|
|
@ -11,6 +11,11 @@ file (GLOB LEGACY_GUI_UI_FILES src/*.ui)
|
||||||
file (GLOB LEGACY_ACTIVATION_FILES src/*Activation* src/*License*)
|
file (GLOB LEGACY_ACTIVATION_FILES src/*Activation* src/*License*)
|
||||||
file (GLOB LEGACY_ZEROCONF_FILES src/Zeroconf*)
|
file (GLOB LEGACY_ZEROCONF_FILES src/Zeroconf*)
|
||||||
|
|
||||||
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
file (GLOB LEGACY_GUI_MAC_SOURCE_FILES src/*.mm)
|
||||||
|
list (APPEND LEGACY_GUI_SOURCE_FILES ${LEGACY_GUI_MAC_SOURCE_FILES})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (SYNERGY_ENTERPRISE)
|
if (SYNERGY_ENTERPRISE)
|
||||||
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ACTIVATION_FILES})
|
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ACTIVATION_FILES})
|
||||||
list (REMOVE_ITEM LEGACY_GUI_UI_FILES ${LEGACY_ACTIVATION_FILES})
|
list (REMOVE_ITEM LEGACY_GUI_UI_FILES ${LEGACY_ACTIVATION_FILES})
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,8 @@ macx {
|
||||||
QSYNERGY_ICON.path = Contents/Resources
|
QSYNERGY_ICON.path = Contents/Resources
|
||||||
QMAKE_BUNDLE_DATA += QSYNERGY_ICON
|
QMAKE_BUNDLE_DATA += QSYNERGY_ICON
|
||||||
LIBS += $$MACX_LIBS
|
LIBS += $$MACX_LIBS
|
||||||
|
HEADERS += src/OSXHelpers.h
|
||||||
|
SOURCES += src/OSXHelpers.mm
|
||||||
}
|
}
|
||||||
unix:!macx:LIBS += -ldns_sd
|
unix:!macx:LIBS += -ldns_sd
|
||||||
debug {
|
debug {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@
|
||||||
<file>image/spinning-wheel.gif</file>
|
<file>image/spinning-wheel.gif</file>
|
||||||
<file>icons/16x16/padlock.png</file>
|
<file>icons/16x16/padlock.png</file>
|
||||||
<file>icons/16x16/synergy-transfering.png</file>
|
<file>icons/16x16/synergy-transfering.png</file>
|
||||||
<file>icons/16x16/auto-config.png</file>
|
<file>icons/64x64/synergy-dark-transfering.png</file>
|
||||||
|
<file>icons/64x64/synergy-dark-disconnected.png</file>
|
||||||
|
<file>icons/64x64/synergy-dark-connected.png</file>
|
||||||
|
<file>icons/64x64/synergy-light-transfering.png</file>
|
||||||
|
<file>icons/64x64/synergy-light-disconnected.png</file>
|
||||||
|
<file>icons/64x64/synergy-light-connected.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 109 KiB |
BIN
src/gui/res/icons/64x64/synergy-dark-connected.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/gui/res/icons/64x64/synergy-dark-disconnected.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/gui/res/icons/64x64/synergy-dark-transfering.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/gui/res/icons/64x64/synergy-light-connected.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/gui/res/icons/64x64/synergy-light-disconnected.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/gui/res/icons/64x64/synergy-light-transfering.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/gui/res/mac/Synergy.icns
Normal file
|
|
@ -36,6 +36,10 @@
|
||||||
#include "SslCertificate.h"
|
#include "SslCertificate.h"
|
||||||
#include "Zeroconf.h"
|
#include "Zeroconf.h"
|
||||||
|
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
#include "OSXHelpers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
|
|
@ -63,7 +67,25 @@ static const char* tlsCheckString = "network encryption protocol: ";
|
||||||
|
|
||||||
static const int debugLogLevel = 1;
|
static const int debugLogLevel = 1;
|
||||||
|
|
||||||
static const char* synergyIconFiles[] =
|
static const char* synergyLightIconFiles[] =
|
||||||
|
{
|
||||||
|
":/res/icons/64x64/synergy-light-disconnected.png",
|
||||||
|
":/res/icons/64x64/synergy-light-disconnected.png",
|
||||||
|
":/res/icons/64x64/synergy-light-connected.png",
|
||||||
|
":/res/icons/64x64/synergy-light-transfering.png",
|
||||||
|
":/res/icons/64x64/synergy-light-disconnected.png"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char* synergyDarkIconFiles[] =
|
||||||
|
{
|
||||||
|
":/res/icons/64x64/synergy-dark-disconnected.png",
|
||||||
|
":/res/icons/64x64/synergy-dark-disconnected.png",
|
||||||
|
":/res/icons/64x64/synergy-dark-connected.png",
|
||||||
|
":/res/icons/64x64/synergy-dark-transfering.png",
|
||||||
|
":/res/icons/64x64/synergy-dark-disconnected.png" //synergyPendingRetry
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char* synergyDefaultIconFiles[] =
|
||||||
{
|
{
|
||||||
":/res/icons/16x16/synergy-disconnected.png", //synergyDisconnected
|
":/res/icons/16x16/synergy-disconnected.png", //synergyDisconnected
|
||||||
":/res/icons/16x16/synergy-disconnected.png", //synergyConnecting
|
":/res/icons/16x16/synergy-disconnected.png", //synergyConnecting
|
||||||
|
|
@ -333,7 +355,15 @@ void MainWindow::saveSettings()
|
||||||
void MainWindow::setIcon(qSynergyState state)
|
void MainWindow::setIcon(qSynergyState state)
|
||||||
{
|
{
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addFile(synergyIconFiles[state]);
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
if (isOSXInterfaceStyleDark())
|
||||||
|
icon.addFile(synergyDarkIconFiles[state]);
|
||||||
|
else
|
||||||
|
icon.addFile(synergyLightIconFiles[state]);
|
||||||
|
#else
|
||||||
|
icon.addFile(synergyDefaultIconFiles[state]);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_pTrayIcon)
|
if (m_pTrayIcon)
|
||||||
m_pTrayIcon->setIcon(icon);
|
m_pTrayIcon->setIcon(icon);
|
||||||
|
|
@ -528,7 +558,7 @@ void MainWindow::checkSecureSocket(const QString& line)
|
||||||
|
|
||||||
//Get the protocol version from the line
|
//Get the protocol version from the line
|
||||||
m_SecureSocketVersion = line.mid(index + strlen(tlsCheckString));
|
m_SecureSocketVersion = line.mid(index + strlen(tlsCheckString));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString MainWindow::getTimeStamp()
|
QString MainWindow::getTimeStamp()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
24
src/gui/src/OSXHelpers.h
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2015 Synergy Si Ltd.
|
||||||
|
*
|
||||||
|
* This package is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* found in the file LICENSE that should have accompanied this file.
|
||||||
|
*
|
||||||
|
* This package is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(OSXHELPERS__H)
|
||||||
|
|
||||||
|
#define OSXHELPERS__H
|
||||||
|
|
||||||
|
bool isOSXInterfaceStyleDark();
|
||||||
|
|
||||||
|
#endif
|
||||||
31
src/gui/src/OSXHelpers.mm
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2015 Synergy Si Ltd.
|
||||||
|
*
|
||||||
|
* This package is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* found in the file LICENSE that should have accompanied this file.
|
||||||
|
*
|
||||||
|
* This package is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "OSXHelpers.h"
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <CoreData/CoreData.h>
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
bool
|
||||||
|
isOSXInterfaceStyleDark()
|
||||||
|
{
|
||||||
|
// Implementation from http://stackoverflow.com/a/26472651
|
||||||
|
NSDictionary* dict = [[NSUserDefaults standardUserDefaults] persistentDomainForName:NSGlobalDomain];
|
||||||
|
id style = [dict objectForKey:@"AppleInterfaceStyle"];
|
||||||
|
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
||||||
|
}
|
||||||