removed trunk; please commit to (and build patches against) release branches instead.

This commit is contained in:
Nick Bolton
2011-10-05 00:10:22 +00:00
parent 422fd7adf3
commit e65886857d
757 changed files with 7 additions and 341444 deletions

View File

@@ -1,18 +0,0 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
#
# 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 COPYING 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/>.
add_subdirectory(lib)
add_subdirectory(cmd)
add_subdirectory(test)

View File

@@ -1,17 +0,0 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
#
# 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 COPYING 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/>.
add_subdirectory(synergyc)
add_subdirectory(synergys)

View File

@@ -1 +0,0 @@
/*.aps

View File

@@ -1,373 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CMSWindowsClientTaskBarReceiver.h"
#include "CClient.h"
#include "CMSWindowsClipboard.h"
#include "LogOutputters.h"
#include "BasicTypes.h"
#include "CArch.h"
#include "CArchTaskBarWindows.h"
#include "CArchMiscWindows.h"
#include "resource.h"
#include "CMSWindowsScreen.h"
//
// CMSWindowsClientTaskBarReceiver
//
const UINT CMSWindowsClientTaskBarReceiver::s_stateToIconID[kMaxState] =
{
IDI_TASKBAR_NOT_RUNNING,
IDI_TASKBAR_NOT_WORKING,
IDI_TASKBAR_NOT_CONNECTED,
IDI_TASKBAR_NOT_CONNECTED,
IDI_TASKBAR_CONNECTED
};
CMSWindowsClientTaskBarReceiver::CMSWindowsClientTaskBarReceiver(
HINSTANCE appInstance, const CBufferedLogOutputter* logBuffer) :
CClientTaskBarReceiver(),
m_appInstance(appInstance),
m_window(NULL),
m_logBuffer(logBuffer)
{
for (UInt32 i = 0; i < kMaxState; ++i) {
m_icon[i] = loadIcon(s_stateToIconID[i]);
}
m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
// don't create the window yet. we'll create it on demand. this
// has the side benefit of being created in the thread used for
// the task bar. that's good because it means the existence of
// the window won't prevent changing the main thread's desktop.
// add ourself to the task bar
ARCH->addReceiver(this);
}
CMSWindowsClientTaskBarReceiver::~CMSWindowsClientTaskBarReceiver()
{
cleanup();
}
void
CMSWindowsClientTaskBarReceiver::cleanup()
{
ARCH->removeReceiver(this);
for (UInt32 i = 0; i < kMaxState; ++i) {
deleteIcon(m_icon[i]);
}
DestroyMenu(m_menu);
destroyWindow();
}
void
CMSWindowsClientTaskBarReceiver::showStatus()
{
// create the window
createWindow();
// lock self while getting status
lock();
// get the current status
std::string status = getToolTip();
// done getting status
unlock();
// update dialog
HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
if (!IsWindowVisible(m_window)) {
// position it by the mouse
POINT cursorPos;
GetCursorPos(&cursorPos);
RECT windowRect;
GetWindowRect(m_window, &windowRect);
int x = cursorPos.x;
int y = cursorPos.y;
int fw = GetSystemMetrics(SM_CXDLGFRAME);
int fh = GetSystemMetrics(SM_CYDLGFRAME);
int ww = windowRect.right - windowRect.left;
int wh = windowRect.bottom - windowRect.top;
int sw = GetSystemMetrics(SM_CXFULLSCREEN);
int sh = GetSystemMetrics(SM_CYFULLSCREEN);
if (fw < 1) {
fw = 1;
}
if (fh < 1) {
fh = 1;
}
if (x + ww - fw > sw) {
x -= ww - fw;
}
else {
x -= fw;
}
if (x < 0) {
x = 0;
}
if (y + wh - fh > sh) {
y -= wh - fh;
}
else {
y -= fh;
}
if (y < 0) {
y = 0;
}
SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
SWP_SHOWWINDOW);
}
}
void
CMSWindowsClientTaskBarReceiver::runMenu(int x, int y)
{
// do popup menu. we need a window to pass to TrackPopupMenu().
// the SetForegroundWindow() and SendMessage() calls around
// TrackPopupMenu() are to get the menu to be dismissed when
// another window gets activated and are just one of those
// win32 weirdnesses.
createWindow();
SetForegroundWindow(m_window);
HMENU menu = GetSubMenu(m_menu, 0);
SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
HMENU logLevelMenu = GetSubMenu(menu, 3);
CheckMenuRadioItem(logLevelMenu, 0, 6,
CLOG->getFilter() - kERROR, MF_BYPOSITION);
int n = TrackPopupMenu(menu,
TPM_NONOTIFY |
TPM_RETURNCMD |
TPM_LEFTBUTTON |
TPM_RIGHTBUTTON,
x, y, 0, m_window, NULL);
SendMessage(m_window, WM_NULL, 0, 0);
// perform the requested operation
switch (n) {
case IDC_TASKBAR_STATUS:
showStatus();
break;
case IDC_TASKBAR_LOG:
copyLog();
break;
case IDC_TASKBAR_SHOW_LOG:
ARCH->showConsole(true);
break;
case IDC_TASKBAR_LOG_LEVEL_ERROR:
CLOG->setFilter(kERROR);
break;
case IDC_TASKBAR_LOG_LEVEL_WARNING:
CLOG->setFilter(kWARNING);
break;
case IDC_TASKBAR_LOG_LEVEL_NOTE:
CLOG->setFilter(kNOTE);
break;
case IDC_TASKBAR_LOG_LEVEL_INFO:
CLOG->setFilter(kINFO);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG:
CLOG->setFilter(kDEBUG);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
CLOG->setFilter(kDEBUG1);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
CLOG->setFilter(kDEBUG2);
break;
case IDC_TASKBAR_QUIT:
quit();
break;
}
}
void
CMSWindowsClientTaskBarReceiver::primaryAction()
{
showStatus();
}
const IArchTaskBarReceiver::Icon
CMSWindowsClientTaskBarReceiver::getIcon() const
{
return reinterpret_cast<Icon>(m_icon[getStatus()]);
}
void
CMSWindowsClientTaskBarReceiver::copyLog() const
{
if (m_logBuffer != NULL) {
// collect log buffer
CString data;
for (CBufferedLogOutputter::const_iterator index = m_logBuffer->begin();
index != m_logBuffer->end(); ++index) {
data += *index;
data += "\n";
}
// copy log to clipboard
if (!data.empty()) {
CMSWindowsClipboard clipboard(m_window);
clipboard.open(0);
clipboard.emptyUnowned();
clipboard.add(IClipboard::kText, data);
clipboard.close();
}
}
}
void
CMSWindowsClientTaskBarReceiver::onStatusChanged()
{
if (IsWindowVisible(m_window)) {
showStatus();
}
}
HICON
CMSWindowsClientTaskBarReceiver::loadIcon(UINT id)
{
HANDLE icon = LoadImage(m_appInstance,
MAKEINTRESOURCE(id),
IMAGE_ICON,
0, 0,
LR_DEFAULTCOLOR);
return reinterpret_cast<HICON>(icon);
}
void
CMSWindowsClientTaskBarReceiver::deleteIcon(HICON icon)
{
if (icon != NULL) {
DestroyIcon(icon);
}
}
void
CMSWindowsClientTaskBarReceiver::createWindow()
{
// ignore if already created
if (m_window != NULL) {
return;
}
// get the status dialog
m_window = CreateDialogParam(m_appInstance,
MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
NULL,
(DLGPROC)&CMSWindowsClientTaskBarReceiver::staticDlgProc,
reinterpret_cast<LPARAM>(
reinterpret_cast<void*>(this)));
// window should appear on top of everything, including (especially)
// the task bar.
LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
// tell the task bar about this dialog
CArchTaskBarWindows::addDialog(m_window);
}
void
CMSWindowsClientTaskBarReceiver::destroyWindow()
{
if (m_window != NULL) {
CArchTaskBarWindows::removeDialog(m_window);
DestroyWindow(m_window);
m_window = NULL;
}
}
BOOL
CMSWindowsClientTaskBarReceiver::dlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
// use default focus
return TRUE;
case WM_ACTIVATE:
// hide when another window is activated
if (LOWORD(wParam) == WA_INACTIVE) {
ShowWindow(hwnd, SW_HIDE);
}
break;
}
return FALSE;
}
BOOL CALLBACK
CMSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam)
{
// if msg is WM_INITDIALOG, extract the CMSWindowsClientTaskBarReceiver*
// and put it in the extra window data then forward the call.
CMSWindowsClientTaskBarReceiver* self = NULL;
if (msg == WM_INITDIALOG) {
self = reinterpret_cast<CMSWindowsClientTaskBarReceiver*>(
reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam);
}
else {
// get the extra window data and forward the call
LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (data != 0) {
self = (CMSWindowsClientTaskBarReceiver*) data;
}
}
// forward the message
if (self != NULL) {
return self->dlgProc(hwnd, msg, wParam, lParam);
}
else {
return (msg == WM_INITDIALOG) ? TRUE : FALSE;
}
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
CArchMiscWindows::setIcons(
(HICON)LoadImage(CArchMiscWindows::instanceWin32(),
MAKEINTRESOURCE(IDI_SYNERGY),
IMAGE_ICON,
32, 32, LR_SHARED),
(HICON)LoadImage(CArchMiscWindows::instanceWin32(),
MAKEINTRESOURCE(IDI_SYNERGY),
IMAGE_ICON,
16, 16, LR_SHARED));
return new CMSWindowsClientTaskBarReceiver(
CMSWindowsScreen::getInstance(), logBuffer);
}

View File

@@ -1,68 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef CMSWINDOWSCLIENTTASKBARRECEIVER_H
#define CMSWINDOWSCLIENTTASKBARRECEIVER_H
#define WIN32_LEAN_AND_MEAN
#include "CClientTaskBarReceiver.h"
#include <windows.h>
class CBufferedLogOutputter;
//! Implementation of CClientTaskBarReceiver for Microsoft Windows
class CMSWindowsClientTaskBarReceiver : public CClientTaskBarReceiver {
public:
CMSWindowsClientTaskBarReceiver(HINSTANCE, const CBufferedLogOutputter*);
virtual ~CMSWindowsClientTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
void cleanup();
protected:
void copyLog() const;
// CClientTaskBarReceiver overrides
virtual void onStatusChanged();
private:
HICON loadIcon(UINT);
void deleteIcon(HICON);
void createWindow();
void destroyWindow();
BOOL dlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam);
static BOOL CALLBACK
staticDlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam);
private:
HINSTANCE m_appInstance;
HWND m_window;
HMENU m_menu;
HICON m_icon[kMaxState];
const CBufferedLogOutputter* m_logBuffer;
static const UINT s_stateToIconID[];
};
#endif

View File

@@ -1,66 +0,0 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
#
# 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 COPYING 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/>.
set(src
synergyc.cpp
)
if (WIN32)
list(APPEND src
CMSWindowsClientTaskBarReceiver.cpp
CMSWindowsClientTaskBarReceiver.h
resource.h
synergyc.ico
synergyc.rc
tb_error.ico
tb_idle.ico
tb_run.ico
tb_wait.ico
)
elseif (APPLE)
list(APPEND src COSXClientTaskBarReceiver.cpp)
elseif (UNIX)
list(APPEND src CXWindowsClientTaskBarReceiver.cpp)
endif()
set(inc
../../lib/arch
../../lib/base
../../lib/client
../../lib/common
../../lib/io
../../lib/mt
../../lib/net
../../lib/platform
../../lib/synergy
)
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc})
add_executable(synergyc ${src})
target_link_libraries(synergyc
arch base client common io mt net platform server synergy ${libs})
if (CONF_CPACK)
install(TARGETS
synergyc
COMPONENT core
DESTINATION bin)
endif()

View File

@@ -1,66 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "COSXClientTaskBarReceiver.h"
#include "CArch.h"
//
// COSXClientTaskBarReceiver
//
COSXClientTaskBarReceiver::COSXClientTaskBarReceiver(
const CBufferedLogOutputter*)
{
// add ourself to the task bar
ARCH->addReceiver(this);
}
COSXClientTaskBarReceiver::~COSXClientTaskBarReceiver()
{
ARCH->removeReceiver(this);
}
void
COSXClientTaskBarReceiver::showStatus()
{
// do nothing
}
void
COSXClientTaskBarReceiver::runMenu(int, int)
{
// do nothing
}
void
COSXClientTaskBarReceiver::primaryAction()
{
// do nothing
}
const IArchTaskBarReceiver::Icon
COSXClientTaskBarReceiver::getIcon() const
{
return NULL;
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
return new COSXClientTaskBarReceiver(logBuffer);
}

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef COSXCLIENTTASKBARRECEIVER_H
#define COSXCLIENTTASKBARRECEIVER_H
#include "CClientTaskBarReceiver.h"
class CBufferedLogOutputter;
//! Implementation of CClientTaskBarReceiver for OS X
class COSXClientTaskBarReceiver : public CClientTaskBarReceiver {
public:
COSXClientTaskBarReceiver(const CBufferedLogOutputter*);
virtual ~COSXClientTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
};
#endif

View File

@@ -1,65 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CXWindowsClientTaskBarReceiver.h"
#include "CArch.h"
//
// CXWindowsClientTaskBarReceiver
//
CXWindowsClientTaskBarReceiver::CXWindowsClientTaskBarReceiver(
const CBufferedLogOutputter*)
{
// add ourself to the task bar
ARCH->addReceiver(this);
}
CXWindowsClientTaskBarReceiver::~CXWindowsClientTaskBarReceiver()
{
ARCH->removeReceiver(this);
}
void
CXWindowsClientTaskBarReceiver::showStatus()
{
// do nothing
}
void
CXWindowsClientTaskBarReceiver::runMenu(int, int)
{
// do nothing
}
void
CXWindowsClientTaskBarReceiver::primaryAction()
{
// do nothing
}
const IArchTaskBarReceiver::Icon
CXWindowsClientTaskBarReceiver::getIcon() const
{
return NULL;
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
return new CXWindowsClientTaskBarReceiver(logBuffer);
}

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef CXWINDOWSCLIENTTASKBARRECEIVER_H
#define CXWINDOWSCLIENTTASKBARRECEIVER_H
#include "CClientTaskBarReceiver.h"
class CBufferedLogOutputter;
//! Implementation of CClientTaskBarReceiver for X Windows
class CXWindowsClientTaskBarReceiver : public CClientTaskBarReceiver {
public:
CXWindowsClientTaskBarReceiver(const CBufferedLogOutputter*);
virtual ~CXWindowsClientTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
};
#endif

View File

@@ -1,37 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by synergyc.rc
//
#define IDS_FAILED 1
#define IDS_INIT_FAILED 2
#define IDS_UNCAUGHT_EXCEPTION 3
#define IDI_SYNERGY 101
#define IDI_TASKBAR_NOT_RUNNING 102
#define IDI_TASKBAR_NOT_WORKING 103
#define IDI_TASKBAR_NOT_CONNECTED 104
#define IDI_TASKBAR_CONNECTED 105
#define IDR_TASKBAR 107
#define IDD_TASKBAR_STATUS 108
#define IDC_TASKBAR_STATUS_STATUS 1000
#define IDC_TASKBAR_QUIT 40001
#define IDC_TASKBAR_STATUS 40002
#define IDC_TASKBAR_LOG 40003
#define IDC_TASKBAR_SHOW_LOG 40004
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40016
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,35 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CClientApp.h"
#if WINAPI_MSWINDOWS
#include "CMSWindowsClientTaskBarReceiver.h"
#elif WINAPI_XWINDOWS
#include "CXWindowsClientTaskBarReceiver.h"
#elif WINAPI_CARBON
#include "COSXClientTaskBarReceiver.h"
#else
#error Platform not supported.
#endif
int
main(int argc, char** argv)
{
CClientApp app(createTaskBarReceiver);
return app.run(argc, argv);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

View File

@@ -1,141 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winresrc.h>
#if !defined(IDC_STATIC)
#define IDC_STATIC (-1)
#endif
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include <winresrc.h>\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SYNERGY ICON DISCARDABLE "synergyc.ico"
IDI_TASKBAR_NOT_RUNNING ICON DISCARDABLE "tb_idle.ico"
IDI_TASKBAR_NOT_WORKING ICON DISCARDABLE "tb_error.ico"
IDI_TASKBAR_NOT_CONNECTED ICON DISCARDABLE "tb_wait.ico"
IDI_TASKBAR_CONNECTED ICON DISCARDABLE "tb_run.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_TASKBAR_STATUS DIALOG DISCARDABLE 0, 0, 145, 18
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL |
ES_READONLY | NOT WS_BORDER
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_TASKBAR MENU DISCARDABLE
BEGIN
POPUP "Synergy"
BEGIN
MENUITEM "Show Status", IDC_TASKBAR_STATUS
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
POPUP "Set Log Level"
BEGIN
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
END
MENUITEM SEPARATOR
MENUITEM "Quit", IDC_TASKBAR_QUIT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_FAILED "Synergy is about to quit with errors or warnings. Please check the log then click OK."
IDS_INIT_FAILED "Synergy failed to initialize: %{1}"
IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

View File

@@ -1 +0,0 @@
/*.aps

View File

@@ -1,404 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CMSWindowsServerTaskBarReceiver.h"
#include "CServer.h"
#include "CMSWindowsClipboard.h"
#include "IEventQueue.h"
#include "LogOutputters.h"
#include "BasicTypes.h"
#include "CArch.h"
#include "CArchTaskBarWindows.h"
#include "resource.h"
#include "CArchMiscWindows.h"
#include "CMSWindowsScreen.h"
//
// CMSWindowsServerTaskBarReceiver
//
const UINT CMSWindowsServerTaskBarReceiver::s_stateToIconID[kMaxState] =
{
IDI_TASKBAR_NOT_RUNNING,
IDI_TASKBAR_NOT_WORKING,
IDI_TASKBAR_NOT_CONNECTED,
IDI_TASKBAR_CONNECTED
};
CMSWindowsServerTaskBarReceiver::CMSWindowsServerTaskBarReceiver(
HINSTANCE appInstance, const CBufferedLogOutputter* logBuffer) :
CServerTaskBarReceiver(),
m_appInstance(appInstance),
m_window(NULL),
m_logBuffer(logBuffer)
{
for (UInt32 i = 0; i < kMaxState; ++i) {
m_icon[i] = loadIcon(s_stateToIconID[i]);
}
m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
// don't create the window yet. we'll create it on demand. this
// has the side benefit of being created in the thread used for
// the task bar. that's good because it means the existence of
// the window won't prevent changing the main thread's desktop.
// add ourself to the task bar
ARCH->addReceiver(this);
}
void
CMSWindowsServerTaskBarReceiver::cleanup()
{
ARCH->removeReceiver(this);
for (UInt32 i = 0; i < kMaxState; ++i) {
deleteIcon(m_icon[i]);
}
DestroyMenu(m_menu);
destroyWindow();
}
CMSWindowsServerTaskBarReceiver::~CMSWindowsServerTaskBarReceiver()
{
cleanup();
}
void
CMSWindowsServerTaskBarReceiver::showStatus()
{
// create the window
createWindow();
// lock self while getting status
lock();
// get the current status
std::string status = getToolTip();
// get the connect clients, if any
const CClients& clients = getClients();
// done getting status
unlock();
// update dialog
HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_CLIENTS);
SendMessage(child, LB_RESETCONTENT, 0, 0);
for (CClients::const_iterator index = clients.begin();
index != clients.end(); ) {
const char* client = index->c_str();
if (++index == clients.end()) {
SendMessage(child, LB_ADDSTRING, 0, (LPARAM)client);
}
else {
SendMessage(child, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)client);
}
}
if (!IsWindowVisible(m_window)) {
// position it by the mouse
POINT cursorPos;
GetCursorPos(&cursorPos);
RECT windowRect;
GetWindowRect(m_window, &windowRect);
int x = cursorPos.x;
int y = cursorPos.y;
int fw = GetSystemMetrics(SM_CXDLGFRAME);
int fh = GetSystemMetrics(SM_CYDLGFRAME);
int ww = windowRect.right - windowRect.left;
int wh = windowRect.bottom - windowRect.top;
int sw = GetSystemMetrics(SM_CXFULLSCREEN);
int sh = GetSystemMetrics(SM_CYFULLSCREEN);
if (fw < 1) {
fw = 1;
}
if (fh < 1) {
fh = 1;
}
if (x + ww - fw > sw) {
x -= ww - fw;
}
else {
x -= fw;
}
if (x < 0) {
x = 0;
}
if (y + wh - fh > sh) {
y -= wh - fh;
}
else {
y -= fh;
}
if (y < 0) {
y = 0;
}
SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
SWP_SHOWWINDOW);
}
}
void
CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
{
// do popup menu. we need a window to pass to TrackPopupMenu().
// the SetForegroundWindow() and SendMessage() calls around
// TrackPopupMenu() are to get the menu to be dismissed when
// another window gets activated and are just one of those
// win32 weirdnesses.
createWindow();
SetForegroundWindow(m_window);
HMENU menu = GetSubMenu(m_menu, 0);
SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
HMENU logLevelMenu = GetSubMenu(menu, 3);
CheckMenuRadioItem(logLevelMenu, 0, 6,
CLOG->getFilter() - kERROR, MF_BYPOSITION);
int n = TrackPopupMenu(menu,
TPM_NONOTIFY |
TPM_RETURNCMD |
TPM_LEFTBUTTON |
TPM_RIGHTBUTTON,
x, y, 0, m_window, NULL);
SendMessage(m_window, WM_NULL, 0, 0);
// perform the requested operation
switch (n) {
case IDC_TASKBAR_STATUS:
showStatus();
break;
case IDC_TASKBAR_LOG:
copyLog();
break;
case IDC_TASKBAR_SHOW_LOG:
ARCH->showConsole(true);
break;
case IDC_RELOAD_CONFIG:
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
IEventQueue::getSystemTarget()));
break;
case IDC_FORCE_RECONNECT:
EVENTQUEUE->addEvent(CEvent(getForceReconnectEvent(),
IEventQueue::getSystemTarget()));
break;
case ID_SYNERGY_RESETSERVER:
EVENTQUEUE->addEvent(CEvent(getResetServerEvent(),
IEventQueue::getSystemTarget()));
break;
case IDC_TASKBAR_LOG_LEVEL_ERROR:
CLOG->setFilter(kERROR);
break;
case IDC_TASKBAR_LOG_LEVEL_WARNING:
CLOG->setFilter(kWARNING);
break;
case IDC_TASKBAR_LOG_LEVEL_NOTE:
CLOG->setFilter(kNOTE);
break;
case IDC_TASKBAR_LOG_LEVEL_INFO:
CLOG->setFilter(kINFO);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG:
CLOG->setFilter(kDEBUG);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
CLOG->setFilter(kDEBUG1);
break;
case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
CLOG->setFilter(kDEBUG2);
break;
case IDC_TASKBAR_QUIT:
quit();
break;
}
}
void
CMSWindowsServerTaskBarReceiver::primaryAction()
{
showStatus();
}
const IArchTaskBarReceiver::Icon
CMSWindowsServerTaskBarReceiver::getIcon() const
{
return reinterpret_cast<Icon>(m_icon[getStatus()]);
}
void
CMSWindowsServerTaskBarReceiver::copyLog() const
{
if (m_logBuffer != NULL) {
// collect log buffer
CString data;
for (CBufferedLogOutputter::const_iterator index = m_logBuffer->begin();
index != m_logBuffer->end(); ++index) {
data += *index;
data += "\n";
}
// copy log to clipboard
if (!data.empty()) {
CMSWindowsClipboard clipboard(m_window);
clipboard.open(0);
clipboard.emptyUnowned();
clipboard.add(IClipboard::kText, data);
clipboard.close();
}
}
}
void
CMSWindowsServerTaskBarReceiver::onStatusChanged()
{
if (IsWindowVisible(m_window)) {
showStatus();
}
}
HICON
CMSWindowsServerTaskBarReceiver::loadIcon(UINT id)
{
HANDLE icon = LoadImage(m_appInstance,
MAKEINTRESOURCE(id),
IMAGE_ICON,
0, 0,
LR_DEFAULTCOLOR);
return reinterpret_cast<HICON>(icon);
}
void
CMSWindowsServerTaskBarReceiver::deleteIcon(HICON icon)
{
if (icon != NULL) {
DestroyIcon(icon);
}
}
void
CMSWindowsServerTaskBarReceiver::createWindow()
{
// ignore if already created
if (m_window != NULL) {
return;
}
// get the status dialog
m_window = CreateDialogParam(m_appInstance,
MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
NULL,
(DLGPROC)&CMSWindowsServerTaskBarReceiver::staticDlgProc,
reinterpret_cast<LPARAM>(
reinterpret_cast<void*>(this)));
// window should appear on top of everything, including (especially)
// the task bar.
LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
// tell the task bar about this dialog
CArchTaskBarWindows::addDialog(m_window);
}
void
CMSWindowsServerTaskBarReceiver::destroyWindow()
{
if (m_window != NULL) {
CArchTaskBarWindows::removeDialog(m_window);
DestroyWindow(m_window);
m_window = NULL;
}
}
BOOL
CMSWindowsServerTaskBarReceiver::dlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
// use default focus
return TRUE;
case WM_ACTIVATE:
// hide when another window is activated
if (LOWORD(wParam) == WA_INACTIVE) {
ShowWindow(hwnd, SW_HIDE);
}
break;
}
return FALSE;
}
BOOL CALLBACK
CMSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam)
{
// if msg is WM_INITDIALOG, extract the CMSWindowsServerTaskBarReceiver*
// and put it in the extra window data then forward the call.
CMSWindowsServerTaskBarReceiver* self = NULL;
if (msg == WM_INITDIALOG) {
self = reinterpret_cast<CMSWindowsServerTaskBarReceiver*>(
reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
}
else {
// get the extra window data and forward the call
LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (data != 0) {
self = reinterpret_cast<CMSWindowsServerTaskBarReceiver*>(
reinterpret_cast<void*>(data));
}
}
// forward the message
if (self != NULL) {
return self->dlgProc(hwnd, msg, wParam, lParam);
}
else {
return (msg == WM_INITDIALOG) ? TRUE : FALSE;
}
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
CArchMiscWindows::setIcons(
(HICON)LoadImage(CArchMiscWindows::instanceWin32(),
MAKEINTRESOURCE(IDI_SYNERGY),
IMAGE_ICON,
32, 32, LR_SHARED),
(HICON)LoadImage(CArchMiscWindows::instanceWin32(),
MAKEINTRESOURCE(IDI_SYNERGY),
IMAGE_ICON,
16, 16, LR_SHARED));
return new CMSWindowsServerTaskBarReceiver(
CMSWindowsScreen::getInstance(), logBuffer);
}

View File

@@ -1,68 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef CMSWINDOWSSERVERTASKBARRECEIVER_H
#define CMSWINDOWSSERVERTASKBARRECEIVER_H
#define WIN32_LEAN_AND_MEAN
#include "CServerTaskBarReceiver.h"
#include <windows.h>
class CBufferedLogOutputter;
//! Implementation of CServerTaskBarReceiver for Microsoft Windows
class CMSWindowsServerTaskBarReceiver : public CServerTaskBarReceiver {
public:
CMSWindowsServerTaskBarReceiver(HINSTANCE, const CBufferedLogOutputter*);
virtual ~CMSWindowsServerTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
void cleanup();
protected:
void copyLog() const;
// CServerTaskBarReceiver overrides
virtual void onStatusChanged();
private:
HICON loadIcon(UINT);
void deleteIcon(HICON);
void createWindow();
void destroyWindow();
BOOL dlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam);
static BOOL CALLBACK
staticDlgProc(HWND hwnd,
UINT msg, WPARAM wParam, LPARAM lParam);
private:
HINSTANCE m_appInstance;
HWND m_window;
HMENU m_menu;
HICON m_icon[kMaxState];
const CBufferedLogOutputter* m_logBuffer;
static const UINT s_stateToIconID[];
};
#endif

View File

@@ -1,66 +0,0 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
#
# 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 COPYING 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/>.
set(src
synergys.cpp
)
if (WIN32)
list(APPEND src
CMSWindowsServerTaskBarReceiver.cpp
CMSWindowsServerTaskBarReceiver.h
resource.h
synergys.ico
synergys.rc
tb_error.ico
tb_idle.ico
tb_run.ico
tb_wait.ico
)
elseif (APPLE)
list(APPEND src COSXServerTaskBarReceiver.cpp)
elseif (UNIX)
list(APPEND src CXWindowsServerTaskBarReceiver.cpp)
endif()
set(inc
../../lib/arch
../../lib/base
../../lib/common
../../lib/io
../../lib/mt
../../lib/net
../../lib/platform
../../lib/synergy
../../lib/server
)
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc})
add_executable(synergys ${src})
target_link_libraries(synergys
arch base client common io mt net platform server synergy ${libs})
if (CONF_CPACK)
install(TARGETS
synergys
COMPONENT core
DESTINATION bin)
endif()

View File

@@ -1,65 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "COSXServerTaskBarReceiver.h"
#include "CArch.h"
//
// COSXServerTaskBarReceiver
//
COSXServerTaskBarReceiver::COSXServerTaskBarReceiver(
const CBufferedLogOutputter*)
{
// add ourself to the task bar
ARCH->addReceiver(this);
}
COSXServerTaskBarReceiver::~COSXServerTaskBarReceiver()
{
ARCH->removeReceiver(this);
}
void
COSXServerTaskBarReceiver::showStatus()
{
// do nothing
}
void
COSXServerTaskBarReceiver::runMenu(int, int)
{
// do nothing
}
void
COSXServerTaskBarReceiver::primaryAction()
{
// do nothing
}
const IArchTaskBarReceiver::Icon
COSXServerTaskBarReceiver::getIcon() const
{
return NULL;
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
return new COSXServerTaskBarReceiver(logBuffer);
}

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef COSXSERVERTASKBARRECEIVER_H
#define COSXSERVERTASKBARRECEIVER_H
#include "CServerTaskBarReceiver.h"
class CBufferedLogOutputter;
//! Implementation of CServerTaskBarReceiver for OS X
class COSXServerTaskBarReceiver : public CServerTaskBarReceiver {
public:
COSXServerTaskBarReceiver(const CBufferedLogOutputter*);
virtual ~COSXServerTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
};
#endif

View File

@@ -1,65 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CXWindowsServerTaskBarReceiver.h"
#include "CArch.h"
//
// CXWindowsServerTaskBarReceiver
//
CXWindowsServerTaskBarReceiver::CXWindowsServerTaskBarReceiver(
const CBufferedLogOutputter*)
{
// add ourself to the task bar
ARCH->addReceiver(this);
}
CXWindowsServerTaskBarReceiver::~CXWindowsServerTaskBarReceiver()
{
ARCH->removeReceiver(this);
}
void
CXWindowsServerTaskBarReceiver::showStatus()
{
// do nothing
}
void
CXWindowsServerTaskBarReceiver::runMenu(int, int)
{
// do nothing
}
void
CXWindowsServerTaskBarReceiver::primaryAction()
{
// do nothing
}
const IArchTaskBarReceiver::Icon
CXWindowsServerTaskBarReceiver::getIcon() const
{
return NULL;
}
IArchTaskBarReceiver*
createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
{
return new CXWindowsServerTaskBarReceiver(logBuffer);
}

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#ifndef CXWINDOWSSERVERTASKBARRECEIVER_H
#define CXWINDOWSSERVERTASKBARRECEIVER_H
#include "CServerTaskBarReceiver.h"
class CBufferedLogOutputter;
//! Implementation of CServerTaskBarReceiver for X Windows
class CXWindowsServerTaskBarReceiver : public CServerTaskBarReceiver {
public:
CXWindowsServerTaskBarReceiver(const CBufferedLogOutputter*);
virtual ~CXWindowsServerTaskBarReceiver();
// IArchTaskBarReceiver overrides
virtual void showStatus();
virtual void runMenu(int x, int y);
virtual void primaryAction();
virtual const Icon getIcon() const;
};
#endif

View File

@@ -1,42 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by synergys.rc
//
#define IDS_FAILED 1
#define IDS_INIT_FAILED 2
#define IDS_UNCAUGHT_EXCEPTION 3
#define IDI_SYNERGY 101
#define IDI_TASKBAR_NOT_RUNNING 102
#define IDI_TASKBAR_NOT_WORKING 103
#define IDI_TASKBAR_NOT_CONNECTED 104
#define IDI_TASKBAR_CONNECTED 105
#define IDR_TASKBAR 107
#define IDD_TASKBAR_STATUS 108
#define IDC_TASKBAR_STATUS_STATUS 1000
#define IDC_TASKBAR_STATUS_CLIENTS 1001
#define IDC_TASKBAR_QUIT 40003
#define IDC_TASKBAR_STATUS 40004
#define IDC_TASKBAR_LOG 40005
#define IDC_RELOAD_CONFIG 40006
#define IDC_FORCE_RECONNECT 40007
#define IDC_TASKBAR_SHOW_LOG 40008
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
#define ID_SYNERGY_RELOADSYSTEM 40016
#define ID_SYNERGY_RESETSERVER 40017
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40018
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,35 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
*
* 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 COPYING 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/>.
*/
#include "CServerApp.h"
#if WINAPI_MSWINDOWS
#include "CMSWindowsServerTaskBarReceiver.h"
#elif WINAPI_XWINDOWS
#include "CXWindowsServerTaskBarReceiver.h"
#elif WINAPI_CARBON
#include "COSXServerTaskBarReceiver.h"
#else
#error Platform not supported.
#endif
int
main(int argc, char** argv)
{
CServerApp app(createTaskBarReceiver);
return app.run(argc, argv);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

View File

@@ -1,134 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winresrc.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include <winresrc.h>\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SYNERGY ICON "synergys.ico"
IDI_TASKBAR_NOT_RUNNING ICON "tb_idle.ico"
IDI_TASKBAR_NOT_WORKING ICON "tb_error.ico"
IDI_TASKBAR_NOT_CONNECTED ICON "tb_wait.ico"
IDI_TASKBAR_CONNECTED ICON "tb_run.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_TASKBAR MENU
BEGIN
POPUP "Synergy"
BEGIN
MENUITEM "Show Status", IDC_TASKBAR_STATUS
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
POPUP "Set Log Level"
BEGIN
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
END
MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
MENUITEM "Force Reconnect", IDC_FORCE_RECONNECT
MENUITEM "Reset Server", ID_SYNERGY_RESETSERVER
MENUITEM SEPARATOR
MENUITEM "Quit", IDC_TASKBAR_QUIT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_TASKBAR_STATUS DIALOG 0, 0, 145, 60
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
LISTBOX IDC_TASKBAR_STATUS_CLIENTS,3,17,139,40,NOT LBS_NOTIFY | LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_FAILED "Synergy is about to quit with errors or warnings. Please check the log then click OK."
IDS_INIT_FAILED "Synergy failed to initialize: %{1}"
IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

View File

@@ -1,283 +0,0 @@
QSynergy is free software and published under the following
license:
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View File

@@ -1,45 +0,0 @@
QSynergy for Unix build instructions
====================================
Requirements:
-------------
Qt 4.3 or newer. QSynergy can not be built or used with earlier versions. Get
it from http://trolltech.com/downloads/opensource
If you install from your distributions's package repository, don't forget to
install the development packages as well.
Compilation:
------------
1. Unpack the sources to a directory.
2. Run qmake for your Qt4 installtion in that directory (make sure you do not
accidentally run the Qt3-qmake if your Linux distribution installs both, like
Ubuntu seems to do). See the qmake documentation for available command line
options. You might want to enable a release build by passing CONFIG="-debug
+release" to qmake.
3. qmake will have generated a Makefile now, so just run make in that directory
and wait for the build to finish.
Installation:
-------------
There is no installation required. Just copy the qsynergy binary to somewhere
in your path. The binary does not depend on any other files.
Building a Debian package
-------------------------
The source tarball comes with a fully configured debian subdir, so it's easy to
build a Debian package. A script is available in the dist subdir, deb.sh, that
will do this automatically. Just run this script. If you have all the tools and
helper programs installed to build a Debian package, you should get a package
for your platform in tmp/debian.
Please contact QSynergy's author to contribute your newly built package for
download on the QSynergy website: vl@fidra.de

View File

@@ -1,97 +0,0 @@
QSynergy
========
Version 0.9.0
http://www.volker-lanz.de/en/software/qsynergy/
About QSynergy
--------------
QSynergy is a graphical front end for Synergy. Synergy lets a user control more
than one computer with a single mouse and keyboard (and has lots and lots of
extra features on top of that). Learn more about Synergy itself or get it from:
http://synergy2.sourceforge.net
Synergy only has a GUI for MS Windows. QSynergy was written to step in and fill
this gap for users on Mac and Unix platforms. Of course, QSynergy can also be
used on MS Windows.
Running and using QSynergy
--------------------------
- Because QSynergy is a graphical frontend for Synergy, it does not make much
sense to run it without having Synergy installed. So if you have not done so
already, get it from http://synergy2.sourceforge.net and install it.
- See the Synergy documentation (http://synergy2.sourceforge.net/) for all
topics concerning what you can do with Synergy.
- In QSynergy, first, go to Edit -> Settings and check if the path names for
synergys (the Synergy server binary) and synergyc (the client) are correct.
If they are not, set them by hand or browse to their locations.
- QSynergy knows three modes:
1. Run Synergy as a client (so the computer QSynergy runs on will be
controlled from another computer).
2. Run Synergy as a server with an existing configuration you have written
already (that's just like running Synergy from the command line with the "-c"
option).
3. Interactively and graphically create a server configuration and run
Synergy with this configuration. Herein lies the main benefit of using
QSynergy instead of the command line Synergy version for Unix and Mac.
- Running as a client: Simply tick the "be a client" checkbox, enter the name
of the computer to connect to and push the "Start" button.
- Running as a server with an existing configuration: Tick the "be a server"
checkbox and the radio button that says you would like to use your own
configuration file. Then enter the path to this configuration file (or browse
for it). Finally, push the "Start" button.
- Using QSynergy to configure the Synergy server: Tick the "be a server"
checkbox and the radio button that says you would like to interactively
configure Synergy. Then push the "Configure server" button. After you have
finished setting up your configuration, push the "Start" button. QSynergy
will remember your configuration across restarts, so there is no need to
configure again the next time you run QSynergy -- unless you change your
computer setup, of course.
- On MS Windows and X11, QSynergy will minimize to the tray if you close the
main window or pick the Window -> Minimize menu entry. Double click on the
icon in the tray or right click on this icon and pick Restore to restore the
window.
- On X11, QSynergy will be restarted with X11 if your X11 server correctly
implements session handling. On MS Windows, you will have to add QSynergy to
your Autostart folder. On the Mac, set it to automatically run when the
Finder starts.
Known bugs and limitations
--------------------------
- It is not possible to configure partial links (e.g., only 50% of a screen's
edge linking to another screen)
- If you configure a hotkey for a specific screen and later delete this screen,
QSynergy does not warn you that this will lead to an invalid configuration.
- Importing existing synery server configuration files is not possible.
- There is no true communication channel between Synergy itself and QSynergy.
This means that QSynergy cannot really know if Synergy itself is working or
has encountered any problems. QSynergy only knows "Synergy is running" or
"Synergy has quit with an error".
- Mac OS X only: The look and feel of QSynergy is not quite right for the
platform. This is due to limitations in Qt.
License
-------
QSynergy is written using the Qt Toolkit. It is free software released under
the GPLv2.

View File

@@ -1,87 +0,0 @@
QT += network
TEMPLATE = app
TARGET = qsynergy
DEPENDPATH += . \
res
INCLUDEPATH += . \
src
FORMS += res/MainWindowBase.ui \
res/AboutDialogBase.ui \
res/ServerConfigDialogBase.ui \
res/ScreenSettingsDialogBase.ui \
res/ActionDialogBase.ui \
res/HotkeyDialogBase.ui \
res/SettingsDialogBase.ui \
res/LogDialogBase.ui \
res/WindowsServicesBase.ui
SOURCES += src/main.cpp \
src/MainWindow.cpp \
src/AboutDialog.cpp \
src/ServerConfig.cpp \
src/ServerConfigDialog.cpp \
src/ScreenSetupView.cpp \
src/Screen.cpp \
src/ScreenSetupModel.cpp \
src/NewScreenWidget.cpp \
src/TrashScreenWidget.cpp \
src/ScreenSettingsDialog.cpp \
src/BaseConfig.cpp \
src/HotkeyDialog.cpp \
src/ActionDialog.cpp \
src/Hotkey.cpp \
src/Action.cpp \
src/KeySequence.cpp \
src/KeySequenceWidget.cpp \
src/LogDialog.cpp \
src/SettingsDialog.cpp \
src/AppConfig.cpp \
src/QSynergyApplication.cpp \
src/WindowsServices.cpp
HEADERS += src/MainWindow.h \
src/AboutDialog.h \
src/ServerConfig.h \
src/ServerConfigDialog.h \
src/ScreenSetupView.h \
src/Screen.h \
src/ScreenSetupModel.h \
src/NewScreenWidget.h \
src/TrashScreenWidget.h \
src/ScreenSettingsDialog.h \
src/BaseConfig.h \
src/HotkeyDialog.h \
src/ActionDialog.h \
src/Hotkey.h \
src/Action.h \
src/KeySequence.h \
src/KeySequenceWidget.h \
src/LogDialog.h \
src/SettingsDialog.h \
src/AppConfig.h \
src/QSynergyApplication.h \
src/WindowsServices.h
RESOURCES += res/QSynergy.qrc
RC_FILE = res/win/QSynergy.rc
macx {
QMAKE_INFO_PLIST = res/mac/QSynergy.plist
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
TARGET = QSynergy
QSYNERGY_ICON.files = res/mac/QSynergy.icns
QSYNERGY_ICON.path = Contents/Resources
QMAKE_BUNDLE_DATA += QSYNERGY_ICON
}
debug {
OBJECTS_DIR = tmp/debug
MOC_DIR = tmp/debug
RCC_DIR = tmp/debug
}
release {
OBJECTS_DIR = tmp/release
MOC_DIR = tmp/release
RCC_DIR = tmp/release
}
win32 {
Debug:DESTDIR = ../../bin/Debug
Release:DESTDIR = ../../bin/Release
} else {
DESTDIR = ../../bin
}

View File

@@ -1,202 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialogBase</class>
<widget class="QDialog" name="AboutDialogBase">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<property name="windowTitle">
<string>About Synergy</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600;&quot;&gt;&lt;span style=&quot; font-size:x-large;&quot;&gt;Synergy&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="m_pLabelSynergyVersion">
<property name="text">
<string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Hostname:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="m_pLabelHostname">
<property name="text">
<string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>IP-Address:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="m_pLabelIPAddress">
<property name="text">
<string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>78</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>131</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QPushButton" name="buttonOk">
<property name="text">
<string>&amp;Ok</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>The Synergy GUI is based on QSynergy by Volker Lanz
Copyright © 2008 Volker Lanz (vl@fidra.de)
Copyright © 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonOk</sender>
<signal>clicked()</signal>
<receiver>AboutDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>315</x>
<y>374</y>
</hint>
<hint type="destinationlabel">
<x>301</x>
<y>3</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,581 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ActionDialogBase</class>
<widget class="QDialog" name="ActionDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>484</height>
</rect>
</property>
<property name="windowTitle">
<string>Configure Action</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QGroupBox" name="m_pGroupType">
<property name="title">
<string>Choose the action to perform</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioPress">
<property name="text">
<string>Press a hotkey</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioRelease">
<property name="text">
<string>Release a hotkey</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioPressAndRelease">
<property name="text">
<string>Press and release a hotkey</string>
</property>
</widget>
</item>
<item>
<widget class="KeySequenceWidget" name="m_pKeySequenceWidgetHotkey">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>256</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>dfgsfgsdfgsdfgsd</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="m_pGroupBoxScreens">
<property name="title">
<string>only on these screens</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QListWidget" name="m_pListScreens">
<property name="minimumSize">
<size>
<width>128</width>
<height>64</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioSwitchToScreen">
<property name="text">
<string>Switch to screen</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="m_pComboSwitchToScreen">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioSwitchInDirection">
<property name="text">
<string>Switch in direction</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="m_pComboSwitchInDirection">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>left</string>
</property>
</item>
<item>
<property name="text">
<string>right</string>
</property>
</item>
<item>
<property name="text">
<string>up</string>
</property>
</item>
<item>
<property name="text">
<string>down</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioLockCursorToScreen">
<property name="text">
<string>Lock cursor to screen</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="m_pComboLockCursorToScreen">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>toggle</string>
</property>
</item>
<item>
<property name="text">
<string>on</string>
</property>
</item>
<item>
<property name="text">
<string>off</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>This action is performed when</string>
</property>
<layout class="QHBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioHotkeyPressed">
<property name="text">
<string>the hotkey is pressed</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioHotkeyReleased">
<property name="text">
<string>the hotkey is released</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KeySequenceWidget</class>
<extends>QLineEdit</extends>
<header>KeySequenceWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ActionDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>245</x>
<y>474</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ActionDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>313</x>
<y>474</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pGroupType</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>104</x>
<y>194</y>
</hint>
<hint type="destinationlabel">
<x>110</x>
<y>132</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchInDirection</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>118</x>
<y>322</y>
</hint>
<hint type="destinationlabel">
<x>81</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioLockCursorToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>101</x>
<y>353</y>
</hint>
<hint type="destinationlabel">
<x>68</x>
<y>126</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioPress</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>48</x>
<y>48</y>
</hint>
<hint type="destinationlabel">
<x>45</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioRelease</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>135</x>
<y>70</y>
</hint>
<hint type="destinationlabel">
<x>148</x>
<y>125</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioPressAndRelease</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>194</x>
<y>100</y>
</hint>
<hint type="destinationlabel">
<x>201</x>
<y>125</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pComboSwitchToScreen</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>148</x>
<y>291</y>
</hint>
<hint type="destinationlabel">
<x>350</x>
<y>290</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchInDirection</sender>
<signal>toggled(bool)</signal>
<receiver>m_pComboSwitchInDirection</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>158</x>
<y>322</y>
</hint>
<hint type="destinationlabel">
<x>350</x>
<y>321</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioLockCursorToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pComboLockCursorToScreen</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>180</x>
<y>353</y>
</hint>
<hint type="destinationlabel">
<x>350</x>
<y>352</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioPress</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>25</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>33</x>
<y>155</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>48</x>
<y>278</y>
</hint>
<hint type="destinationlabel">
<x>98</x>
<y>153</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioRelease</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>264</x>
<y>67</y>
</hint>
<hint type="destinationlabel">
<x>241</x>
<y>158</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioPressAndRelease</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>286</x>
<y>98</y>
</hint>
<hint type="destinationlabel">
<x>290</x>
<y>156</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchInDirection</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>38</x>
<y>313</y>
</hint>
<hint type="destinationlabel">
<x>64</x>
<y>195</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioLockCursorToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pGroupBoxScreens</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>48</x>
<y>339</y>
</hint>
<hint type="destinationlabel">
<x>79</x>
<y>234</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioSwitchToScreen</sender>
<signal>toggled(bool)</signal>
<receiver>m_pKeySequenceWidgetHotkey</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>84</x>
<y>280</y>
</hint>
<hint type="destinationlabel">
<x>185</x>
<y>123</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,81 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>HotkeyDialogBase</class>
<widget class="QDialog" name="HotkeyDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>344</width>
<height>86</height>
</rect>
</property>
<property name="windowTitle">
<string>Hotkey</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Enter the specification for the hotkey:</string>
</property>
</widget>
</item>
<item>
<widget class="KeySequenceWidget" name="m_pKeySequenceWidgetHotkey"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KeySequenceWidget</class>
<extends>QLineEdit</extends>
<header>KeySequenceWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>HotkeyDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>HotkeyDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,98 +0,0 @@
<ui version="4.0" >
<class>LogDialogBase</class>
<widget class="QDialog" name="LogDialogBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>761</width>
<height>395</height>
</rect>
</property>
<property name="windowTitle" >
<string>Log Output</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" colspan="3" >
<widget class="QTextEdit" name="m_pLogOutput" >
<property name="font" >
<font>
<family>Courier</family>
</font>
</property>
<property name="undoRedoEnabled" >
<bool>false</bool>
</property>
<property name="lineWrapMode" >
<enum>QTextEdit::NoWrap</enum>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="m_pButtonClearLog" >
<property name="text" >
<string>C&amp;lear</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>441</width>
<height>27</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="pushButton" >
<property name="text" >
<string>&amp;Close</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>m_pButtonClearLog</sender>
<signal>clicked()</signal>
<receiver>m_pLogOutput</receiver>
<slot>clear()</slot>
<hints>
<hint type="sourcelabel" >
<x>27</x>
<y>368</y>
</hint>
<hint type="destinationlabel" >
<x>335</x>
<y>262</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>LogDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>706</x>
<y>370</y>
</hint>
<hint type="destinationlabel" >
<x>525</x>
<y>366</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,348 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindowBase</class>
<widget class="QMainWindow" name="MainWindowBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>445</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>445</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>445</width>
<height>400</height>
</size>
</property>
<property name="windowTitle">
<string>Synergy</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout">
<item row="5" column="3">
<widget class="QPushButton" name="m_pButtonToggleStart">
<property name="text">
<string>&amp;Start</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QGroupBox" name="m_pGroupServer">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>&amp;Server (share this computer's mouse and keyboard):</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QRadioButton" name="m_pRadioExternalConfig">
<property name="text">
<string>Use existing configuration:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="m_pLabelConfigurationFile">
<property name="text">
<string>&amp;Configuration file:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditConfigFile</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_pLineEditConfigFile">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_pButtonBrowseConfigFile">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioInternalConfig">
<property name="text">
<string>Configure interactively:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QPushButton" name="m_pButtonConfigureServer">
<property name="text">
<string>&amp;Configure Server...</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="QGroupBox" name="m_pGroupClient">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>&amp;Client (use another computer's keyboard and mouse):</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="m_pLabelServerName">
<property name="text">
<string>&amp;Name of the server:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditHostname</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_pLineEditHostname"/>
</item>
</layout>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="m_pStatusLabel">
<property name="text">
<string>Ready</string>
</property>
</widget>
</item>
<item row="5" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<action name="m_pActionAbout">
<property name="text">
<string>&amp;About Synergy...</string>
</property>
</action>
<action name="m_pActionQuit">
<property name="text">
<string>&amp;Quit</string>
</property>
<property name="statusTip">
<string>Quit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="m_pActionStartSynergy">
<property name="text">
<string>&amp;Start</string>
</property>
<property name="statusTip">
<string>Run</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="m_pActionStopSynergy">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>S&amp;top</string>
</property>
<property name="statusTip">
<string>Stop</string>
</property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
</action>
<action name="actionShowStatus">
<property name="text">
<string>S&amp;how Status</string>
</property>
<property name="shortcut">
<string>Ctrl+H</string>
</property>
</action>
<action name="m_pActionMinimize">
<property name="text">
<string>&amp;Minimize</string>
</property>
</action>
<action name="m_pActionRestore">
<property name="text">
<string>&amp;Restore</string>
</property>
</action>
<action name="m_pActionSave">
<property name="text">
<string>Save configuration &amp;as...</string>
</property>
<property name="statusTip">
<string>Save the interactively generated server configuration to a file.</string>
</property>
<property name="shortcut">
<string>Ctrl+Alt+S</string>
</property>
</action>
<action name="m_pActionSettings">
<property name="text">
<string>Settings</string>
</property>
<property name="statusTip">
<string>Edit settings</string>
</property>
</action>
<action name="m_pActionLogOutput">
<property name="text">
<string>Log output</string>
</property>
<property name="statusTip">
<string>Open a window with output</string>
</property>
</action>
<action name="m_pActionServices">
<property name="text">
<string>Services</string>
</property>
</action>
</widget>
<resources/>
<connections>
<connection>
<sender>m_pButtonToggleStart</sender>
<signal>clicked()</signal>
<receiver>m_pActionStartSynergy</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel">
<x>361</x>
<y>404</y>
</hint>
<hint type="destinationlabel">
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioExternalConfig</sender>
<signal>toggled(bool)</signal>
<receiver>m_pLineEditConfigFile</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>156</x>
<y>179</y>
</hint>
<hint type="destinationlabel">
<x>169</x>
<y>209</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioExternalConfig</sender>
<signal>toggled(bool)</signal>
<receiver>m_pButtonBrowseConfigFile</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>353</x>
<y>182</y>
</hint>
<hint type="destinationlabel">
<x>356</x>
<y>211</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pRadioInternalConfig</sender>
<signal>toggled(bool)</signal>
<receiver>m_pButtonConfigureServer</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>204</x>
<y>244</y>
</hint>
<hint type="destinationlabel">
<x>212</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,10 +0,0 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/res">
<file>icons/16x16/synergy-connected.png</file>
<file>icons/16x16/synergy-disconnected.png</file>
<file>icons/64x64/video-display.png</file>
<file>icons/64x64/user-trash.png</file>
</qresource>
</RCC>

View File

@@ -1,543 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ScreenSettingsDialogBase</class>
<widget class="QDialog" name="ScreenSettingsDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>434</width>
<height>437</height>
</rect>
</property>
<property name="windowTitle">
<string>Screen Settings</string>
</property>
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Screen &amp;name:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditName</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_pLineEditName"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="m_pGroupAliases">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>A&amp;liases</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="m_pLineEditAlias"/>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="m_pButtonAddAlias">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Add</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QListWidget" name="m_pListAliases">
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="m_pButtonRemoveAlias">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Remove</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>126</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="m_pGroupModifiers">
<property name="title">
<string>&amp;Modifier keys</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&amp;Shift:</string>
</property>
<property name="buddy">
<cstring>m_pComboBoxShift</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_pComboBoxShift">
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Ctrl:</string>
</property>
<property name="buddy">
<cstring>m_pComboBoxCtrl</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="m_pComboBoxCtrl">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Al&amp;t:</string>
</property>
<property name="buddy">
<cstring>m_pComboBoxAlt</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="m_pComboBoxAlt">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>M&amp;eta:</string>
</property>
<property name="buddy">
<cstring>m_pComboBoxMeta</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="m_pComboBoxMeta">
<property name="currentIndex">
<number>3</number>
</property>
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>S&amp;uper:</string>
</property>
<property name="buddy">
<cstring>m_pComboBoxSuper</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="m_pComboBoxSuper">
<property name="currentIndex">
<number>4</number>
</property>
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="m_pGroupSwitchCorners">
<property name="title">
<string>&amp;Dead corners</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="m_pCheckBoxCornerTopLeft">
<property name="text">
<string>Top-left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="m_pCheckBoxCornerTopRight">
<property name="text">
<string>Top-right</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_pCheckBoxCornerBottomLeft">
<property name="text">
<string>Bottom-left</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="m_pCheckBoxCornerBottomRight">
<property name="text">
<string>Bottom-right</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Corner Si&amp;ze:</string>
</property>
<property name="buddy">
<cstring>m_pSpinBoxSwitchCornerSize</cstring>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="m_pSpinBoxSwitchCornerSize"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="m_pGroupFixes">
<property name="title">
<string>&amp;Fixes</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="m_pCheckBoxCapsLock">
<property name="text">
<string>Fix CAPS LOCK key</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_pCheckBoxNumLock">
<property name="text">
<string>Fix NUM LOCK key</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScrollLock">
<property name="text">
<string>Fix SCROLL LOCK key</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="m_pCheckBoxXTest">
<property name="text">
<string>Fix XTest for Xinerama</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="m_pButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>m_pButtonBox</sender>
<signal>accepted()</signal>
<receiver>ScreenSettingsDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>222</x>
<y>502</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pButtonBox</sender>
<signal>rejected()</signal>
<receiver>ScreenSettingsDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>290</x>
<y>508</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,756 +0,0 @@
<ui version="4.0" >
<class>ServerConfigDialogBase</class>
<widget class="QDialog" name="ServerConfigDialogBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>740</width>
<height>514</height>
</rect>
</property>
<property name="windowTitle" >
<string>Server Configuration</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QTabWidget" name="m_pTabWidget" >
<property name="currentIndex" >
<number>0</number>
</property>
<widget class="QWidget" name="m_pTabScreens" >
<attribute name="title" >
<string>Screens and links</string>
</attribute>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="TrashScreenWidget" name="m_pTrashScreenWidget" >
<property name="acceptDrops" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string>Drag a screen from the grid to the trashcan to remove it.</string>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap resource="QSynergy.qrc" >:/res/icons/64x64/user-trash.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Configure the layout of your synergy server configuration.</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="NewScreenWidget" name="m_pLabelNewScreenWidget" >
<property name="toolTip" >
<string>Drag this button to the grid to add a new screen.</string>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap resource="QSynergy.qrc" >:/res/icons/64x64/video-display.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="ScreenSetupView" name="m_pScreenSetupView" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>273</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>273</height>
</size>
</property>
<property name="acceptDrops" >
<bool>true</bool>
</property>
<property name="autoFillBackground" >
<bool>false</bool>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Drag new screens to the grid or move existing ones around.
Drag a screen to the trashcan to delete it.
Double click on a screen to edit its settings.</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_pTabHotkeys" >
<attribute name="title" >
<string>Hotkeys</string>
</attribute>
<layout class="QHBoxLayout" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>&amp;Hotkeys</string>
</property>
<layout class="QGridLayout" >
<item rowspan="4" row="0" column="0" >
<widget class="QListWidget" name="m_pListHotkeys" />
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="m_pButtonNewHotkey" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>&amp;New</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QPushButton" name="m_pButtonEditHotkey" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>&amp;Edit</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="m_pButtonRemoveHotkey" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>&amp;Remove</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>75</width>
<height>161</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>A&amp;ctions</string>
</property>
<layout class="QGridLayout" >
<item rowspan="4" row="0" column="0" >
<widget class="QListWidget" name="m_pListActions" />
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="m_pButtonNewAction" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Ne&amp;w</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QPushButton" name="m_pButtonEditAction" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>E&amp;dit</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="m_pButtonRemoveAction" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Re&amp;move</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_pTabAdvanced" >
<attribute name="title" >
<string>Advanced server settings</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QGroupBox" name="m_pGroupSwitch" >
<property name="title" >
<string>&amp;Switch</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QCheckBox" name="m_pCheckBoxSwitchDelay" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Switch &amp;after waiting</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="m_pSpinBoxSwitchDelay" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimum" >
<number>10</number>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="singleStep" >
<number>10</number>
</property>
<property name="value" >
<number>250</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pLabel_14" >
<property name="text" >
<string>ms</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QCheckBox" name="m_pCheckBoxSwitchDoubleTap" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Switch on double &amp;tap within</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="m_pSpinBoxSwitchDoubleTap" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimum" >
<number>10</number>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="singleStep" >
<number>10</number>
</property>
<property name="value" >
<number>250</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pLabel_15" >
<property name="text" >
<string>ms</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" >
<widget class="QGroupBox" name="m_pGroupOptions" >
<property name="title" >
<string>&amp;Options</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QCheckBox" name="m_pCheckBoxHeartbeat" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>&amp;Check clients every</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="m_pSpinBoxHeartbeat" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimum" >
<number>1000</number>
</property>
<property name="maximum" >
<number>30000</number>
</property>
<property name="singleStep" >
<number>1000</number>
</property>
<property name="value" >
<number>5000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pLabel_16" >
<property name="text" >
<string>ms</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="m_pCheckBoxRelativeMouseMoves" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Use &amp;relative mouse moves</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>S&amp;ynchronize screen savers</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Don't take &amp;foreground window on Windows servers</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QGroupBox" name="m_pGroupSwitchCorners" >
<property name="title" >
<string>&amp;Dead corners</string>
</property>
<property name="checked" >
<bool>false</bool>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" colspan="2" >
<widget class="QCheckBox" name="m_pCheckBoxCornerTopLeft" >
<property name="text" >
<string>To&amp;p-left</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2" >
<widget class="QCheckBox" name="m_pCheckBoxCornerTopRight" >
<property name="text" >
<string>Top-rig&amp;ht</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QCheckBox" name="m_pCheckBoxCornerBottomLeft" >
<property name="text" >
<string>&amp;Bottom-left</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2" >
<widget class="QCheckBox" name="m_pCheckBoxCornerBottomRight" >
<property name="text" >
<string>Bottom-ri&amp;ght</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Cor&amp;ner Size:</string>
</property>
<property name="buddy" >
<cstring>m_pSpinBoxSwitchCornerSize</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="m_pSpinBoxSwitchCornerSize" />
</item>
</layout>
</item>
<item row="2" column="3" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="m_pButtonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ScreenSetupView</class>
<extends>QTableView</extends>
<header>ScreenSetupView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>NewScreenWidget</class>
<extends>QLabel</extends>
<header>NewScreenWidget.h</header>
</customwidget>
<customwidget>
<class>TrashScreenWidget</class>
<extends>QLabel</extends>
<header>TrashScreenWidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="QSynergy.qrc" />
</resources>
<connections>
<connection>
<sender>m_pButtonBox</sender>
<signal>accepted()</signal>
<receiver>ServerConfigDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>572</x>
<y>424</y>
</hint>
<hint type="destinationlabel" >
<x>377</x>
<y>-8</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pButtonBox</sender>
<signal>rejected()</signal>
<receiver>ServerConfigDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>641</x>
<y>424</y>
</hint>
<hint type="destinationlabel" >
<x>595</x>
<y>1</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pCheckBoxSwitchDelay</sender>
<signal>toggled(bool)</signal>
<receiver>m_pSpinBoxSwitchDelay</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>63</y>
</hint>
<hint type="destinationlabel" >
<x>110</x>
<y>63</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pCheckBoxSwitchDoubleTap</sender>
<signal>toggled(bool)</signal>
<receiver>m_pSpinBoxSwitchDoubleTap</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>63</y>
</hint>
<hint type="destinationlabel" >
<x>110</x>
<y>63</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pCheckBoxHeartbeat</sender>
<signal>toggled(bool)</signal>
<receiver>m_pSpinBoxHeartbeat</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>63</y>
</hint>
<hint type="destinationlabel" >
<x>110</x>
<y>63</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pListHotkeys</sender>
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
<receiver>m_pButtonEditHotkey</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel" >
<x>197</x>
<y>115</y>
</hint>
<hint type="destinationlabel" >
<x>304</x>
<y>115</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_pListActions</sender>
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
<receiver>m_pButtonEditAction</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel" >
<x>505</x>
<y>120</y>
</hint>
<hint type="destinationlabel" >
<x>677</x>
<y>118</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,330 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialogBase</class>
<widget class="QDialog" name="SettingsDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>412</height>
</rect>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
<layout class="QGridLayout">
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="m_pGroupAdvanced">
<property name="title">
<string>&amp;Advanced</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="m_pLabel_19">
<property name="text">
<string>Sc&amp;reen name:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditScreenName</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_pLineEditScreenName">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="m_pLabel_20">
<property name="text">
<string>P&amp;ort:</string>
</property>
<property name="buddy">
<cstring>m_pSpinBoxPort</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="m_pSpinBoxPort">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>24800</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="m_pLabel_21">
<property name="text">
<string>&amp;Interface:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditInterface</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_pLineEditInterface">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="m_pGroupStart">
<property name="title">
<string>&amp;Start</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="m_pCheckBoxAutoConnect">
<property name="text">
<string>A&amp;utomatically start server or client when GUI starts</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="m_pGroupPrograms">
<property name="title">
<string>&amp;Programs</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" rowspan="2" colspan="3">
<layout class="QVBoxLayout" name="m_pVerticalLayout_2">
<item>
<widget class="QCheckBox" name="m_pCheckBoxAutoDetectPaths">
<property name="text">
<string>Auto detect program paths</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="m_pLabel_17">
<property name="whatsThis">
<string>This is the synergy client program, usually called synergyc or synergyc.exe.</string>
</property>
<property name="text">
<string>&amp;Client:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditSynergyc</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="m_pLineEditSynergyc">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="m_pButtonBrowseSynergyc">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="m_pLabel_18">
<property name="toolTip">
<string/>
</property>
<property name="whatsThis">
<string>This is the synergy server program, usually called synergys or synergys.exe.</string>
</property>
<property name="text">
<string>S&amp;erver:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditSynergys</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="m_pLineEditSynergys">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="m_pButtonBrowseSynergys">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="m_pGroupLog">
<property name="title">
<string>Logging</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="m_pLabel_3">
<property name="text">
<string>&amp;Logging level:</string>
</property>
<property name="buddy">
<cstring>m_pComboLogLevel</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_pCheckBoxLogToFile">
<property name="text">
<string>Log to file:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_pLineEditLogFilename">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="m_pButtonBrowseLog">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_pComboLogLevel">
<item>
<property name="text">
<string>Error</string>
</property>
</item>
<item>
<property name="text">
<string>Warning</string>
</property>
</item>
<item>
<property name="text">
<string>Note</string>
</property>
</item>
<item>
<property name="text">
<string>Info</string>
</property>
</item>
<item>
<property name="text">
<string>Debug</string>
</property>
</item>
<item>
<property name="text">
<string>Debug1</string>
</property>
</item>
<item>
<property name="text">
<string>Debug2</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>m_pCheckBoxAutoDetectPaths</tabstop>
<tabstop>m_pLineEditSynergyc</tabstop>
<tabstop>m_pButtonBrowseSynergyc</tabstop>
<tabstop>m_pLineEditSynergys</tabstop>
<tabstop>m_pButtonBrowseSynergys</tabstop>
<tabstop>m_pLineEditScreenName</tabstop>
<tabstop>m_pSpinBoxPort</tabstop>
<tabstop>m_pLineEditInterface</tabstop>
<tabstop>m_pCheckBoxAutoConnect</tabstop>
<tabstop>m_pComboLogLevel</tabstop>
<tabstop>m_pCheckBoxLogToFile</tabstop>
<tabstop>m_pLineEditLogFilename</tabstop>
<tabstop>m_pButtonBrowseLog</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>266</x>
<y>340</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>334</x>
<y>340</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,161 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WindowsServicesBase</class>
<widget class="QDialog" name="WindowsServicesBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<height>200</height>
</rect>
</property>
<property name="windowTitle">
<string>Windows Services</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Server</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="m_pUninstallServer">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Uninstall</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="m_pInstallServer">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Install</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Client</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="m_pUninstallClient">
<property name="text">
<string>Uninstall</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="m_pInstallClient">
<property name="text">
<string>Install</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>To start and stop a service, use the Windows services snap-in.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>WindowsServicesBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>WindowsServicesBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleIconFile</key>
<string>QSynergy.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>0.9.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>QSynergy</string>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

View File

@@ -1 +0,0 @@
IDI_ICON1 ICON DISCARDABLE "res\\win\\QSynergy.ico"

View File

@@ -1,65 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "AboutDialog.h"
#include <QtCore>
#include <QtGui>
#include <QtNetwork>
static QString getSynergyVersion(const QString& app)
{
#if !defined(Q_OS_WIN)
QProcess process;
process.start(app, QStringList() << "--version");
process.setReadChannel(QProcess::StandardError);
if (!process.waitForStarted() || !process.waitForFinished())
return QObject::tr("(unknown)");
QRegExp rx("synergy[cs] ([\\d\\.]+)");
if (rx.indexIn(QString(process.readLine())) != -1)
return rx.cap(1);
#else
Q_UNUSED(app);
#endif
return QObject::tr("(unknown)");
}
static QString getIPAddress()
{
QList<QHostAddress> addresses = QNetworkInterface::allAddresses();
for (int i = 0; i < addresses.size(); i++)
if (addresses[i].protocol() == QAbstractSocket::IPv4Protocol && addresses[i] != QHostAddress(QHostAddress::LocalHost))
return addresses[i].toString();
return QObject::tr("(unknown)");
}
AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::AboutDialogBase()
{
setupUi(this);
m_pLabelSynergyVersion->setText(getSynergyVersion(synergyApp));
m_pLabelHostname->setText(QHostInfo::localHostName());
m_pLabelIPAddress->setText(getIPAddress());
}

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(ABOUTDIALOG__H)
#define ABOUTDIALOG__H
#include <QDialog>
#include "ui_AboutDialogBase.h"
class QWidget;
class QString;
class AboutDialog : public QDialog, public Ui::AboutDialogBase
{
Q_OBJECT
public:
AboutDialog(QWidget* parent, const QString& synergyApp = QString());
};
#endif

View File

@@ -1,149 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "Action.h"
#include <QSettings>
#include <QTextStream>
const char* Action::m_ActionTypeNames[] =
{
"keyDown", "keyUp", "keystroke",
"switchToScreen", "switchInDirection", "lockCursorToScreen",
"mouseDown", "mouseUp", "mousebutton"
};
const char* Action::m_SwitchDirectionNames[] = { "left", "right", "up", "down" };
const char* Action::m_LockCursorModeNames[] = { "toggle", "on", "off" };
Action::Action() :
m_KeySequence(),
m_Type(keystroke),
m_TypeScreenNames(),
m_SwitchScreenName(),
m_SwitchDirection(switchLeft),
m_LockCursorMode(lockCursorToggle),
m_ActiveOnRelease(false),
m_HasScreens(false)
{
}
QString Action::text() const
{
QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ? type() + 6 : type() ]) + "(";
switch (type())
{
case keyDown:
case keyUp:
case keystroke:
{
text += keySequence().toString();
if (!keySequence().isMouseButton())
{
const QStringList& screens = typeScreenNames();
if (haveScreens() && !screens.isEmpty())
{
text += ",";
for (int i = 0; i < screens.size(); i++)
{
text += screens[i];
if (i != screens.size() - 1)
text += ":";
}
}
else
text += ",*";
}
}
break;
case switchToScreen:
text += switchScreenName();
break;
case switchInDirection:
text += m_SwitchDirectionNames[m_SwitchDirection];
break;
case lockCursorToScreen:
text += m_LockCursorModeNames[m_LockCursorMode];
break;
default:
Q_ASSERT(0);
break;
}
text += ")";
return text;
}
void Action::loadSettings(QSettings& settings)
{
keySequence().loadSettings(settings);
setType(settings.value("type", keyDown).toInt());
typeScreenNames().clear();
int numTypeScreens = settings.beginReadArray("typeScreenNames");
for (int i = 0; i < numTypeScreens; i++)
{
settings.setArrayIndex(i);
typeScreenNames().append(settings.value("typeScreenName").toString());
}
settings.endArray();
setSwitchScreenName(settings.value("switchScreenName").toString());
setSwitchDirection(settings.value("switchInDirection", switchLeft).toInt());
setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt());
setActiveOnRelease(settings.value("activeOnRelease", false).toBool());
setHaveScreens(settings.value("hasScreens", false).toBool());
}
void Action::saveSettings(QSettings& settings) const
{
keySequence().saveSettings(settings);
settings.setValue("type", type());
settings.beginWriteArray("typeScreenNames");
for (int i = 0; i < typeScreenNames().size(); i++)
{
settings.setArrayIndex(i);
settings.setValue("typeScreenName", typeScreenNames()[i]);
}
settings.endArray();
settings.setValue("switchScreenName", switchScreenName());
settings.setValue("switchInDirection", switchDirection());
settings.setValue("lockCursorToScreen", lockCursorMode());
settings.setValue("activeOnRelease", activeOnRelease());
settings.setValue("hasScreens", haveScreens());
}
QTextStream& operator<<(QTextStream& outStream, const Action& action)
{
if (action.activeOnRelease())
outStream << ";";
outStream << action.text();
return outStream;
}

