summaryrefslogtreecommitdiffstats
path: root/winvnc
diff options
context:
space:
mode:
authorOleg Sheikin <olg@tightvnc.com>2005-12-22 20:57:58 +0000
committerOleg Sheikin <olg@tightvnc.com>2005-12-22 20:57:58 +0000
commit5c642e9b66c4b2479bca3eeb3c6ca5b0ff1f240d (patch)
tree7589986c1dfaf82a3c2d13460b25ef328882fe00 /winvnc
parenta10c27623444fd793a4340008f8e7b5365268560 (diff)
downloadtigervnc-5c642e9b66c4b2479bca3eeb3c6ca5b0ff1f240d.tar.gz
tigervnc-5c642e9b66c4b2479bca3eeb3c6ca5b0ff1f240d.zip
The code which realizes full functionality Control Panel,
in a kind existing now, was added. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@467 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'winvnc')
-rw-r--r--winvnc/ControlPanel.cxx23
-rw-r--r--winvnc/STrayIcon.cxx13
-rw-r--r--winvnc/STrayIcon.h4
-rw-r--r--winvnc/VNCServerWin32.cxx3
-rw-r--r--winvnc/connecte.icobin0 -> 766 bytes
-rw-r--r--winvnc/icon_dis.icobin0 -> 766 bytes
-rw-r--r--winvnc/resource.h4
-rw-r--r--winvnc/winvnc.dsp8
-rw-r--r--winvnc/winvnc.rc10
9 files changed, 47 insertions, 18 deletions
diff --git a/winvnc/ControlPanel.cxx b/winvnc/ControlPanel.cxx
index 1f693063..e668d91a 100644
--- a/winvnc/ControlPanel.cxx
+++ b/winvnc/ControlPanel.cxx
@@ -8,7 +8,6 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-//using namespace rfb_win32;
using namespace winvnc;
bool ControlPanel::showDialog()
@@ -26,6 +25,8 @@ void ControlPanel::initDialog()
InitLVColumns(IDC_LIST_CONNECTIONS, handle, 120, 3, ColumnsStrings,
LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM,
LVS_EX_FULLROWSELECT, LVCFMT_LEFT);
+ SendCommand(3, -1);
+ setItemChecked(IDC_DISABLE_CLIENTS, ListConnStatus.getDisable());
}
bool ControlPanel::onCommand(int cmd)
@@ -42,11 +43,6 @@ bool ControlPanel::onCommand(int cmd)
SendCommand(2, -1);
return false;
}
- case IDC_DISABLE_CLIENTS:
- {
-
- return false;
- }
case IDC_KILL_SEL_CLIENT:
{
SendCommand(3, 3);
@@ -68,6 +64,12 @@ bool ControlPanel::onCommand(int cmd)
EndDialog(handle, 0);
return false;
}
+ case IDC_DISABLE_CLIENTS:
+ {
+ ListConnStatus.setDisable(isItemChecked(IDC_DISABLE_CLIENTS));
+ SendCommand(3, -1);
+ return false;
+ }
}
return false;
@@ -109,7 +111,6 @@ BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
stop_updating = false;
SendCommand(3, 2);
}
- initDialog();
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -141,15 +142,15 @@ void ControlPanel::SendCommand(DWORD command, int data)
COPYDATASTRUCT copyData;
copyData.dwData = command;
copyData.lpData = 0;
+ getSelConnInfo();
if (data != -1) {
- getSelConnInfo();
ListConnStatus.Copy(&ListSelConn);
- for (ListConnStatus.iBegin(); !ListConnStatus.iEnd(); ListConnStatus.iNext())
- ListConnStatus.iSetStatus(data);
+ ListConnStatus.setAllStatus(data);
copyData.cbData = (DWORD)&ListConnStatus;
} else {
- copyData.cbData = 0;
+ ListConnStatus.Clear();
}
+ copyData.cbData = (DWORD)&ListConnStatus;
SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)&copyData);
}
diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx
index 59220265..d3e13dac 100644
--- a/winvnc/STrayIcon.cxx
+++ b/winvnc/STrayIcon.cxx
@@ -186,10 +186,13 @@ public:
SendMessage(getHandle(), WM_CLOSE, 0, 0);
return 0;
}
- setIcon(thread.server.isServerInUse() ? thread.activeIcon : thread.inactiveIcon);
- CPanel->UpdateListView(&LCInfo);
thread.server.getClientsInfo(&LCInfo);
+ CPanel->UpdateListView(&LCInfo);
+
+ setIcon(thread.server.isServerInUse() ?
+ (!LCInfo.getDisable() ? thread.activeIcon : thread.dis_activeIcon) :
+ (!LCInfo.getDisable() ? thread.inactiveIcon : thread.dis_inactiveIcon));
return 0;
@@ -215,8 +218,10 @@ protected:
};
-STrayIconThread::STrayIconThread(VNCServerWin32& sm, UINT inactiveIcon_, UINT activeIcon_, UINT menu_)
-: server(sm), inactiveIcon(inactiveIcon_), activeIcon(activeIcon_), menu(menu_),
+STrayIconThread::STrayIconThread(VNCServerWin32& sm, UINT inactiveIcon_, UINT activeIcon_,
+ UINT dis_inactiveIcon_, UINT dis_activeIcon_, UINT menu_)
+: server(sm), inactiveIcon(inactiveIcon_), activeIcon(activeIcon_),
+ dis_inactiveIcon(dis_inactiveIcon_), dis_activeIcon(dis_activeIcon_),menu(menu_),
windowHandle(0), runTrayIcon(true) {
start();
}
diff --git a/winvnc/STrayIcon.h b/winvnc/STrayIcon.h
index cfd5ec01..ef32eba6 100644
--- a/winvnc/STrayIcon.h
+++ b/winvnc/STrayIcon.h
@@ -29,7 +29,7 @@ namespace winvnc {
class STrayIconThread : rfb::Thread {
public:
STrayIconThread(VNCServerWin32& sm, UINT inactiveIcon,
- UINT activeIcon, UINT menu);
+ UINT activeIcon, UINT dis_inactiveIcon, UINT dis_activeIcon, UINT menu);
virtual ~STrayIconThread() {
runTrayIcon = false;
PostThreadMessage(getThreadId(), WM_QUIT, 0, 0);
@@ -49,6 +49,8 @@ namespace winvnc {
VNCServerWin32& server;
UINT inactiveIcon;
UINT activeIcon;
+ UINT dis_inactiveIcon;
+ UINT dis_activeIcon;
UINT menu;
bool runTrayIcon;
};
diff --git a/winvnc/VNCServerWin32.cxx b/winvnc/VNCServerWin32.cxx
index 30e9a72f..67b3ec51 100644
--- a/winvnc/VNCServerWin32.cxx
+++ b/winvnc/VNCServerWin32.cxx
@@ -155,7 +155,8 @@ int VNCServerWin32::run() {
config.setNotifyThread(Thread::self(), VNCM_REG_CHANGED);
// - Create the tray icon if possible
- STrayIconThread trayIcon(*this, IDI_ICON, IDI_CONNECTED, IDR_TRAY);
+ STrayIconThread trayIcon(*this, IDI_ICON, IDI_CONNECTED, IDI_ICON_DISABLE,
+ IDI_CONNECTED_DISABLE, IDR_TRAY);
DWORD result = 0;
try {
diff --git a/winvnc/connecte.ico b/winvnc/connecte.ico
new file mode 100644
index 00000000..8f814b33
--- /dev/null
+++ b/winvnc/connecte.ico
Binary files differ
diff --git a/winvnc/icon_dis.ico b/winvnc/icon_dis.ico
new file mode 100644
index 00000000..0a6ea15c
--- /dev/null
+++ b/winvnc/icon_dis.ico
Binary files differ
diff --git a/winvnc/resource.h b/winvnc/resource.h
index b9c0e04b..b01ed96a 100644
--- a/winvnc/resource.h
+++ b/winvnc/resource.h
@@ -12,6 +12,8 @@
#define IDD_CONTROL_PANEL 106
#define IDD_QUERY_CONNECT 107
#define IDD_ADD_NEW_CLIENT 108
+#define IDI_ICON_DISABLE 109
+#define IDI_CONNECTED_DISABLE 110
#define IDC_DESCRIPTION 1000
#define IDC_BUILDTIME 1001
#define IDC_VERSION 1002
@@ -42,7 +44,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 109
+#define _APS_NEXT_RESOURCE_VALUE 111
#define _APS_NEXT_COMMAND_VALUE 40007
#define _APS_NEXT_CONTROL_VALUE 1024
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/winvnc/winvnc.dsp b/winvnc/winvnc.dsp
index 91118514..a35a5e09 100644
--- a/winvnc/winvnc.dsp
+++ b/winvnc/winvnc.dsp
@@ -205,10 +205,18 @@ SOURCE=.\VNCServerWin32.h
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
+SOURCE=.\connecte.ico
+# End Source File
+# Begin Source File
+
SOURCE=.\connected.ico
# End Source File
# Begin Source File
+SOURCE=.\icon_dis.ico
+# End Source File
+# Begin Source File
+
SOURCE=.\java\logo150x150.gif
# End Source File
# Begin Source File
diff --git a/winvnc/winvnc.rc b/winvnc/winvnc.rc
index 61cf8a6a..ab922189 100644
--- a/winvnc/winvnc.rc
+++ b/winvnc/winvnc.rc
@@ -82,6 +82,15 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON_DISABLE ICON DISCARDABLE "icon_dis.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
@@ -275,6 +284,7 @@ END
// remains consistent on all systems.
IDI_ICON ICON DISCARDABLE "winvnc.ico"
IDI_CONNECTED ICON DISCARDABLE "connected.ico"
+IDI_CONNECTED_DISABLE ICON DISCARDABLE "connecte.ico"
/////////////////////////////////////////////////////////////////////////////
//