In Tray menu the item " Disable New Clients " added.
Also some bugs are fixed.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@468 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx
index d3e13da..229f1ce 100644
--- a/winvnc/STrayIcon.cxx
+++ b/winvnc/STrayIcon.cxx
@@ -99,6 +99,9 @@
EnableMenuItem(trayMenu, ID_CONNECT, (!userKnown ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND);
EnableMenuItem(trayMenu, ID_CLOSE, (isServiceProcess() ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND);
+ thread.server.getClientsInfo(&LCInfo);
+ CheckMenuItem(trayMenu, ID_DISABLE_NEW_CLIENTS, (LCInfo.getDisable() ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND);
+
// SetForegroundWindow is required, otherwise Windows ignores the
// TrackPopupMenu because the window isn't the foreground one, on
// some older Windows versions...
@@ -108,19 +111,26 @@
POINT pos;
GetCursorPos(&pos);
TrackPopupMenu(trayMenu, 0, pos.x, pos.y, 0, getHandle(), 0);
+
break;
- }
- return 0;
+ }
+ return 0;
}
// Handle tray icon menu commands
case WM_COMMAND:
switch (LOWORD(wParam)) {
- case ID_CONTR0L_PANEL:
- {
- CPanel->showDialog();
- }
- break;
+ case ID_CONTR0L_PANEL:
+ CPanel->showDialog();
+ break;
+ case ID_DISABLE_NEW_CLIENTS:
+ {
+ thread.server.getClientsInfo(&LCInfo);
+ LCInfo.setDisable(!LCInfo.getDisable());
+ thread.server.setClientsStatus(&LCInfo);
+ CPanel->UpdateListView(&LCInfo);
+ }
+ break;
case ID_OPTIONS:
{
CurrentUserToken token;
@@ -170,6 +180,7 @@
break;
case 3:
thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData);
+ case 4:
thread.server.getClientsInfo(&LCInfo);
CPanel->UpdateListView(&LCInfo);
break;