View File

@@ -1,88 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(ACTION_H)
#define ACTION_H
#include "KeySequence.h"
#include <QString>
#include <QStringList>
#include <QList>
class ActionDialog;
class QSettings;
class QTextStream;
class Action
{
friend class ActionDialog;
friend QTextStream& operator<<(QTextStream& outStream, const Action& action);
public:
enum ActionType { keyDown, keyUp, keystroke, switchToScreen, switchInDirection, lockCursorToScreen, mouseDown, mouseUp, mousebutton };
enum SwitchDirection { switchLeft, switchRight, switchUp, switchDown };
enum LockCursorMode { lockCursorToggle, lockCursonOn, lockCursorOff };
public:
Action();
public:
QString text() const;
const KeySequence& keySequence() const { return m_KeySequence; }
void loadSettings(QSettings& settings);
void saveSettings(QSettings& settings) const;
int type() const { return m_Type; }
const QStringList& typeScreenNames() const { return m_TypeScreenNames; }
const QString& switchScreenName() const { return m_SwitchScreenName; }
int switchDirection() const { return m_SwitchDirection; }
int lockCursorMode() const { return m_LockCursorMode; }
bool activeOnRelease() const { return m_ActiveOnRelease; }
bool haveScreens() const { return m_HasScreens; }
protected:
KeySequence& keySequence() { return m_KeySequence; }
void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }
void setType(int t) { m_Type = t; }
QStringList& typeScreenNames() { return m_TypeScreenNames; }
void setSwitchScreenName(const QString& n) { m_SwitchScreenName = n; }
void setSwitchDirection(int d) { m_SwitchDirection = d; }
void setLockCursorMode(int m) { m_LockCursorMode = m; }
void setActiveOnRelease(bool b) { m_ActiveOnRelease = b; }
void setHaveScreens(bool b) { m_HasScreens = b; }
private:
KeySequence m_KeySequence;
int m_Type;
QStringList m_TypeScreenNames;
QString m_SwitchScreenName;
int m_SwitchDirection;
int m_LockCursorMode;
bool m_ActiveOnRelease;
bool m_HasScreens;
static const char* m_ActionTypeNames[];
static const char* m_SwitchDirectionNames[];
static const char* m_LockCursorModeNames[];
};
typedef QList<Action> ActionList;
QTextStream& operator<<(QTextStream& outStream, const Action& action);
#endif

