Also some bugs are fixed. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@468 3789f03b-4d11-0410-bbf8-ca57d06f2519tags/v0.0.90
@@ -122,7 +122,7 @@ namespace network { | |||
if (newTimeout && (!*timeout || newTimeout < *timeout)) | |||
*timeout = newTimeout; | |||
} | |||
virtual bool getDisable() {return true;}; | |||
virtual bool getDisable() {return false;}; | |||
}; | |||
} |
@@ -87,6 +87,7 @@ namespace rfb { | |||
for (InputList->iBegin(); !InputList->iEnd(); InputList->iNext()) { | |||
iAdd(InputList); | |||
} | |||
setDisable(InputList->getDisable()); | |||
} | |||
void iAdd (ListConnInfo* InputList) { |
@@ -689,6 +689,7 @@ void VNCSConnectionST::setStatus(int status) | |||
accessRights = accessRights & !(AccessPtrEvents | AccessKeyEvents | AccessView); | |||
break; | |||
} | |||
framebufferUpdateRequest(server->pb->getRect(), false); | |||
} | |||
int VNCSConnectionST::getStatus() | |||
{ |
@@ -25,8 +25,7 @@ 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()); | |||
SendCommand(4, -1); | |||
} | |||
bool ControlPanel::onCommand(int cmd) | |||
@@ -79,6 +78,7 @@ void ControlPanel::UpdateListView(rfb::ListConnInfo* LCInfo) | |||
{ | |||
getSelConnInfo(); | |||
DeleteAllLVItem(IDC_LIST_CONNECTIONS, handle); | |||
setItemChecked(IDC_DISABLE_CLIENTS, LCInfo->getDisable()); | |||
if(LCInfo->Empty()) | |||
return; | |||
@@ -146,6 +146,7 @@ void ControlPanel::SendCommand(DWORD command, int data) | |||
if (data != -1) { | |||
ListConnStatus.Copy(&ListSelConn); | |||
ListConnStatus.setAllStatus(data); | |||
ListConnStatus.setDisable(isItemChecked(IDC_DISABLE_CLIENTS)); | |||
copyData.cbData = (DWORD)&ListConnStatus; | |||
} else { | |||
ListConnStatus.Clear(); |
@@ -99,6 +99,9 @@ public: | |||
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 @@ public: | |||
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 @@ public: | |||
break; | |||
case 3: | |||
thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData); | |||
case 4: | |||
thread.server.getClientsInfo(&LCInfo); | |||
CPanel->UpdateListView(&LCInfo); | |||
break; |
@@ -39,13 +39,14 @@ | |||
#define ID_DISCONNECT 40004 | |||
#define ID_CONNECT 40005 | |||
#define ID_OPTIONS 40006 | |||
#define ID_DISABLE_NEW_CLIENTS 40007 | |||
// Next default values for new objects | |||
// | |||
#ifdef APSTUDIO_INVOKED | |||
#ifndef APSTUDIO_READONLY_SYMBOLS | |||
#define _APS_NEXT_RESOURCE_VALUE 111 | |||
#define _APS_NEXT_COMMAND_VALUE 40007 | |||
#define _APS_NEXT_COMMAND_VALUE 40008 | |||
#define _APS_NEXT_CONTROL_VALUE 1024 | |||
#define _APS_NEXT_SYMED_VALUE 101 | |||
#endif |
@@ -295,13 +295,14 @@ IDR_TRAY MENU DISCARDABLE | |||
BEGIN | |||
POPUP "Tray Menu" | |||
BEGIN | |||
MENUITEM "&Control Panel", ID_CONTR0L_PANEL | |||
MENUITEM "Control &Panel", ID_CONTR0L_PANEL | |||
MENUITEM SEPARATOR | |||
MENUITEM "&Options...", ID_OPTIONS | |||
MENUITEM "Add &New Client", ID_CONNECT | |||
MENUITEM "&Disconnect Clients", ID_DISCONNECT | |||
MENUITEM "Disable New &Clients", ID_DISABLE_NEW_CLIENTS | |||
MENUITEM SEPARATOR | |||
MENUITEM "&Close VNC Server", ID_CLOSE | |||
MENUITEM "Close &VNC Server", ID_CLOSE | |||
MENUITEM "&About...", ID_ABOUT | |||
END | |||
END |