View File

@@ -1,108 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ActionDialog.h"
#include "Hotkey.h"
#include "Action.h"
#include "ServerConfig.h"
#include "KeySequence.h"
#include <QtCore>
#include <QtGui>
ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::ActionDialogBase(),
m_ServerConfig(config),
m_Hotkey(hotkey),
m_Action(action),
m_pButtonGroupType(new QButtonGroup(this))
{
setupUi(this);
// work around Qt Designer's lack of a QButtonGroup; we need it to get
// at the button id of the checked radio button
QRadioButton* const typeButtons[] = { m_pRadioPress, m_pRadioRelease, m_pRadioPressAndRelease, m_pRadioSwitchToScreen, m_pRadioSwitchInDirection, m_pRadioLockCursorToScreen };
for (unsigned int i = 0; i < sizeof(typeButtons) / sizeof(typeButtons[0]); i++)
m_pButtonGroupType->addButton(typeButtons[i], i);
m_pKeySequenceWidgetHotkey->setText(m_Action.keySequence().toString());
m_pKeySequenceWidgetHotkey->setKeySequence(m_Action.keySequence());
m_pButtonGroupType->button(m_Action.type())->setChecked(true);
m_pComboSwitchInDirection->setCurrentIndex(m_Action.switchDirection());
m_pComboLockCursorToScreen->setCurrentIndex(m_Action.lockCursorMode());
if (m_Action.activeOnRelease())
m_pRadioHotkeyReleased->setChecked(true);
else
m_pRadioHotkeyPressed->setChecked(true);
m_pGroupBoxScreens->setChecked(m_Action.haveScreens());
int idx = 0;
foreach(const Screen& screen, serverConfig().screens())
if (!screen.isNull())
{
QListWidgetItem *pListItem = new QListWidgetItem(screen.name());
m_pListScreens->addItem(pListItem);
if (m_Action.typeScreenNames().indexOf(screen.name()) != -1)
m_pListScreens->setCurrentItem(pListItem);
m_pComboSwitchToScreen->addItem(screen.name());
if (screen.name() == m_Action.switchScreenName())
m_pComboSwitchToScreen->setCurrentIndex(idx);
idx++;
}
}
void ActionDialog::accept()
{
if (!sequenceWidget()->valid() && m_pButtonGroupType->checkedId() >= 0 && m_pButtonGroupType->checkedId() < 3)
return;
m_Action.setKeySequence(sequenceWidget()->keySequence());
m_Action.setType(m_pButtonGroupType->checkedId());
m_Action.setHaveScreens(m_pGroupBoxScreens->isChecked());
m_Action.typeScreenNames().clear();
foreach(const QListWidgetItem* pItem, m_pListScreens->selectedItems())
m_Action.typeScreenNames().append(pItem->text());
m_Action.setSwitchScreenName(m_pComboSwitchToScreen->currentText());
m_Action.setSwitchDirection(m_pComboSwitchInDirection->currentIndex());
m_Action.setLockCursorMode(m_pComboLockCursorToScreen->currentIndex());
m_Action.setActiveOnRelease(m_pRadioHotkeyReleased->isChecked());
QDialog::accept();
}
void ActionDialog::on_m_pKeySequenceWidgetHotkey_keySequenceChanged()
{
if (sequenceWidget()->keySequence().isMouseButton())
{
m_pGroupBoxScreens->setEnabled(false);
m_pListScreens->setEnabled(false);
}
else
{
m_pGroupBoxScreens->setEnabled(true);
m_pListScreens->setEnabled(true);
}
}

View File

@@ -1,55 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(ACTIONDIALOG_H)
#define ACTIONDIALOG_H
#include <QDialog>
#include "ui_ActionDialogBase.h"
class Hotkey;
class Action;
class QRadioButton;
class QButtonGroup;
class ServerConfig;
class ActionDialog : public QDialog, public Ui::ActionDialogBase
{
Q_OBJECT
public:
ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action);
protected slots:
void accept();
void on_m_pKeySequenceWidgetHotkey_keySequenceChanged();
protected:
const KeySequenceWidget* sequenceWidget() const { return m_pKeySequenceWidgetHotkey; }
const ServerConfig& serverConfig() const { return m_ServerConfig; }
private:
const ServerConfig& m_ServerConfig;
Hotkey& m_Hotkey;
Action& m_Action;
QButtonGroup* m_pButtonGroupType;
};
#endif

View File

@@ -1,141 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "AppConfig.h"
#include <QtCore>
#include <QtNetwork>
#if defined(Q_OS_WIN)
const char AppConfig::m_SynergysName[] = "synergys.exe";
const char AppConfig::m_SynergycName[] = "synergyc.exe";
const char AppConfig::m_SynergyProgramDir[] = "bin/";
const char AppConfig::m_SynergyLogDir[] = "log/";
#else
const char AppConfig::m_SynergysName[] = "synergys";
const char AppConfig::m_SynergycName[] = "synergyc";
const char AppConfig::m_SynergyProgramDir[] = "/usr/bin/";
const char AppConfig::m_SynergyLogDir[] = "/var/log/";
#endif
static const char* logLevelNames[] =
{
"ERROR",
"WARNING",
"NOTE",
"INFO",
"DEBUG",
"DEBUG1",
"DEBUG2"
};
AppConfig::AppConfig(QSettings* settings) :
m_pSettings(settings),
m_AutoConnect(false),
m_Synergyc(),
m_Synergys(),
m_ScreenName(),
m_Port(24800),
m_Interface(),
m_LogLevel(0)
{
Q_ASSERT(m_pSettings);
loadSettings();
}
AppConfig::~AppConfig()
{
saveSettings();
}
QString AppConfig::synergyLogDir()
{
#if defined(Q_OS_WIN)
// on windows, we want to log to program files
return QString(QDir::currentPath() + "/log/");
#else
// on unix, we'll log to the standard log dir
return "/var/log/";
#endif
}
void AppConfig::persistLogDir()
{
QDir dir = synergyLogDir();
// persist the log directory
if (!dir.exists())
{
dir.mkpath(dir.path());
}
}
QString AppConfig::logLevelText() const
{
return logLevelNames[logLevel()];
}
void AppConfig::loadSettings()
{
m_AutoConnect = settings().value("autoConnectChecked", false).toBool();
m_Synergyc = settings().value("synergyc", QString(synergyProgramDir()) + synergycName()).toString();
m_Synergys = settings().value("synergys", QString(synergyProgramDir()) + synergysName()).toString();
m_ScreenName = settings().value("screenName", QHostInfo::localHostName()).toString();
m_Port = settings().value("port", 24800).toInt();
m_Interface = settings().value("interface").toString();
m_LogLevel = settings().value("logLevel", 2).toInt();
m_AutoDetectPaths = settings().value("autoDetectPaths", true).toBool();
m_LogToFile = settings().value("logToFile", false).toBool();
m_LogFilename = settings().value("logFilename", synergyLogDir() + "synergy.log").toString();
}
void AppConfig::saveSettings()
{
settings().setValue("autoConnectChecked", m_AutoConnect);
settings().setValue("synergyc", m_Synergyc);
settings().setValue("synergys", m_Synergys);
settings().setValue("screenName", m_ScreenName);
settings().setValue("port", m_Port);
settings().setValue("interface", m_Interface);
settings().setValue("logLevel", m_LogLevel);
settings().setValue("autoDetectPaths", m_AutoDetectPaths);
settings().setValue("logToFile", m_LogToFile);
settings().setValue("logFilename", m_LogFilename);
}
bool AppConfig::detectPath(const QString& name, QString& path)
{
// look in current working dir and default dir
QStringList searchDirs;
searchDirs.append("./");
searchDirs.append(synergyProgramDir());
// use the first valid path we find
for (int i = 0; i < searchDirs.length(); i++)
{
QFile f(searchDirs[i] + name);
if (f.exists())
{
path = f.fileName();
return true;
}
}
// nothing found!
return false;
}

View File

@@ -1,92 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(APPCONFIG_H)
#define APPCONFIG_H
#include <QString>
class QSettings;
class SettingsDialog;
class AppConfig
{
friend class SettingsDialog;
friend class MainWindow;
public:
AppConfig(QSettings* settings);
~AppConfig();
public:
bool autoConnect() const { return m_AutoConnect; }
const QString& synergyc() const { return m_Synergyc; }
const QString& synergys() const { return m_Synergys; }
const QString& screenName() const { return m_ScreenName; }
int port() const { return m_Port; }
const QString& interface() const { return m_Interface; }
int logLevel() const { return m_LogLevel; }
bool autoDetectPaths() const { return m_AutoDetectPaths; }
bool logToFile() const { return m_LogToFile; }
const QString& logFilename() const { return m_LogFilename; }
QString logLevelText() const;
QString synergysName() const { return m_SynergysName; }
QString synergycName() const { return m_SynergycName; }
QString synergyProgramDir() const { return m_SynergyProgramDir; }
QString synergyLogDir();
bool detectPath(const QString& name, QString& path);
void persistLogDir();
protected:
QSettings& settings() { return *m_pSettings; }
void setAutoConnect(bool b) { m_AutoConnect = b; }
void setSynergyc(const QString& s) { m_Synergyc = s; }
void setSynergys(const QString& s) { m_Synergys = s; }
void setScreenName(const QString& s) { m_ScreenName = s; }
void setPort(int i) { m_Port = i; }
void setInterface(const QString& s) { m_Interface = s; }
void setLogLevel(int i) { m_LogLevel = i; }
void setAutoDetectPaths(bool b) { m_AutoDetectPaths = b; }
void setLogToFile(bool b) { m_LogToFile = b; }
void setLogFilename(const QString& s) { m_LogFilename = s; }
void loadSettings();
void saveSettings();
private:
QSettings* m_pSettings;
bool m_AutoConnect;
QString m_Synergyc;
QString m_Synergys;
QString m_ScreenName;
int m_Port;
QString m_Interface;
int m_LogLevel;
bool m_AutoDetectPaths;
bool m_LogToFile;
QString m_LogFilename;
static const char m_SynergysName[];
static const char m_SynergycName[];
static const char m_SynergyProgramDir[];
static const char m_SynergyLogDir[];
};
#endif

View File

@@ -1,45 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "BaseConfig.h"
const char* BaseConfig::m_ModifierNames[] =
{
"shift",
"ctrl",
"alt",
"meta",
"super",
"none"
};
const char* BaseConfig::m_FixNames[] =
{
"halfDuplexCapsLock",
"halfDuplexNumLock",
"halfDuplexScrollLock",
"xtestIsXineramaUnaware"
};
const char* BaseConfig::m_SwitchCornerNames[] =
{
"top-left",
"top-right",
"bottom-left",
"bottom-right"
};

View File

@@ -1,90 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(BASECONFIG_H)
#define BASECONFIG_H
#include <QSettings>
#include <QString>
#include <QVariant>
class BaseConfig
{
public:
enum Modifier { DefaultMod = -1, Shift, Ctrl, Alt, Meta, Super, None, NumModifiers };
enum SwitchCorner { TopLeft, TopRight, BottomLeft, BottomRight, NumSwitchCorners };
enum Fix { CapsLock, NumLock, ScrollLock, XTest, NumFixes };
protected:
BaseConfig() {}
virtual ~BaseConfig() {}
protected:
template<typename T1, typename T2>
void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt)
{
int entries = settings.beginReadArray(arrayName + "Array");
array.clear();
for (int i = 0; i < entries; i++)
{
settings.setArrayIndex(i);
QVariant v = settings.value(arrayName, deflt);
array.append(v.value<T2>());
}
settings.endArray();
}
template<typename T1, typename T2>
void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt, int entries)
{
Q_ASSERT(array.size() >= entries);
settings.beginReadArray(arrayName + "Array");
for (int i = 0; i < entries; i++)
{
settings.setArrayIndex(i);
QVariant v = settings.value(arrayName, deflt);
array[i] = v.value<T2>();
}
settings.endArray();
}
template<typename T>
void writeSettings(QSettings& settings, const T& array, const QString& arrayName) const
{
settings.beginWriteArray(arrayName + "Array");
for (int i = 0; i < array.size(); i++)
{
settings.setArrayIndex(i);
settings.setValue(arrayName, array[i]);
}
settings.endArray();
}
public:
static const char* modifierName(int idx) { return m_ModifierNames[idx]; }
static const char* fixName(int idx) { return m_FixNames[idx]; }
static const char* switchCornerName(int idx) { return m_SwitchCornerNames[idx]; }
private:
static const char* m_ModifierNames[];
static const char* m_FixNames[];
static const char* m_SwitchCornerNames[];
};
#endif

View File

@@ -1,74 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "Hotkey.h"
#include <QSettings>
Hotkey::Hotkey() :
m_KeySequence(),
m_Actions()
{
}
QString Hotkey::text() const
{
QString text = keySequence().toString();
if (keySequence().isMouseButton())
return "mousebutton(" + text + ")";
return "keystroke(" + text + ")";
}
void Hotkey::loadSettings(QSettings& settings)
{
keySequence().loadSettings(settings);
actions().clear();
int num = settings.beginReadArray("actions");
for (int i = 0; i < num; i++)
{
settings.setArrayIndex(i);
Action a;
a.loadSettings(settings);
actions().append(a);
}
settings.endArray();
}
void Hotkey::saveSettings(QSettings& settings) const
{
keySequence().saveSettings(settings);
settings.beginWriteArray("actions");
for (int i = 0; i < actions().size(); i++)
{
settings.setArrayIndex(i);
actions()[i].saveSettings(settings);
}
settings.endArray();
}
QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey)
{
for (int i = 0; i < hotkey.actions().size(); i++)
outStream << "\t" << hotkey.text() << " = " << hotkey.actions()[i] << endl;
return outStream;
}

View File

@@ -1,65 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(HOTKEY_H)
#define HOTKEY_H
#include <QString>
#include <QList>
#include <QTextStream>
#include "Action.h"
#include "KeySequence.h"
class HotkeyDialog;
class ServerConfigDialog;
class QSettings;
class Hotkey
{
friend class HotkeyDialog;
friend class ServerConfigDialog;
friend QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey);
public:
Hotkey();
public:
QString text() const;
const KeySequence& keySequence() const { return m_KeySequence; }
const ActionList& actions() const { return m_Actions; }
void loadSettings(QSettings& settings);
void saveSettings(QSettings& settings) const;
protected:
KeySequence& keySequence() { return m_KeySequence; }
void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }
ActionList& actions() { return m_Actions; }
private:
KeySequence m_KeySequence;
ActionList m_Actions;
};
typedef QList<Hotkey> HotkeyList;
QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey);
#endif

View File

@@ -1,40 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "HotkeyDialog.h"
#include <QtCore>
#include <QtGui>
HotkeyDialog::HotkeyDialog (QWidget* parent, Hotkey& hotkey) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::HotkeyDialogBase(),
m_Hotkey(hotkey)
{
setupUi(this);
m_pKeySequenceWidgetHotkey->setText(m_Hotkey.text());
}
void HotkeyDialog::accept()
{
if (!sequenceWidget()->valid())
return;
hotkey().setKeySequence(sequenceWidget()->keySequence());
QDialog::accept();
}

View File

@@ -1,48 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(HOTKEYDIALOG_H)
#define HOTKEYDIALOG_H
#include "ui_HotkeyDialogBase.h"
#include "Hotkey.h"
#include <QDialog>
class HotkeyDialog : public QDialog, public Ui::HotkeyDialogBase
{
Q_OBJECT
public:
HotkeyDialog(QWidget* parent, Hotkey& hotkey);
public:
const Hotkey& hotkey() const { return m_Hotkey; }
protected slots:
void accept();
protected:
const KeySequenceWidget* sequenceWidget() const { return m_pKeySequenceWidgetHotkey; }
Hotkey& hotkey() { return m_Hotkey; }
private:
Hotkey& m_Hotkey;
};
#endif

View File

@@ -1,236 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "KeySequence.h"
#include <QtCore>
#include <QtGui>
// this table originally comes from Qt sources (gui/kernel/qkeysequence.cpp)
// and is heavily modified for QSynergy
static const struct
{
int key;
const char* name;
} keyname[] =
{
{ Qt::Key_Space, "Space" },
{ Qt::Key_Escape, "Escape" },
{ Qt::Key_Tab, "Tab" },
{ Qt::Key_Backtab, "LeftTab" },
{ Qt::Key_Backspace, "BackSpace" },
{ Qt::Key_Return, "Return" },
{ Qt::Key_Insert, "Insert" },
{ Qt::Key_Delete, "Delete" },
{ Qt::Key_Pause, "Pause" },
{ Qt::Key_Print, "Print" },
{ Qt::Key_SysReq, "SysReq" },
{ Qt::Key_Home, "Home" },
{ Qt::Key_End, "End" },
{ Qt::Key_Left, "Left" },
{ Qt::Key_Up, "Up" },
{ Qt::Key_Right, "Right" },
{ Qt::Key_Down, "Down" },
{ Qt::Key_PageUp, "PageUp" },
{ Qt::Key_PageDown, "PageDown" },
{ Qt::Key_CapsLock, "CapsLock" },
{ Qt::Key_NumLock, "NumLock" },
{ Qt::Key_ScrollLock, "ScrollLock" },
{ Qt::Key_Menu, "Menu" },
{ Qt::Key_Help, "Help" },
{ Qt::Key_Enter, "KP_Enter" },
{ Qt::Key_Clear, "Clear" },
{ Qt::Key_Back, "WWWBack" },
{ Qt::Key_Forward, "WWWForward" },
{ Qt::Key_Stop, "WWWStop" },
{ Qt::Key_Refresh, "WWWRefresh" },
{ Qt::Key_VolumeDown, "AudioDown" },
{ Qt::Key_VolumeMute, "AudioMute" },
{ Qt::Key_VolumeUp, "AudioUp" },
{ Qt::Key_MediaPlay, "AudioPlay" },
{ Qt::Key_MediaStop, "AudioStop" },
{ Qt::Key_MediaPrevious,"AudioPrev" },
{ Qt::Key_MediaNext, "AudioNext" },
{ Qt::Key_HomePage, "WWWHome" },
{ Qt::Key_Favorites, "WWWFavorites" },
{ Qt::Key_Search, "WWWSearch" },
{ Qt::Key_Standby, "Sleep" },
{ Qt::Key_LaunchMail, "AppMail" },
{ Qt::Key_LaunchMedia, "AppMedia" },
{ Qt::Key_Launch0, "AppUser1" },
{ Qt::Key_Launch1, "AppUser2" },
{ Qt::Key_Select, "Select" },
{ 0, 0 }
};
KeySequence::KeySequence() :
m_Sequence(),
m_Modifiers(0),
m_IsValid(false)
{
}
bool KeySequence::isMouseButton() const
{
return !m_Sequence.isEmpty() && m_Sequence.last() < Qt::Key_Space;
}
QString KeySequence::toString() const
{
QString result;
for (int i = 0; i < m_Sequence.size(); i++)
{
result += keyToString(m_Sequence[i]);
if (i != m_Sequence.size() - 1)
result += "+";
}
return result;
}
bool KeySequence::appendMouseButton(int button)
{
return appendKey(button, 0);
}
bool KeySequence::appendKey(int key, int modifiers)
{
if (m_Sequence.size() == 4)
return true;
switch(key)
{
case Qt::Key_AltGr:
return false;
case Qt::Key_Control:
case Qt::Key_Alt:
case Qt::Key_Shift:
case Qt::Key_Meta:
case Qt::Key_Menu:
{
int mod = modifiers & (~m_Modifiers);
if (mod)
{
m_Sequence.append(mod);
m_Modifiers |= mod;
}
}
break;
default:
// see if we can handle this key, if not, don't accept it
if (keyToString(key).isEmpty())
break;
m_Sequence.append(key);
setValid(true);
return true;
}
return false;
}
void KeySequence::loadSettings(QSettings& settings)
{
sequence().clear();
int num = settings.beginReadArray("keys");
for (int i = 0; i < num; i++)
{
settings.setArrayIndex(i);
sequence().append(settings.value("key", 0).toInt());
}
settings.endArray();
setModifiers(0);
setValid(true);
}
void KeySequence::saveSettings(QSettings& settings) const
{
settings.beginWriteArray("keys");
for (int i = 0; i < sequence().size(); i++)
{
settings.setArrayIndex(i);
settings.setValue("key", sequence()[i]);
}
settings.endArray();
}
QString KeySequence::keyToString(int key)
{
// nothing there?
if (key == 0)
return "";
// a hack to handle mouse buttons as if they were keys
if (key < Qt::Key_Space)
{
switch(key)
{
case Qt::LeftButton: return "1";
case Qt::RightButton: return "2";
case Qt::MidButton: return "3";
}
return "4"; // qt only knows three mouse buttons, so assume it's an unknown fourth one
}
// modifiers?
if (key & Qt::ShiftModifier)
return "Shift";
if (key & Qt::ControlModifier)
return "Control";
if (key & Qt::AltModifier)
return "Alt";
if (key & Qt::MetaModifier)
return "Meta";
// treat key pad like normal keys (FIXME: we should have another lookup table for keypad keys instead)
key &= ~Qt::KeypadModifier;
// a printable 7 bit character?
if (key < 0x80 && key != Qt::Key_Space)
return QChar(key & 0x7f).toLower();
// a function key?
if (key >= Qt::Key_F1 && key <= Qt::Key_F35)
return QString::fromUtf8("F%1").arg(key - Qt::Key_F1 + 1);
// a special key?
int i=0;
while (keyname[i].name)
{
if (key == keyname[i].key)
return QString::fromUtf8(keyname[i].name);
i++;
}
// representable in ucs2?
if (key < 0x10000)
return QString("\\u%1").arg(QChar(key).toLower().unicode(), 4, 16, QChar('0'));
// give up, synergy probably won't handle this
return "";
}

View File

@@ -1,57 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(KEYSEQUENCE_H)
#define KEYSEQUENCE_H
#include <QList>
#include <QString>
class QSettings;
class KeySequence
{
public:
KeySequence();
public:
QString toString() const;
bool appendKey(int modifiers, int key);
bool appendMouseButton(int button);
bool isMouseButton() const;
bool valid() const { return m_IsValid; }
int modifiers() const { return m_Modifiers; }
void saveSettings(QSettings& settings) const;
void loadSettings(QSettings& settings);
const QList<int>& sequence() const { return m_Sequence; }
private:
void setValid(bool b) { m_IsValid = b; }
void setModifiers(int i) { m_Modifiers = i; }
QList<int>& sequence() { return m_Sequence; }
private:
QList<int> m_Sequence;
int m_Modifiers;
bool m_IsValid;
static QString keyToString(int key);
};
#endif

View File

@@ -1,143 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "KeySequenceWidget.h"
#include <iostream>
KeySequenceWidget::KeySequenceWidget(QWidget* parent, const KeySequence& seq) :
QPushButton(parent),
m_KeySequence(seq),
m_BackupSequence(seq),
m_Status(Stopped),
m_MousePrefix("mousebutton("),
m_MousePostfix(")"),
m_KeyPrefix("keystroke("),
m_KeyPostfix(")")
{
setFocusPolicy(Qt::NoFocus);
updateOutput();
}
void KeySequenceWidget::setKeySequence(const KeySequence& seq)
{
keySequence() = seq;
backupSequence() = seq;
setStatus(Stopped);
updateOutput();
}
void KeySequenceWidget::mousePressEvent(QMouseEvent* event)
{
event->accept();
if (status() == Stopped)
{
startRecording();
return;
}
if (m_KeySequence.appendMouseButton(event->button()))
stopRecording();
updateOutput();
}
void KeySequenceWidget::startRecording()
{
keySequence() = KeySequence();
setDown(true);
setFocus();
grabKeyboard();
setStatus(Recording);
}
void KeySequenceWidget::stopRecording()
{
if (!keySequence().valid())
{
keySequence() = backupSequence();
updateOutput();
}
setDown(false);
focusNextChild();
releaseKeyboard();
setStatus(Stopped);
emit keySequenceChanged();
}
bool KeySequenceWidget::event(QEvent* event)
{
if (status() == Recording)
{
switch(event->type())
{
case QEvent::KeyPress:
keyPressEvent(static_cast<QKeyEvent*>(event));
return true;
case QEvent::MouseButtonRelease:
event->accept();
return true;
case QEvent::ShortcutOverride:
event->accept();
return true;
case QEvent::FocusOut:
stopRecording();
if (!valid())
{
keySequence() = backupSequence();
updateOutput();
}
break;
default:
break;
}
}
return QPushButton::event(event);
}
void KeySequenceWidget::keyPressEvent(QKeyEvent* event)
{
event->accept();
if (status() == Stopped)
return;
if (m_KeySequence.appendKey(event->key(), event->modifiers()))
stopRecording();
updateOutput();
}
void KeySequenceWidget::updateOutput()
{
QString s;
if (m_KeySequence.isMouseButton())
s = mousePrefix() + m_KeySequence.toString() + mousePostfix();
else
s = keyPrefix() + m_KeySequence.toString() + keyPostfix();
setText(s);
}

View File

@@ -1,80 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(KEYSEQUENCEWIDGET__H)
#define KEYSEQUENCEWIDGET__H
#include <QtGui>
#include "KeySequence.h"
class KeySequenceWidget : public QPushButton
{
Q_OBJECT
public:
KeySequenceWidget(QWidget* parent, const KeySequence& seq = KeySequence());
signals:
void keySequenceChanged();
public:
const QString& mousePrefix() const { return m_MousePrefix; }
const QString& mousePostfix() const { return m_MousePostfix; }
const QString& keyPrefix() const { return m_KeyPrefix; }
const QString& keyPostfix() const { return m_KeyPostfix; }
void setMousePrefix(const QString& s) { m_MousePrefix = s; }
void setMousePostfix(const QString& s) { m_MousePostfix = s; }
void setKeyPrefix(const QString& s) { m_KeyPrefix = s; }
void setKeyPostfix(const QString& s) { m_KeyPostfix = s; }
const KeySequence& keySequence() const { return m_KeySequence; }
const KeySequence& backupSequence() const { return m_BackupSequence; }
void setKeySequence(const KeySequence& seq);
bool valid() const { return keySequence().valid(); }
protected:
void mousePressEvent(QMouseEvent*);
void keyPressEvent(QKeyEvent*);
bool event(QEvent* event);
void appendToSequence(int key);
void updateOutput();
void startRecording();
void stopRecording();
KeySequence& keySequence() { return m_KeySequence; }
KeySequence& backupSequence() { return m_BackupSequence; }
private:
enum Status { Stopped, Recording };
void setStatus(Status s) { m_Status = s; }
Status status() const { return m_Status; }
private:
KeySequence m_KeySequence;
KeySequence m_BackupSequence;
Status m_Status;
QString m_MousePrefix;
QString m_MousePostfix;
QString m_KeyPrefix;
QString m_KeyPostfix;
};
#endif

View File

@@ -1,46 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "LogDialog.h"
#include <QProcess>
LogDialog::LogDialog (QWidget* parent, QProcess*& synergy) :
QDialog (parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::LogDialogBase(),
m_pSynergy(synergy)
{
setupUi(this);
}
void LogDialog::append(const QString& s)
{
m_pLogOutput->append(s);
}
void LogDialog::readSynergyOutput()
{
if (m_pSynergy)
{
QByteArray log;
log += m_pSynergy->readAllStandardOutput();
log += m_pSynergy->readAllStandardError();
append(QString(log));
}
}

View File

@@ -1,46 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(LOGDIALOG_H)
#define LOGDIALOG_H
#include <QDialog>
#include "ui_LogDialogBase.h"
class QProcess;
class LogDialog : public QDialog, public Ui::LogDialogBase
{
Q_OBJECT
public:
LogDialog(QWidget* parent, QProcess*& synergy);
public:
void append(const QString& s);
void clear() { m_pLogOutput->clear(); }
public slots:
void readSynergyOutput();
private:
QProcess*& m_pSynergy;
};
#endif

View File

@@ -1,480 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "MainWindow.h"
#include "AboutDialog.h"
#include "ServerConfigDialog.h"
#include "SettingsDialog.h"
#include "LogDialog.h"
#include "WindowsServices.h"
#include <QtCore>
#include <QtGui>
#include <QtNetwork>
#if defined(Q_OS_WIN)
static const char synergyConfigName[] = "synergy.sgc";
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.sgc);;All files (*.*)"));
#else
static const char synergyConfigName[] = "synergy.conf";
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)"));
#endif
static const char* synergyIconFiles[] =
{
":/res/icons/16x16/synergy-disconnected.png",
":/res/icons/16x16/synergy-connected.png"
};
MainWindow::MainWindow(QWidget* parent) :
QMainWindow(parent),
MainWindowBase(),
m_Settings(),
m_AppConfig(&m_Settings),
m_pSynergy(NULL),
m_SynergyState(synergyDisconnected),
m_ServerConfig(&m_Settings, 5, 3),
m_pTempConfigFile(NULL),
m_pLogDialog(new LogDialog(this, synergyProcess())),
m_pTrayIcon(NULL),
m_pTrayIconMenu(NULL)
{
setupUi(this);
createTrayIcon();
createMenuBar();
loadSettings();
initConnections();
// HACK - surely window should be visible by default?
setVisible(true);
if (appConfig().autoConnect())
startSynergy();
}
MainWindow::~MainWindow()
{
stopSynergy();
saveSettings();
}
void MainWindow::setStatus(const QString &status)
{
m_pStatusLabel->setText(status);
}
void MainWindow::createTrayIcon()
{
#if !defined(Q_OS_MAC)
m_pTrayIconMenu = new QMenu(this);
m_pTrayIconMenu->addAction(m_pActionStartSynergy);
m_pTrayIconMenu->addAction(m_pActionStopSynergy);
m_pTrayIconMenu->addSeparator();
m_pTrayIconMenu->addAction(m_pActionMinimize);
m_pTrayIconMenu->addAction(m_pActionRestore);
m_pTrayIconMenu->addSeparator();
m_pTrayIconMenu->addAction(m_pActionQuit);
m_pTrayIcon = new QSystemTrayIcon(this);
m_pTrayIcon->setContextMenu(m_pTrayIconMenu);
setIcon(synergyDisconnected);
m_pTrayIcon->show();
#else
setIcon(synergyDisconnected);
#endif
}
void MainWindow::createMenuBar()
{
QMenuBar* menubar = new QMenuBar(this);
QMenu* pMenuFile = new QMenu(tr("&File"), menubar);
QMenu* pMenuEdit = new QMenu(tr("&Edit"), menubar);
QMenu* pMenuView = new QMenu(tr("&View"), menubar);
QMenu* pMenuWindow = new QMenu(tr("&Window"), menubar);
QMenu* pMenuHelp = new QMenu(tr("&Help"), menubar);
menubar->addAction(pMenuFile->menuAction());
menubar->addAction(pMenuEdit->menuAction());
menubar->addAction(pMenuView->menuAction());
#if !defined(Q_OS_MAC)
menubar->addAction(pMenuWindow->menuAction());
#endif
menubar->addAction(pMenuHelp->menuAction());
pMenuFile->addAction(m_pActionStartSynergy);
pMenuFile->addAction(m_pActionStopSynergy);
pMenuFile->addSeparator();
pMenuFile->addAction(m_pActionSave);
pMenuFile->addSeparator();
pMenuFile->addAction(m_pActionQuit);
pMenuEdit->addAction(m_pActionSettings);
#if defined(Q_OS_WIN)
pMenuEdit->addAction(m_pActionServices);
#endif
pMenuView->addAction(m_pActionLogOutput);
pMenuWindow->addAction(m_pActionMinimize);
pMenuWindow->addAction(m_pActionRestore);
pMenuHelp->addAction(m_pActionAbout);
setMenuBar(menubar);
}
void MainWindow::loadSettings()
{
// the next two must come BEFORE loading groupServerChecked and groupClientChecked or
// disabling and/or enabling the right widgets won't automatically work
m_pRadioExternalConfig->setChecked(settings().value("externalConfig", false).toBool());
m_pRadioInternalConfig->setChecked(settings().value("internalConfig", true).toBool());
m_pGroupServer->setChecked(settings().value("groupServerChecked", false).toBool());
m_pLineEditConfigFile->setText(settings().value("configFile", QDir::homePath() + "/" + synergyConfigName).toString());
m_pGroupClient->setChecked(settings().value("groupClientChecked", true).toBool());
m_pLineEditHostname->setText(settings().value("serverHostname").toString());
}
void MainWindow::initConnections()
{
connect(m_pActionMinimize, SIGNAL(triggered()), this, SLOT(hide()));
connect(m_pActionRestore, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(m_pActionStartSynergy, SIGNAL(triggered()), this, SLOT(startSynergy()));
connect(m_pActionStopSynergy, SIGNAL(triggered()), this, SLOT(stopSynergy()));
connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
if (m_pTrayIcon)
connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
void MainWindow::saveSettings()
{
// program settings
settings().setValue("groupServerChecked", m_pGroupServer->isChecked());
settings().setValue("externalConfig", m_pRadioExternalConfig->isChecked());
settings().setValue("configFile", m_pLineEditConfigFile->text());
settings().setValue("internalConfig", m_pRadioInternalConfig->isChecked());
settings().setValue("groupClientChecked", m_pGroupClient->isChecked());
settings().setValue("serverHostname", m_pLineEditHostname->text());
settings().sync();
}
void MainWindow::setIcon(qSynergyState state)
{
QIcon icon;
icon.addFile(synergyIconFiles[state]);
if (m_pTrayIcon)
m_pTrayIcon->setIcon(icon);
setWindowIcon(icon);
}
void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
{
if (reason == QSystemTrayIcon::DoubleClick)
setVisible(!isVisible());
}
void MainWindow::startSynergy()
{
stopSynergy();
QString app;
QStringList args;
args << "-f" << "--debug" << appConfig().logLevelText();
if (!appConfig().screenName().isEmpty())
args << "--name" << appConfig().screenName();
setSynergyProcess(new QProcess(this));
if ((synergyType() == synergyClient && !clientArgs(args, app))
|| (synergyType() == synergyServer && !serverArgs(args, app)))
{
stopSynergy();
return;
}
connect(synergyProcess(), SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(synergyFinished(int, QProcess::ExitStatus)));
connect(synergyProcess(), SIGNAL(readyReadStandardOutput()), m_pLogDialog, SLOT(readSynergyOutput()));
connect(synergyProcess(), SIGNAL(readyReadStandardError()), m_pLogDialog, SLOT(readSynergyOutput()));
m_pLogDialog->append(tr("\n\nRunning synergy: %1 %2\n\n").arg(app).arg(args.join(" ")));
synergyProcess()->start(app, args);
if (!synergyProcess()->waitForStarted())
{
stopSynergy();
QMessageBox::warning(this, tr("Program can not be started"), QString(tr("The executable<br><br>%1<br><br>could not be successfully started, although it does exist. Please check if you have sufficient permissions to run this program.").arg(app)));
return;
}
setSynergyState(synergyConnected);
}
bool MainWindow::clientArgs(QStringList& args, QString& app)
{
app = appPath(appConfig().synergycName(), appConfig().synergyc());
if (!QFile::exists(app))
{
if (QMessageBox::warning(this, tr("Synergy client not found"), tr("The executable for the synergy client does not exist. Do you want to browse for the synergy client now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
return false;
app = SettingsDialog::browseForSynergyc(this, appConfig().synergyProgramDir(), appConfig().synergycName());
if (app.isEmpty())
return false;
appConfig().setSynergyc(app);
}
if (m_pLineEditHostname->text().isEmpty())
{
QMessageBox::warning(this, tr("Hostname is empty"), tr("Please fill in a hostname for the synergy client to connect to."));
return false;
}
if (appConfig().logToFile())
{
appConfig().persistLogDir();
args << "--log" << appConfig().logFilename();
}
args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port());
return true;
}
QString MainWindow::configFilename()
{
QString filename;
if (m_pRadioInternalConfig->isChecked())
{
// TODO: no need to use a temporary file, since we need it to
// be permenant (since it'll be used for Windows services, etc).
m_pTempConfigFile = new QTemporaryFile();
if (!m_pTempConfigFile->open())
{
QMessageBox::critical(this, tr("Cannot write configuration file"), tr("The temporary configuration file required to start synergy can not be written."));
return false;
}
serverConfig().save(*m_pTempConfigFile);
filename = m_pTempConfigFile->fileName();
m_pTempConfigFile->close();
}
else
{
if (!QFile::exists(m_pLineEditConfigFile->text()))
{
if (QMessageBox::warning(this, tr("Configuration filename invalid"),
tr("You have not filled in a valid configuration file for the synergy server. "
"Do you want to browse for the configuration file now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes
|| !on_m_pButtonBrowseConfigFile_clicked())
return false;
}
filename = m_pLineEditConfigFile->text();
}
return filename;
}
QString MainWindow::address()
{
return (!appConfig().interface().isEmpty() ? appConfig().interface() : "") + ":" + QString::number(appConfig().port());
}
QString MainWindow::appPath(const QString& name, const QString& defaultPath)
{
QString app;
if (appConfig().autoDetectPaths())
{
// actually returns bool, but ignore for now
appConfig().detectPath(name, app);
}
else
{
app = defaultPath;
}
return app;
}
bool MainWindow::serverArgs(QStringList& args, QString& app)
{
app = appPath(appConfig().synergysName(), appConfig().synergys());
if (!QFile::exists(app))
{
if (QMessageBox::warning(this, tr("Synergy server not found"), tr("The executable for the synergy server does not exist. Do you want to browse for the synergy server now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
return false;
app = SettingsDialog::browseForSynergys(this, appConfig().synergyProgramDir(), appConfig().synergysName());
if (app.isEmpty())
return false;
appConfig().setSynergys(app);
}
if (appConfig().logToFile())
{
appConfig().persistLogDir();
args << "--log" << appConfig().logFilename();
}
args << "-c" << configFilename() << "--address" << address();
return true;
}
void MainWindow::stopSynergy()
{
if (synergyProcess())
{
if (synergyProcess()->isOpen())
synergyProcess()->close();
delete synergyProcess();
setSynergyProcess(NULL);
setSynergyState(synergyDisconnected);
}
// HACK: deleting the object deletes the physical file, which is
// bad, since it could be in use by the Windows service!
//delete m_pTempConfigFile;
m_pTempConfigFile = NULL;
}
void MainWindow::synergyFinished(int exitCode, QProcess::ExitStatus)
{
// on Windows, we always seem to have an exit code != 0.
#if !defined(Q_OS_WIN)
if (exitCode != 0)
{
QMessageBox::critical(this, tr("Synergy terminated with an error"), QString(tr("Synergy terminated unexpectedly with an exit code of %1.<br><br>Please see the log output for details.")).arg(exitCode));
stopSynergy();
}
#else
Q_UNUSED(exitCode);
#endif
setSynergyState(synergyDisconnected);
// do not call stopSynergy() in case of clean synergy shutdown, because this must have (well, should have...)
// come from our own delete synergyProcess() in stopSynergy(), so we would do a double-delete...
}
void MainWindow::setSynergyState(qSynergyState state)
{
if (synergyState() == state)
return;
if (state == synergyConnected)
{
disconnect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStartSynergy, SLOT(trigger()));
connect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStopSynergy, SLOT(trigger()));
m_pButtonToggleStart->setText(tr("&Stop"));
}
else
{
disconnect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStopSynergy, SLOT(trigger()));
connect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStartSynergy, SLOT(trigger()));
m_pButtonToggleStart->setText(tr("&Start"));
}
m_pGroupClient->setEnabled(state == synergyDisconnected);
m_pGroupServer->setEnabled(state == synergyDisconnected);
m_pActionStartSynergy->setEnabled(state == synergyDisconnected);
m_pActionStopSynergy->setEnabled(state == synergyConnected);
setStatus(state == synergyConnected ? QString(tr("Synergy %1 is running.")).arg(synergyType() == synergyServer ? tr("server") : tr("client")) : tr("Synergy is not running."));
setIcon(state);
m_SynergyState = state;
}
void MainWindow::setVisible(bool visible)
{
m_pActionMinimize->setEnabled(visible);
m_pActionRestore->setEnabled(!visible);
QMainWindow::setVisible(visible);
}
bool MainWindow::on_m_pButtonBrowseConfigFile_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Browse for a synergys config file"), QString(), synergyConfigFilter);
if (!fileName.isEmpty())
{
m_pLineEditConfigFile->setText(fileName);
return true;
}
return false;
}
bool MainWindow::on_m_pActionSave_triggered()
{
QString fileName = QFileDialog::getSaveFileName(this, tr("Save configuration as..."));
if (!fileName.isEmpty() && !serverConfig().save(fileName))
{
QMessageBox::warning(this, tr("Save failed"), tr("Could not save configuration to file."));
return true;
}
return false;
}
void MainWindow::on_m_pActionAbout_triggered()
{
AboutDialog dlg(this, appConfig().synergyc());
dlg.exec();
}
void MainWindow::on_m_pActionSettings_triggered()
{
SettingsDialog dlg(this, appConfig());
dlg.exec();
}
void MainWindow::on_m_pActionServices_triggered()
{
WindowsServices dlg(this, appConfig());
dlg.exec();
}
void MainWindow::on_m_pActionLogOutput_triggered()
{
Q_ASSERT(m_pLogDialog);
m_pLogDialog->show();
m_pLogDialog->raise();
m_pLogDialog->activateWindow();
}
void MainWindow::on_m_pButtonConfigureServer_clicked()
{
ServerConfigDialog dlg(this, serverConfig(), appConfig().screenName());
dlg.exec();
}

View File

@@ -1,127 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(MAINWINDOW__H)
#define MAINWINDOW__H
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QSettings>
#include <QProcess>
#include "ui_MainWindowBase.h"
#include "ServerConfig.h"
#include "AppConfig.h"
class QAction;
class QMenu;
class QLineEdit;
class QGroupBox;
class QPushButton;
class QTextEdit;
class QComboBox;
class QTabWidget;
class QCheckBox;
class QRadioButton;
class QTemporaryFile;
class LogDialog;
class QSynergyApplication;
class MainWindow : public QMainWindow, public Ui::MainWindowBase
{
Q_OBJECT
friend class QSynergyApplication;
public:
enum qSynergyState
{
synergyDisconnected,
synergyConnected
};
enum qSynergyType
{
synergyClient,
synergyServer
};
public:
MainWindow(QWidget* parent);
~MainWindow();
public:
void setVisible(bool visible);
int synergyType() const { return m_pGroupClient->isChecked() ? synergyClient : synergyServer; }
int synergyState() const { return m_SynergyState; }
QString hostname() const { return m_pLineEditHostname->text(); }
QString configFilename();
QString address();
QString appPath(const QString& name, const QString& defaultPath);
protected slots:
void on_m_pGroupClient_toggled(bool on) { m_pGroupServer->setChecked(!on); }
void on_m_pGroupServer_toggled(bool on) { m_pGroupClient->setChecked(!on); }
bool on_m_pButtonBrowseConfigFile_clicked();
void on_m_pButtonConfigureServer_clicked();
bool on_m_pActionSave_triggered();
void on_m_pActionAbout_triggered();
void on_m_pActionSettings_triggered();
void on_m_pActionServices_triggered();
void on_m_pActionLogOutput_triggered();
void synergyFinished(int exitCode, QProcess::ExitStatus);
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void startSynergy();
void stopSynergy();
protected:
QSettings& settings() { return m_Settings; }
AppConfig& appConfig() { return m_AppConfig; }
QProcess*& synergyProcess() { return m_pSynergy; }
void setSynergyProcess(QProcess* p) { m_pSynergy = p; }
ServerConfig& serverConfig() { return m_ServerConfig; }
void initConnections();
void createMenuBar();
void createStatusBar();
void createTrayIcon();
void loadSettings();
void saveSettings();
void setIcon(qSynergyState state);
void setSynergyState(qSynergyState state);
bool checkForApp(int which, QString& app);
bool clientArgs(QStringList& args, QString& app);
bool serverArgs(QStringList& args, QString& app);
void setStatus(const QString& status);
private:
QSettings m_Settings;
AppConfig m_AppConfig;
QProcess* m_pSynergy;
int m_SynergyState;
ServerConfig m_ServerConfig;
QTemporaryFile* m_pTempConfigFile;
LogDialog* m_pLogDialog;
QSystemTrayIcon* m_pTrayIcon;
QMenu* m_pTrayIconMenu;
};
#endif

View File

@@ -1,47 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "NewScreenWidget.h"
#include "ScreenSetupModel.h"
#include <QtCore>
#include <QtGui>
NewScreenWidget::NewScreenWidget(QWidget* parent) :
QLabel(parent)
{
}
void NewScreenWidget::mousePressEvent(QMouseEvent* event)
{
Screen newScreen(tr("Unnamed"));
QByteArray itemData;
QDataStream dataStream(&itemData, QIODevice::WriteOnly);
dataStream << -1 << -1 << newScreen;
QMimeData* pMimeData = new QMimeData;
pMimeData->setData(ScreenSetupModel::mimeType(), itemData);
QDrag* pDrag = new QDrag(this);
pDrag->setMimeData(pMimeData);
pDrag->setPixmap(*pixmap());
pDrag->setHotSpot(event->pos());
pDrag->exec(Qt::CopyAction, Qt::CopyAction);
}

View File

@@ -1,39 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(NEWSCREENWIDGET__H)
#define NEWSCREENWIDGET__H
#include <QLabel>
class QMouseEvent;
class QWidget;
class NewScreenWidget : public QLabel
{
Q_OBJECT
public:
NewScreenWidget(QWidget* parent);
protected:
void mousePressEvent(QMouseEvent* event);
};
#endif

View File

@@ -1,38 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "QSynergyApplication.h"
#include "MainWindow.h"
#include <QtCore>
#include <QtGui>
QSynergyApplication::QSynergyApplication(int& argc, char** argv) :
QApplication(argc, argv)
{
}
void QSynergyApplication::commitData(QSessionManager&)
{
foreach(QWidget* widget, topLevelWidgets())
{
MainWindow* mainWindow = qobject_cast<MainWindow*>(widget);
if (mainWindow)
mainWindow->saveSettings();
}
}

View File

@@ -1,36 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(QSYNERGYAPPLICATION__H)
#define QSYNERGYAPPLICATION__H
#include <QApplication>
class QSessionManager;
class QSynergyApplication : public QApplication
{
public:
QSynergyApplication(int& argc, char** argv);
public:
void commitData(QSessionManager& manager);
};
#endif

View File

@@ -1,146 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "Screen.h"
#include <QtCore>
#include <QtGui>
Screen::Screen() :
m_Pixmap(QPixmap(":res/icons/64x64/video-display.png")),
m_Swapped(false)
{
init();
}
Screen::Screen(const QString& name) :
m_Pixmap(QPixmap(":res/icons/64x64/video-display.png")),
m_Swapped(false)
{
init();
setName(name);
}
void Screen::init()
{
name().clear();
aliases().clear();
modifiers().clear();
switchCorners().clear();
fixes().clear();
setSwitchCornerSize(0);
// m_Modifiers, m_SwitchCorners and m_Fixes are QLists we use like fixed-size arrays,
// thus we need to make sure to fill them with the required number of elements.
for (int i = 0; i < NumModifiers; i++)
modifiers() << i;
for (int i = 0; i < NumSwitchCorners; i++)
switchCorners() << false;
for (int i = 0; i < NumFixes; i++)
fixes() << false;
}
void Screen::loadSettings(QSettings& settings)
{
setName(settings.value("name").toString());
if (name().isEmpty())
return;
setSwitchCornerSize(settings.value("switchCornerSize").toInt());
readSettings(settings, aliases(), "alias", QString(""));
readSettings(settings, modifiers(), "modifier", static_cast<int>(DefaultMod), NumModifiers);
readSettings(settings, switchCorners(), "switchCorner", false, NumSwitchCorners);
readSettings(settings, fixes(), "fix", false, NumFixes);
}
void Screen::saveSettings(QSettings& settings) const
{
settings.setValue("name", name());
if (name().isEmpty())
return;
settings.setValue("switchCornerSize", switchCornerSize());
writeSettings(settings, aliases(), "alias");
writeSettings(settings, modifiers(), "modifier");
writeSettings(settings, switchCorners(), "switchCorner");
writeSettings(settings, fixes(), "fix");
}
QTextStream& Screen::writeScreensSection(QTextStream& outStream) const
{
outStream << "\t" << name() << ":" << endl;
for (int i = 0; i < modifiers().size(); i++)
if (modifier(i) != i)
outStream << "\t\t" << modifierName(i) << " = " << modifierName(modifier(i)) << endl;
for (int i = 0; i < fixes().size(); i++)
outStream << "\t\t" << fixName(i) << " = " << (fixes()[i] ? "true" : "false") << endl;
outStream << "\t\t" << "switchCorners = none ";
for (int i = 0; i < switchCorners().size(); i++)
if (switchCorners()[i])
outStream << "+" << switchCornerName(i) << " ";
outStream << endl;
outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << endl;
return outStream;
}
QTextStream& Screen::writeAliasesSection(QTextStream& outStream) const
{
if (!aliases().isEmpty())
{
outStream << "\t" << name() << ":" << endl;
foreach (const QString& alias, aliases())
outStream << "\t\t" << alias << endl;
}
return outStream;
}
QDataStream& operator<<(QDataStream& outStream, const Screen& screen)
{
return outStream
<< screen.name()
<< screen.switchCornerSize()
<< screen.aliases()
<< screen.modifiers()
<< screen.switchCorners()
<< screen.fixes()
;
}
QDataStream& operator>>(QDataStream& inStream, Screen& screen)
{
return inStream
>> screen.m_Name
>> screen.m_SwitchCornerSize
>> screen.m_Aliases
>> screen.m_Modifiers
>> screen.m_SwitchCorners
>> screen.m_Fixes
;
}

View File

@@ -1,104 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SCREEN__H)
#define SCREEN__H
#include <QPixmap>
#include <QString>
#include <QList>
#include <QStringList>
#include "BaseConfig.h"
class QSettings;
class QTextStream;
class ScreenSettingsDialog;
class Screen : public BaseConfig
{
friend QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
friend QDataStream& operator>>(QDataStream& inStream, Screen& screen);
friend class ScreenSettingsDialog;
friend class ScreenSetupModel;
friend class ScreenSetupView;
public:
Screen();
Screen(const QString& name);
public:
const QPixmap* pixmap() const { return &m_Pixmap; }
const QString& name() const { return m_Name; }
const QStringList& aliases() const { return m_Aliases; }
bool isNull() const { return m_Name.isEmpty(); }
int modifier(int m) const { return m_Modifiers[m] == DefaultMod ? m : m_Modifiers[m]; }
const QList<int>& modifiers() const { return m_Modifiers; }
bool switchCorner(int c) const { return m_SwitchCorners[c]; }
const QList<bool>& switchCorners() const { return m_SwitchCorners; }
int switchCornerSize() const { return m_SwitchCornerSize; }
bool fix(Fix f) const { return m_Fixes[f]; }
const QList<bool>& fixes() const { return m_Fixes; }
void loadSettings(QSettings& settings);
void saveSettings(QSettings& settings) const;
QTextStream& writeScreensSection(QTextStream& outStream) const;
QTextStream& writeAliasesSection(QTextStream& outStream) const;
bool swapped() const { return m_Swapped; }
protected:
void init();
void setName(const QString& name) { m_Name = name; }
QPixmap* pixmap() { return &m_Pixmap; }
QString& name() { return m_Name; }
void setPixmap(const QPixmap& pixmap) { m_Pixmap = pixmap; }
QStringList& aliases() { return m_Aliases; }
void setModifier(int m, int n) { m_Modifiers[m] = n; }
QList<int>& modifiers() { return m_Modifiers; }
void addAlias(const QString& alias) { m_Aliases.append(alias); }
void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
QList<bool>& switchCorners() { return m_SwitchCorners; }
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
void setFix(int f, bool on) { m_Fixes[f] = on; }
QList<bool>& fixes() { return m_Fixes; }
void setSwapped(bool on) { m_Swapped = on; }
private:
QPixmap m_Pixmap;
QString m_Name;
QStringList m_Aliases;
QList<int> m_Modifiers;
QList<bool> m_SwitchCorners;
int m_SwitchCornerSize;
QList<bool> m_Fixes;
bool m_Swapped;
};
typedef QList<Screen> ScreenList;
QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
QDataStream& operator>>(QDataStream& inStream, Screen& screen);
#endif

View File

@@ -1,121 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ScreenSettingsDialog.h"
#include "Screen.h"
#include <QtCore>
#include <QtGui>
ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::ScreenSettingsDialogBase(),
m_pScreen(pScreen)
{
setupUi(this);
QRegExp validScreenName("[a-z_][a-z0-9\\._-]{,31}", Qt::CaseInsensitive);
m_pLineEditName->setText(m_pScreen->name());
m_pLineEditName->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
m_pLineEditName->selectAll();
m_pLineEditAlias->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
for (int i = 0; i < m_pScreen->aliases().count(); i++)
new QListWidgetItem(m_pScreen->aliases()[i], m_pListAliases);
m_pComboBoxShift->setCurrentIndex(m_pScreen->modifier(Screen::Shift));
m_pComboBoxCtrl->setCurrentIndex(m_pScreen->modifier(Screen::Ctrl));
m_pComboBoxAlt->setCurrentIndex(m_pScreen->modifier(Screen::Alt));
m_pComboBoxMeta->setCurrentIndex(m_pScreen->modifier(Screen::Meta));
m_pComboBoxSuper->setCurrentIndex(m_pScreen->modifier(Screen::Super));
m_pCheckBoxCornerTopLeft->setChecked(m_pScreen->switchCorner(Screen::TopLeft));
m_pCheckBoxCornerTopRight->setChecked(m_pScreen->switchCorner(Screen::TopRight));
m_pCheckBoxCornerBottomLeft->setChecked(m_pScreen->switchCorner(Screen::BottomLeft));
m_pCheckBoxCornerBottomRight->setChecked(m_pScreen->switchCorner(Screen::BottomRight));
m_pSpinBoxSwitchCornerSize->setValue(m_pScreen->switchCornerSize());
m_pCheckBoxCapsLock->setChecked(m_pScreen->fix(Screen::CapsLock));
m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::NumLock));
m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::ScrollLock));
m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::XTest));
}
void ScreenSettingsDialog::accept()
{
if (m_pLineEditName->text().isEmpty())
{
QMessageBox::warning(this, tr("Screen name is empty"), tr("The name for a screen can not be empty. Please fill in a name or cancel the dialog."));
return;
}
m_pScreen->init();
m_pScreen->setName(m_pLineEditName->text());
for (int i = 0; i < m_pListAliases->count(); i++)
m_pScreen->addAlias(m_pListAliases->item(i)->text());
m_pScreen->setModifier(Screen::Shift, m_pComboBoxShift->currentIndex());
m_pScreen->setModifier(Screen::Ctrl, m_pComboBoxCtrl->currentIndex());
m_pScreen->setModifier(Screen::Alt, m_pComboBoxAlt->currentIndex());
m_pScreen->setModifier(Screen::Meta, m_pComboBoxMeta->currentIndex());
m_pScreen->setModifier(Screen::Super, m_pComboBoxSuper->currentIndex());
m_pScreen->setSwitchCorner(Screen::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
m_pScreen->setSwitchCorner(Screen::TopRight, m_pCheckBoxCornerTopRight->isChecked());
m_pScreen->setSwitchCorner(Screen::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
m_pScreen->setSwitchCorner(Screen::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
m_pScreen->setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
m_pScreen->setFix(Screen::CapsLock, m_pCheckBoxCapsLock->isChecked());
m_pScreen->setFix(Screen::NumLock, m_pCheckBoxNumLock->isChecked());
m_pScreen->setFix(Screen::ScrollLock, m_pCheckBoxScrollLock->isChecked());
m_pScreen->setFix(Screen::XTest, m_pCheckBoxXTest->isChecked());
QDialog::accept();
}
void ScreenSettingsDialog::on_m_pButtonAddAlias_clicked()
{
if (!m_pLineEditAlias->text().isEmpty() && m_pListAliases->findItems(m_pLineEditAlias->text(), Qt::MatchFixedString).isEmpty())
{
new QListWidgetItem(m_pLineEditAlias->text(), m_pListAliases);
m_pLineEditAlias->clear();
}
}
void ScreenSettingsDialog::on_m_pLineEditAlias_textChanged(const QString& text)
{
m_pButtonAddAlias->setEnabled(!text.isEmpty());
}
void ScreenSettingsDialog::on_m_pButtonRemoveAlias_clicked()
{
QList<QListWidgetItem*> items = m_pListAliases->selectedItems();
for (int i = 0; i < items.count(); i++)
delete items[i];
}
void ScreenSettingsDialog::on_m_pListAliases_itemSelectionChanged()
{
m_pButtonRemoveAlias->setEnabled(!m_pListAliases->selectedItems().isEmpty());
}

View File

@@ -1,52 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SCREENSETTINGSDIALOG__H)
#define SCREENSETTINGSDIALOG__H
#include <QDialog>
#include "ui_ScreenSettingsDialogBase.h"
class QWidget;
class QString;
class Screen;
class ScreenSettingsDialog : public QDialog, public Ui::ScreenSettingsDialogBase
{
Q_OBJECT
public:
ScreenSettingsDialog(QWidget* parent, Screen* pScreen = NULL);
public slots:
void accept();
private slots:
void on_m_pButtonAddAlias_clicked();
void on_m_pButtonRemoveAlias_clicked();
void on_m_pLineEditAlias_textChanged(const QString& text);
void on_m_pListAliases_itemSelectionChanged();
private:
Screen* m_pScreen;
};
#endif

View File

@@ -1,142 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ScreenSetupModel.h"
#include "Screen.h"
#include <QtCore>
#include <QtGui>
const QString ScreenSetupModel::m_MimeType = "application/x-qsynergy-screen";
ScreenSetupModel::ScreenSetupModel(ScreenList& screens, int numColumns, int numRows) :
QAbstractTableModel(NULL),
m_Screens(screens),
m_NumColumns(numColumns),
m_NumRows(numRows)
{
if (m_NumColumns * m_NumRows > screens.size())
qFatal("Not enough elements (%u) in screens QList for %d columns and %d rows", screens.size(), m_NumColumns, m_NumRows);
}
QVariant ScreenSetupModel::data(const QModelIndex& index, int role) const
{
if (index.isValid() && index.row() < m_NumRows && index.column() < m_NumColumns)
{
switch(role)
{
case Qt::DecorationRole:
if (screen(index).isNull())
break;
return QIcon(*screen(index).pixmap());
case Qt::ToolTipRole:
if (screen(index).isNull())
break;
return QString(tr(
"<center>Screen: <b>%1</b></center>"
"<br>Double click to edit settings"
"<br>Drag screen to the trashcan to remove it")).arg(screen(index).name());
case Qt::DisplayRole:
if (screen(index).isNull())
break;
return screen(index).name();
}
}
return QVariant();
}
Qt::ItemFlags ScreenSetupModel::flags(const QModelIndex& index) const
{
if (!index.isValid() || index.row() >= m_NumRows || index.column() >= m_NumColumns)
return 0;
if (!screen(index).isNull())
return Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled;
return Qt::ItemIsDropEnabled;
}
Qt::DropActions ScreenSetupModel::supportedDropActions() const
{
return Qt::MoveAction | Qt::CopyAction;
}
QStringList ScreenSetupModel::mimeTypes() const
{
return QStringList() << m_MimeType;
}
QMimeData* ScreenSetupModel::mimeData(const QModelIndexList& indexes) const
{
QMimeData* pMimeData = new QMimeData();
QByteArray encodedData;
QDataStream stream(&encodedData, QIODevice::WriteOnly);
foreach (const QModelIndex& index, indexes)
if (index.isValid())
stream << index.column() << index.row() << screen(index);
pMimeData->setData(m_MimeType, encodedData);
return pMimeData;
}
bool ScreenSetupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent)
{
if (action == Qt::IgnoreAction)
return true;
if (!data->hasFormat(m_MimeType))
return false;
if (!parent.isValid() || row != -1 || column != -1)
return false;
QByteArray encodedData = data->data(m_MimeType);
QDataStream stream(&encodedData, QIODevice::ReadOnly);
int sourceColumn = -1;
int sourceRow = -1;
stream >> sourceColumn;
stream >> sourceRow;
// don't drop screen onto itself
if (sourceColumn == parent.column() && sourceRow == parent.row())
return false;
Screen droppedScreen;
stream >> droppedScreen;
Screen oldScreen = screen(parent.column(), parent.row());
if (!oldScreen.isNull() && sourceColumn != -1 && sourceRow != -1)
{
// mark the screen so it isn't deleted after the dragndrop succeeded
// see ScreenSetupView::startDrag()
oldScreen.setSwapped(true);
screen(sourceColumn, sourceRow) = oldScreen;
}
screen(parent.column(), parent.row()) = droppedScreen;
return true;
}

View File

@@ -1,70 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SCREENSETUPMODEL__H)
#define SCREENSETUPMODEL__H
#include <QAbstractTableModel>
#include <QList>
#include <QString>
#include <QStringList>
#include "Screen.h"
class ScreenSetupView;
class ServerConfigDialog;
class ScreenSetupModel : public QAbstractTableModel
{
Q_OBJECT
friend class ScreenSetupView;
friend class ServerConfigDialog;
public:
ScreenSetupModel(ScreenList& screens, int numColumns, int numRows);
public:
static const QString& mimeType() { return m_MimeType; }
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
int rowCount() const { return m_NumRows; }
int columnCount() const { return m_NumColumns; }
int rowCount(const QModelIndex&) const { return rowCount(); }
int columnCount(const QModelIndex&) const { return columnCount(); }
Qt::DropActions supportedDropActions() const;
Qt::ItemFlags flags(const QModelIndex& index) const;
QStringList mimeTypes() const;
QMimeData* mimeData(const QModelIndexList& indexes) const;
protected:
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
const Screen& screen(const QModelIndex& index) const { return screen(index.column(), index.row()); }
Screen& screen(const QModelIndex& index) { return screen(index.column(), index.row()); }
const Screen& screen(int column, int row) const { return m_Screens[row * m_NumColumns + column]; }
Screen& screen(int column, int row) { return m_Screens[row * m_NumColumns + column]; }
private:
ScreenList& m_Screens;
const int m_NumColumns;
const int m_NumRows;
static const QString m_MimeType;
};
#endif

View File

@@ -1,160 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ScreenSetupView.h"
#include "ScreenSetupModel.h"
#include "ScreenSettingsDialog.h"
#include <QtCore>
#include <QtGui>
ScreenSetupView::ScreenSetupView(QWidget* parent) :
QTableView(parent)
{
setDropIndicatorShown(true);
setDragDropMode(DragDrop);
setSelectionMode(SingleSelection);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setIconSize(QSize(64, 64));
horizontalHeader()->hide();
verticalHeader()->hide();
}
void ScreenSetupView::setModel(ScreenSetupModel* model)
{
QTableView::setModel(model);
setTableSize();
}
ScreenSetupModel* ScreenSetupView::model() const
{
return qobject_cast<ScreenSetupModel*>(QTableView::model());
}
void ScreenSetupView::setTableSize()
{
for (int i = 0; i < model()->columnCount(); i++)
setColumnWidth(i, width() / model()->columnCount());
for (int i = 0; i < model()->rowCount(); i++)
setRowHeight(i, height() / model()->rowCount());
}
void ScreenSetupView::resizeEvent(QResizeEvent* event)
{
setTableSize();
event->ignore();
}
void ScreenSetupView::mouseDoubleClickEvent(QMouseEvent* event)
{
if (event->buttons() & Qt::LeftButton)
{
int col = columnAt(event->pos().x());
int row = rowAt(event->pos().y());
if (!model()->screen(col, row).isNull())
{
ScreenSettingsDialog dlg(this, &model()->screen(col, row));
dlg.exec();
}
}
else
event->ignore();
}
void ScreenSetupView::dragEnterEvent(QDragEnterEvent* event)
{
// we accept anything that enters us by a drag as long as the
// mime type is okay. anything else is dealt with in dragMoveEvent()
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
event->accept();
else
event->ignore();
}
void ScreenSetupView::dragMoveEvent(QDragMoveEvent* event)
{
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
{
// where does the event come from? myself or someone else?
if (event->source() == this)
{
// myself is ok, but then it must be a move action, never a copy
event->setDropAction(Qt::MoveAction);
event->accept();
}
else
{
int col = columnAt(event->pos().x());
int row = rowAt(event->pos().y());
// a drop from outside is not allowed if there's a screen already there.
if (!model()->screen(col, row).isNull())
event->ignore();
else
event->acceptProposedAction();
}
}
else
event->ignore();
}
// this is reimplemented from QAbstractItemView::startDrag()
void ScreenSetupView::startDrag(Qt::DropActions)
{
QModelIndexList indexes = selectedIndexes();
if (indexes.count() != 1)
return;
QMimeData* pData = model()->mimeData(indexes);
if (pData == NULL)
return;
QPixmap pixmap = *model()->screen(indexes[0]).pixmap();
QDrag* pDrag = new QDrag(this);
pDrag->setPixmap(pixmap);
pDrag->setMimeData(pData);
pDrag->setHotSpot(QPoint(pixmap.width() / 2, pixmap.height() / 2));
if (pDrag->exec(Qt::MoveAction, Qt::MoveAction) == Qt::MoveAction)
{
selectionModel()->clear();
// make sure to only delete the drag source if screens weren't swapped
// see ScreenSetupModel::dropMimeData
if (!model()->screen(indexes[0]).swapped())
model()->screen(indexes[0]) = Screen();
else
model()->screen(indexes[0]).setSwapped(false);
}
}
QStyleOptionViewItem ScreenSetupView::viewOptions() const
{
QStyleOptionViewItem option = QTableView::viewOptions();
option.showDecorationSelected = true;
option.decorationPosition = QStyleOptionViewItem::Top;
option.displayAlignment = Qt::AlignCenter;
option.textElideMode = Qt::ElideMiddle;
return option;
}

View File

@@ -1,56 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SCREENSETUPVIEW__H)
#define SCREENSETUPVIEW__H
#include <QTableView>
#include <QFlags>
#include "Screen.h"
class QWidget;
class QMouseEvent;
class QResizeEvent;
class QDragEnterEvent;
class ScreenSetupModel;
class ScreenSetupView : public QTableView
{
Q_OBJECT
public:
ScreenSetupView(QWidget* parent);
public:
void setModel(ScreenSetupModel* model);
ScreenSetupModel* model() const;
protected:
void mouseDoubleClickEvent(QMouseEvent*);
void setTableSize();
void resizeEvent(QResizeEvent*);
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void startDrag(Qt::DropActions supportedActions);
QStyleOptionViewItem viewOptions() const;
void scrollTo(const QModelIndex&, ScrollHint) {}
};
#endif

View File

@@ -1,264 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ServerConfig.h"
#include "Hotkey.h"
#include <QtCore>
static const struct
{
int x;
int y;
const char* name;
} neighbourDirs[] =
{
{ 0, -1, "up" },
{ 1, 0, "right" },
{ 0, 1, "down" },
{ -1, 0, "left" },
};
ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows) :
m_pSettings(settings),
m_Screens(),
m_NumColumns(numColumns),
m_NumRows(numRows)
{
Q_ASSERT(m_pSettings);
loadSettings();
}
ServerConfig::~ServerConfig()
{
saveSettings();
}
bool ServerConfig::save(const QString& fileName) const
{
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return false;
save(file);
file.close();
return true;
}
void ServerConfig::save(QFile& file) const
{
QTextStream outStream(&file);
outStream << *this;
}
void ServerConfig::init()
{
switchCorners().clear();
screens().clear();
// m_NumSwitchCorners is used as a fixed size array. See Screen::init()
for (int i = 0; i < NumSwitchCorners; i++)
switchCorners() << false;
// There must always be screen objects for each cell in the screens QList. Unused screens
// are identified by having an empty name.
for (int i = 0; i < numColumns() * numRows(); i++)
addScreen(Screen());
}
void ServerConfig::saveSettings()
{
settings().beginGroup("internalConfig");
settings().remove("");
settings().setValue("numColumns", numColumns());
settings().setValue("numRows", numRows());
settings().setValue("hasHeartbeat", hasHeartbeat());
settings().setValue("heartbeat", heartbeat());
settings().setValue("relativeMouseMoves", relativeMouseMoves());
settings().setValue("screenSaverSync", screenSaverSync());
settings().setValue("win32KeepForeground", win32KeepForeground());
settings().setValue("hasSwitchDelay", hasSwitchDelay());
settings().setValue("switchDelay", switchDelay());
settings().setValue("hasSwitchDoubleTap", hasSwitchDoubleTap());
settings().setValue("switchDoubleTap", switchDoubleTap());
settings().setValue("switchCornerSize", switchCornerSize());
writeSettings(settings(), switchCorners(), "switchCorner");
settings().beginWriteArray("screens");
for (int i = 0; i < screens().size(); i++)
{
settings().setArrayIndex(i);
screens()[i].saveSettings(settings());
}
settings().endArray();
settings().beginWriteArray("hotkeys");
for (int i = 0; i < hotkeys().size(); i++)
{
settings().setArrayIndex(i);
hotkeys()[i].saveSettings(settings());
}
settings().endArray();
settings().endGroup();
}
void ServerConfig::loadSettings()
{
settings().beginGroup("internalConfig");
setNumColumns(settings().value("numColumns", 5).toInt());
setNumRows(settings().value("numRows", 3).toInt());
// we need to know the number of columns and rows before we can set up ourselves
init();
haveHeartbeat(settings().value("hasHeartbeat", false).toBool());
setHeartbeat(settings().value("heartbeat", 5000).toInt());
setRelativeMouseMoves(settings().value("relativeMouseMoves", false).toBool());
setScreenSaverSync(settings().value("screenSaverSync", true).toBool());
setWin32KeepForeground(settings().value("win32KeepForeground", false).toBool());
haveSwitchDelay(settings().value("hasSwitchDelay", false).toBool());
setSwitchDelay(settings().value("switchDelay", 250).toInt());
haveSwitchDoubleTap(settings().value("hasSwitchDoubleTap", false).toBool());
setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt());
setSwitchCornerSize(settings().value("switchCornerSize").toInt());
readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners);
int numScreens = settings().beginReadArray("screens");
Q_ASSERT(numScreens <= screens().size());
for (int i = 0; i < numScreens; i++)
{
settings().setArrayIndex(i);
screens()[i].loadSettings(settings());
}
settings().endArray();
int numHotkeys = settings().beginReadArray("hotkeys");
for (int i = 0; i < numHotkeys; i++)
{
settings().setArrayIndex(i);
Hotkey h;
h.loadSettings(settings());
hotkeys().append(h);
}
settings().endArray();
settings().endGroup();
}
int ServerConfig::adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) const
{
if (screens()[idx].isNull())
return -1;
// if we're at the left or right end of the table, don't find results going further left or right
if ((deltaColumn > 0 && (idx+1) % numColumns() == 0)
|| (deltaColumn < 0 && idx % numColumns() == 0))
return -1;
int arrayPos = idx + deltaColumn + deltaRow * numColumns();
if (arrayPos >= screens().size() || arrayPos < 0)
return -1;
return arrayPos;
}
QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
{
outStream << "section: screens" << endl;
foreach (const Screen& s, config.screens())
if (!s.isNull())
s.writeScreensSection(outStream);
outStream << "end" << endl << endl;
outStream << "section: aliases" << endl;
foreach (const Screen& s, config.screens())
if (!s.isNull())
s.writeAliasesSection(outStream);
outStream << "end" << endl << endl;
outStream << "section: links" << endl;
for (int i = 0; i < config.screens().size(); i++)
if (!config.screens()[i].isNull())
{
outStream << "\t" << config.screens()[i].name() << ":" << endl;
for (unsigned int j = 0; j < sizeof(neighbourDirs) / sizeof(neighbourDirs[0]); j++)
{
int idx = config.adjacentScreenIndex(i, neighbourDirs[j].x, neighbourDirs[j].y);
if (idx != -1 && !config.screens()[idx].isNull())
outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << endl;
}
}
outStream << "end" << endl << endl;
outStream << "section: options" << endl;
if (config.hasHeartbeat())
outStream << "\t" << "heartbeat = " << config.heartbeat() << endl;
outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << endl;
outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << endl;
outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << endl;
if (config.hasSwitchDelay())
outStream << "\t" << "switchDelay = " << config.switchDelay() << endl;
if (config.hasSwitchDoubleTap())
outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << endl;
outStream << "\t" << "switchCorners = none ";
for (int i = 0; i < config.switchCorners().size(); i++)
if (config.switchCorners()[i])
outStream << "+" << config.switchCornerName(i) << " ";
outStream << endl;
outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << endl;
foreach(const Hotkey& hotkey, config.hotkeys())
outStream << hotkey;
outStream << "end" << endl << endl;
return outStream;
}
int ServerConfig::numScreens() const
{
int rval = 0;
foreach(const Screen& s, screens())
if (!s.isNull())
rval++;
return rval;
}

View File

@@ -1,113 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SERVERCONFIG__H)
#define SERVERCONFIG__H
#include <QList>
#include "Screen.h"
#include "BaseConfig.h"
#include "Hotkey.h"
class QTextStream;
class QSettings;
class QString;
class QFile;
class ServerConfigDialog;
class ServerConfig : public BaseConfig
{
friend class ServerConfigDialog;
friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
public:
ServerConfig(QSettings* settings, int numColumns, int numRows);
~ServerConfig();
public:
const ScreenList& screens() const { return m_Screens; }
int numColumns() const { return m_NumColumns; }
int numRows() const { return m_NumRows; }
bool hasHeartbeat() const { return m_HasHeartbeat; }
int heartbeat() const { return m_Heartbeat; }
bool relativeMouseMoves() const { return m_RelativeMouseMoves; }
bool screenSaverSync() const { return m_ScreenSaverSync; }
bool win32KeepForeground() const { return m_Win32KeepForeground; }
bool hasSwitchDelay() const { return m_HasSwitchDelay; }
int switchDelay() const { return m_SwitchDelay; }
bool hasSwitchDoubleTap() const { return m_HasSwitchDoubleTap; }
int switchDoubleTap() const { return m_SwitchDoubleTap; }
bool switchCorner(int c) const { return m_SwitchCorners[c]; }
int switchCornerSize() const { return m_SwitchCornerSize; }
const QList<bool>& switchCorners() const { return m_SwitchCorners; }
const HotkeyList& hotkeys() const { return m_Hotkeys; }
void saveSettings();
void loadSettings();
bool save(const QString& fileName) const;
void save(QFile& file) const;
int numScreens() const;
protected:
QSettings& settings() { return *m_pSettings; }
ScreenList& screens() { return m_Screens; }
void setScreens(const ScreenList& screens) { m_Screens = screens; }
void addScreen(const Screen& screen) { m_Screens.append(screen); }
void setNumColumns(int n) { m_NumColumns = n; }
void setNumRows(int n) { m_NumRows = n; }
void haveHeartbeat(bool on) { m_HasHeartbeat = on; }
void setHeartbeat(int val) { m_Heartbeat = val; }
void setRelativeMouseMoves(bool on) { m_RelativeMouseMoves = on; }
void setScreenSaverSync(bool on) { m_ScreenSaverSync = on; }
void setWin32KeepForeground(bool on) { m_Win32KeepForeground = on; }
void haveSwitchDelay(bool on) { m_HasSwitchDelay = on; }
void setSwitchDelay(int val) { m_SwitchDelay = val; }
void haveSwitchDoubleTap(bool on) { m_HasSwitchDoubleTap = on; }
void setSwitchDoubleTap(int val) { m_SwitchDoubleTap = val; }
void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
QList<bool>& switchCorners() { return m_SwitchCorners; }
HotkeyList& hotkeys() { return m_Hotkeys; }
void init();
int adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) const;
private:
QSettings* m_pSettings;
ScreenList m_Screens;
int m_NumColumns;
int m_NumRows;
bool m_HasHeartbeat;
int m_Heartbeat;
bool m_RelativeMouseMoves;
bool m_ScreenSaverSync;
bool m_Win32KeepForeground;
bool m_HasSwitchDelay;
int m_SwitchDelay;
bool m_HasSwitchDoubleTap;
int m_SwitchDoubleTap;
int m_SwitchCornerSize;
QList<bool> m_SwitchCorners;
HotkeyList m_Hotkeys;
};
QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
#endif

View File

@@ -1,196 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "ServerConfigDialog.h"
#include "ServerConfig.h"
#include "HotkeyDialog.h"
#include "ActionDialog.h"
#include <QtCore>
#include <QtGui>
ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, const QString& defaultScreenName) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::ServerConfigDialogBase(),
m_OrigServerConfig(config),
m_ServerConfig(config),
m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(), serverConfig().numRows())
{
setupUi(this);
m_pCheckBoxHeartbeat->setChecked(serverConfig().hasHeartbeat());
m_pSpinBoxHeartbeat->setValue(serverConfig().heartbeat());
m_pCheckBoxRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
m_pCheckBoxScreenSaverSync->setChecked(serverConfig().screenSaverSync());
m_pCheckBoxWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
m_pCheckBoxSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
m_pSpinBoxSwitchDelay->setValue(serverConfig().switchDelay());
m_pCheckBoxSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
m_pSpinBoxSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
m_pCheckBoxCornerTopLeft->setChecked(serverConfig().switchCorner(BaseConfig::TopLeft));
m_pCheckBoxCornerTopRight->setChecked(serverConfig().switchCorner(BaseConfig::TopRight));
m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::BottomLeft));
m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight));
m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
foreach(const Hotkey& hotkey, serverConfig().hotkeys())
m_pListHotkeys->addItem(hotkey.text());
m_pScreenSetupView->setModel(&m_ScreenSetupModel);
if (serverConfig().numScreens() == 0)
model().screen(serverConfig().numColumns() / 2, serverConfig().numRows() / 2) = Screen(defaultScreenName);
}
void ServerConfigDialog::accept()
{
serverConfig().haveHeartbeat(m_pCheckBoxHeartbeat->isChecked());
serverConfig().setHeartbeat(m_pSpinBoxHeartbeat->value());
serverConfig().setRelativeMouseMoves(m_pCheckBoxRelativeMouseMoves->isChecked());
serverConfig().setScreenSaverSync(m_pCheckBoxScreenSaverSync->isChecked());
serverConfig().setWin32KeepForeground(m_pCheckBoxWin32KeepForeground->isChecked());
serverConfig().haveSwitchDelay(m_pCheckBoxSwitchDelay->isChecked());
serverConfig().setSwitchDelay(m_pSpinBoxSwitchDelay->value());
serverConfig().haveSwitchDoubleTap(m_pCheckBoxSwitchDoubleTap->isChecked());
serverConfig().setSwitchDoubleTap(m_pSpinBoxSwitchDoubleTap->value());
serverConfig().setSwitchCorner(BaseConfig::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
serverConfig().setSwitchCorner(BaseConfig::TopRight, m_pCheckBoxCornerTopRight->isChecked());
serverConfig().setSwitchCorner(BaseConfig::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
// now that the dialog has been accepted, copy the new server config to the original one,
// which is a reference to the one in MainWindow.
setOrigServerConfig(serverConfig());
QDialog::accept();
}
void ServerConfigDialog::on_m_pButtonNewHotkey_clicked()
{
Hotkey hotkey;
HotkeyDialog dlg(this, hotkey);
if (dlg.exec() == QDialog::Accepted)
{
serverConfig().hotkeys().append(hotkey);
m_pListHotkeys->addItem(hotkey.text());
}
}
void ServerConfigDialog::on_m_pButtonEditHotkey_clicked()
{
int idx = m_pListHotkeys->currentRow();
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
Hotkey& hotkey = serverConfig().hotkeys()[idx];
HotkeyDialog dlg(this, hotkey);
if (dlg.exec() == QDialog::Accepted)
m_pListHotkeys->currentItem()->setText(hotkey.text());
}
void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
{
int idx = m_pListHotkeys->currentRow();
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
serverConfig().hotkeys().removeAt(idx);
m_pListActions->clear();
delete m_pListHotkeys->item(idx);
}
void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged()
{
bool itemsSelected = !m_pListHotkeys->selectedItems().isEmpty();
m_pButtonEditHotkey->setEnabled(itemsSelected);
m_pButtonRemoveHotkey->setEnabled(itemsSelected);
m_pButtonNewAction->setEnabled(itemsSelected);
if (itemsSelected && serverConfig().hotkeys().size() > 0)
{
m_pListActions->clear();
int idx = m_pListHotkeys->row(m_pListHotkeys->selectedItems()[0]);
// There's a bug somewhere around here: We get idx == 1 right after we deleted the next to last item, so idx can
// only possibly be 0. GDB shows we got called indirectly from the delete line in
// on_m_pButtonRemoveHotkey_clicked() above, but the delete is of course necessary and seems correct.
// The while() is a generalized workaround for all that and shouldn't be required.
while (idx >= 0 && idx >= serverConfig().hotkeys().size())
idx--;
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
const Hotkey& hotkey = serverConfig().hotkeys()[idx];
foreach(const Action& action, hotkey.actions())
m_pListActions->addItem(action.text());
}
}
void ServerConfigDialog::on_m_pButtonNewAction_clicked()
{
int idx = m_pListHotkeys->currentRow();
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
Hotkey& hotkey = serverConfig().hotkeys()[idx];
Action action;
ActionDialog dlg(this, serverConfig(), hotkey, action);
if (dlg.exec() == QDialog::Accepted)
{
hotkey.actions().append(action);
m_pListActions->addItem(action.text());
}
}
void ServerConfigDialog::on_m_pButtonEditAction_clicked()
{
int idxHotkey = m_pListHotkeys->currentRow();
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
Hotkey& hotkey = serverConfig().hotkeys()[idxHotkey];
int idxAction = m_pListActions->currentRow();
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
Action& action = hotkey.actions()[idxAction];
ActionDialog dlg(this, serverConfig(), hotkey, action);
if (dlg.exec() == QDialog::Accepted)
m_pListActions->currentItem()->setText(action.text());
}
void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
{
int idxHotkey = m_pListHotkeys->currentRow();
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
Hotkey& hotkey = serverConfig().hotkeys()[idxHotkey];
int idxAction = m_pListActions->currentRow();
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
hotkey.actions().removeAt(idxAction);
delete m_pListActions->currentItem();
}
void ServerConfigDialog::on_m_pListActions_itemSelectionChanged()
{
m_pButtonEditAction->setEnabled(!m_pListActions->selectedItems().isEmpty());
m_pButtonRemoveAction->setEnabled(!m_pListActions->selectedItems().isEmpty());
}

View File

@@ -1,62 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SERVERCONFIGDIALOG__H)
#define SERVERCONFIGDIALOG__H
#include "ScreenSetupModel.h"
#include "ServerConfig.h"
#include "ui_ServerConfigDialogBase.h"
#include <QDialog>
class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase
{
Q_OBJECT
public:
ServerConfigDialog(QWidget* parent, ServerConfig& config, const QString& defaultScreenName);
public slots:
void accept();
protected slots:
void on_m_pButtonNewHotkey_clicked();
void on_m_pListHotkeys_itemSelectionChanged();
void on_m_pButtonEditHotkey_clicked();
void on_m_pButtonRemoveHotkey_clicked();
void on_m_pButtonNewAction_clicked();
void on_m_pListActions_itemSelectionChanged();
void on_m_pButtonEditAction_clicked();
void on_m_pButtonRemoveAction_clicked();
protected:
ServerConfig& serverConfig() { return m_ServerConfig; }
void setOrigServerConfig(const ServerConfig& s) { m_OrigServerConfig = s; }
ScreenSetupModel& model() { return m_ScreenSetupModel; }
private:
ServerConfig& m_OrigServerConfig;
ServerConfig m_ServerConfig;
ScreenSetupModel m_ScreenSetupModel;
};
#endif

View File

@@ -1,123 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "SettingsDialog.h"
#include <QtCore>
#include <QtGui>
#include "AppConfig.h"
SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::SettingsDialogBase(),
m_AppConfig(config)
{
setupUi(this);
m_pCheckBoxAutoConnect->setChecked(appConfig().autoConnect());
m_pLineEditSynergyc->setText(appConfig().synergyc());
m_pLineEditSynergys->setText(appConfig().synergys());
m_pLineEditScreenName->setText(appConfig().screenName());
m_pSpinBoxPort->setValue(appConfig().port());
m_pLineEditInterface->setText(appConfig().interface());
m_pComboLogLevel->setCurrentIndex(appConfig().logLevel());
m_pCheckBoxAutoDetectPaths->setChecked(appConfig().autoDetectPaths());
m_pCheckBoxLogToFile->setChecked(appConfig().logToFile());
m_pLineEditLogFilename->setText(appConfig().logFilename());
}
QString SettingsDialog::browseForSynergyc(QWidget* parent, const QString& programDir, const QString& synergycName)
{
return QFileDialog::getOpenFileName(parent, tr("Browse for synergyc executable"), programDir, synergycName);
}
QString SettingsDialog::browseForSynergys(QWidget* parent, const QString& programDir, const QString& synergysName)
{
return QFileDialog::getOpenFileName(parent, tr("Browse for synergys executable"), programDir, synergysName);
}
bool SettingsDialog::on_m_pButtonBrowseSynergys_clicked()
{
QString fileName = browseForSynergys(this, appConfig().synergyProgramDir(), appConfig().synergysName());
if (!fileName.isEmpty())
{
m_pLineEditSynergys->setText(fileName);
return true;
}
return false;
}
bool SettingsDialog::on_m_pButtonBrowseSynergyc_clicked()
{
QString fileName = browseForSynergyc(this, appConfig().synergyProgramDir(), appConfig().synergycName());
if (!fileName.isEmpty())
{
m_pLineEditSynergyc->setText(fileName);
return true;
}
return false;
}
void SettingsDialog::on_m_pCheckBoxAutoDetectPaths_stateChanged(int i)
{
bool unchecked = i == 0;
m_pLineEditSynergyc->setEnabled(unchecked);
m_pLineEditSynergys->setEnabled(unchecked);
m_pButtonBrowseSynergyc->setEnabled(unchecked);
m_pButtonBrowseSynergys->setEnabled(unchecked);
}
void SettingsDialog::accept()
{
appConfig().setAutoConnect(m_pCheckBoxAutoConnect->isChecked());
appConfig().setSynergyc(m_pLineEditSynergyc->text());
appConfig().setSynergys(m_pLineEditSynergys->text());
appConfig().setScreenName(m_pLineEditScreenName->text());
appConfig().setPort(m_pSpinBoxPort->value());
appConfig().setInterface(m_pLineEditInterface->text());
appConfig().setLogLevel(m_pComboLogLevel->currentIndex());
appConfig().setAutoDetectPaths(m_pCheckBoxAutoDetectPaths->isChecked());
appConfig().setLogToFile(m_pCheckBoxLogToFile->isChecked());
appConfig().setLogFilename(m_pLineEditLogFilename->text());
QDialog::accept();
}
void SettingsDialog::on_m_pCheckBoxLogToFile_stateChanged(int i)
{
bool checked = i == 2;
m_pLineEditLogFilename->setEnabled(checked);
m_pButtonBrowseLog->setEnabled(checked);
}
void SettingsDialog::on_m_pButtonBrowseLog_clicked()
{
QString fileName = QFileDialog::getSaveFileName(
this, tr("Save log file to..."),
m_pLineEditLogFilename->text(),
"Logs (*.log *.txt)");
if (!fileName.isEmpty())
{
m_pLineEditLogFilename->setText(fileName);
}
}

View File

@@ -1,51 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(SETTINGSDIALOG_H)
#define SETTINGSDIALOG_H
#include <QDialog>
#include "ui_SettingsDialogBase.h"
class AppConfig;
class SettingsDialog : public QDialog, public Ui::SettingsDialogBase
{
Q_OBJECT
public:
SettingsDialog(QWidget* parent, AppConfig& config);
static QString browseForSynergyc(QWidget* parent, const QString& programDir, const QString& synergycName);
static QString browseForSynergys(QWidget* parent, const QString& programDir, const QString& synergysName);
protected:
void accept();
AppConfig& appConfig() { return m_AppConfig; }
private:
AppConfig& m_AppConfig;
private slots:
void on_m_pCheckBoxLogToFile_stateChanged(int );
bool on_m_pButtonBrowseSynergys_clicked();
bool on_m_pButtonBrowseSynergyc_clicked();
void on_m_pCheckBoxAutoDetectPaths_stateChanged(int i);
void on_m_pButtonBrowseLog_clicked();
};
#endif

View File

@@ -1,42 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "TrashScreenWidget.h"
#include "ScreenSetupModel.h"
#include <QtCore>
#include <QtGui>
void TrashScreenWidget::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
{
event->setDropAction(Qt::MoveAction);
event->accept();
}
else
event->ignore();
}
void TrashScreenWidget::dropEvent(QDropEvent* event)
{
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
event->acceptProposedAction();
else
event->ignore();
}

View File

@@ -1,41 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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(TRASHSCREENWIDGET__H)
#define TRASHSCREENWIDGET__H
#include <QLabel>
class QWidget;
class QDragEnterEvent;
class QDropEvent;
class TrashScreenWidget : public QLabel
{
Q_OBJECT
public:
TrashScreenWidget(QWidget* parent) : QLabel(parent) {}
public:
void dragEnterEvent(QDragEnterEvent* event);
void dropEvent(QDropEvent* event);
};
#endif

View File

@@ -1,147 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#include "WindowsServices.h"
#include "AppConfig.h"
#include "MainWindow.h"
#include "LogDialog.h"
#include <QWidget>
#include <QProcess>
#include <QMessageBox>
#include <QPushButton>
WindowsServices::WindowsServices(QWidget* parent, AppConfig& appConfig) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::WindowsServicesBase(),
m_appConfig(appConfig),
m_log(new LogDialog(this, process()))
{
setupUi(this);
}
void WindowsServices::runProc(const QString& app, const QStringList& args, QPushButton* button)
{
// disable until we know we've finished
button->setEnabled(false);
// clear contents so user doesn't get confused by previous messages
m_log->clear();
// deleted at end of function
QProcess proc(this);
m_process = &proc;
// send output to log window
connect(m_process, SIGNAL(readyReadStandardOutput()), m_log, SLOT(readSynergyOutput()));
connect(m_process, SIGNAL(readyReadStandardError()), m_log, SLOT(readSynergyOutput()));
m_process->start(app, args);
m_log->show();
// service management should be instant
m_process->waitForFinished();
if (m_process->exitCode() == 0)
{
QMessageBox::information(m_log, "Service manager", "Completed successfully.");
}
else
{
QMessageBox::critical(
m_log, "Service manager error",
QString("Unable to install or uninstall service. Error code: " +
QString::number(m_process->exitCode())));
}
disconnect(m_process, SIGNAL(readyReadStandardOutput()), m_log, SLOT(readSynergyOutput()));
disconnect(m_process, SIGNAL(readyReadStandardError()), m_log, SLOT(readSynergyOutput()));
button->setEnabled(true);
}
void WindowsServices::on_m_pInstallServer_clicked()
{
QString app = mainWindow()->appPath(
appConfig().synergysName(), appConfig().synergys());
QStringList args;
args <<
"--service" << "install" <<
"--relaunch" <<
"--debug" << appConfig().logLevelText() <<
"-c" << mainWindow()->configFilename() <<
"--address" << mainWindow()->address();
if (appConfig().logToFile())
{
appConfig().persistLogDir();
args << "--log" << appConfig().logFilename();
}
runProc(app, args, m_pInstallServer);
}
void WindowsServices::on_m_pUninstallServer_clicked()
{
QString app = mainWindow()->appPath(
appConfig().synergysName(), appConfig().synergys());
QStringList args;
args << "--service" << "uninstall";
runProc(app, args, m_pInstallServer);
}
void WindowsServices::on_m_pInstallClient_clicked()
{
if (mainWindow()->hostname().isEmpty())
{
QMessageBox::critical(
this, "Service manager error", "Hostname was not specified on main screen.");
return;
}
QString app = mainWindow()->appPath(
appConfig().synergycName(), appConfig().synergyc());
QStringList args;
args <<
"--service" << "install" <<
"--relaunch" <<
"--debug" << appConfig().logLevelText();
if (appConfig().logToFile())
{
appConfig().persistLogDir();
args << "--log" << appConfig().logFilename();
}
// hostname must come last to be a valid arg
args << mainWindow()->hostname();
runProc(app, args, m_pInstallServer);
}
void WindowsServices::on_m_pUninstallClient_clicked()
{
QString app = mainWindow()->appPath(
appConfig().synergycName(), appConfig().synergyc());
QStringList args;
args << "--service" << "uninstall";
runProc(app, args, m_pInstallServer);
}

View File

@@ -1,58 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* 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 COPYING 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/>.
*/
#ifndef WINDOWSSERVICES_H
#define WINDOWSSERVICES_H
#include "ui_WindowsServicesBase.h"
class QWidget;
class QProcess;
class QPushButton;
class QProcess;
class AppConfig;
class MainWindow;
class LogDialog;
class WindowsServices : public QDialog, public Ui::WindowsServicesBase
{
Q_OBJECT
public:
WindowsServices(QWidget* parent, AppConfig& appConfig);
protected:
AppConfig &appConfig() const { return m_appConfig; }
MainWindow* mainWindow() const { return (MainWindow*)parent(); }
QProcess*& process() { return m_process; }
void runProc(const QString& app, const QStringList& args, QPushButton* button);
private:
QString m_app;
AppConfig &m_appConfig;
QProcess* m_process;
LogDialog* m_log;
private slots:
void on_m_pUninstallClient_clicked();
void on_m_pInstallClient_clicked();
void on_m_pUninstallServer_clicked();
void on_m_pInstallServer_clicked();
};
#endif // WINDOWSSERVICES_H

Some files were not shown because too many files have changed in this diff Show More