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
if (newTimeout && (!*timeout || newTimeout < *timeout)) | if (newTimeout && (!*timeout || newTimeout < *timeout)) | ||||
*timeout = newTimeout; | *timeout = newTimeout; | ||||
} | } | ||||
virtual bool getDisable() {return true;}; | |||||
virtual bool getDisable() {return false;}; | |||||
}; | }; | ||||
} | } |
for (InputList->iBegin(); !InputList->iEnd(); InputList->iNext()) { | for (InputList->iBegin(); !InputList->iEnd(); InputList->iNext()) { | ||||
iAdd(InputList); | iAdd(InputList); | ||||
} | } | ||||
setDisable(InputList->getDisable()); | |||||
} | } | ||||
void iAdd (ListConnInfo* InputList) { | void iAdd (ListConnInfo* InputList) { |
accessRights = accessRights & !(AccessPtrEvents | AccessKeyEvents | AccessView); | accessRights = accessRights & !(AccessPtrEvents | AccessKeyEvents | AccessView); | ||||
break; | break; | ||||
} | } | ||||
framebufferUpdateRequest(server->pb->getRect(), false); | |||||
} | } | ||||
int VNCSConnectionST::getStatus() | int VNCSConnectionST::getStatus() | ||||
{ | { |
InitLVColumns(IDC_LIST_CONNECTIONS, handle, 120, 3, ColumnsStrings, | InitLVColumns(IDC_LIST_CONNECTIONS, handle, 120, 3, ColumnsStrings, | ||||
LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM, | LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM, | ||||
LVS_EX_FULLROWSELECT, LVCFMT_LEFT); | LVS_EX_FULLROWSELECT, LVCFMT_LEFT); | ||||
SendCommand(3, -1); | |||||
setItemChecked(IDC_DISABLE_CLIENTS, ListConnStatus.getDisable()); | |||||
SendCommand(4, -1); | |||||
} | } | ||||
bool ControlPanel::onCommand(int cmd) | bool ControlPanel::onCommand(int cmd) | ||||
{ | { | ||||
getSelConnInfo(); | getSelConnInfo(); | ||||
DeleteAllLVItem(IDC_LIST_CONNECTIONS, handle); | DeleteAllLVItem(IDC_LIST_CONNECTIONS, handle); | ||||
setItemChecked(IDC_DISABLE_CLIENTS, LCInfo->getDisable()); | |||||
if(LCInfo->Empty()) | if(LCInfo->Empty()) | ||||
return; | return; | ||||
if (data != -1) { | if (data != -1) { | ||||
ListConnStatus.Copy(&ListSelConn); | ListConnStatus.Copy(&ListSelConn); | ||||
ListConnStatus.setAllStatus(data); | ListConnStatus.setAllStatus(data); | ||||
ListConnStatus.setDisable(isItemChecked(IDC_DISABLE_CLIENTS)); | |||||
copyData.cbData = (DWORD)&ListConnStatus; | copyData.cbData = (DWORD)&ListConnStatus; | ||||
} else { | } else { | ||||
ListConnStatus.Clear(); | ListConnStatus.Clear(); |
EnableMenuItem(trayMenu, ID_CONNECT, (!userKnown ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); | EnableMenuItem(trayMenu, ID_CONNECT, (!userKnown ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); | ||||
EnableMenuItem(trayMenu, ID_CLOSE, (isServiceProcess() ? 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 | // SetForegroundWindow is required, otherwise Windows ignores the | ||||
// TrackPopupMenu because the window isn't the foreground one, on | // TrackPopupMenu because the window isn't the foreground one, on | ||||
// some older Windows versions... | // some older Windows versions... | ||||
POINT pos; | POINT pos; | ||||
GetCursorPos(&pos); | GetCursorPos(&pos); | ||||
TrackPopupMenu(trayMenu, 0, pos.x, pos.y, 0, getHandle(), 0); | TrackPopupMenu(trayMenu, 0, pos.x, pos.y, 0, getHandle(), 0); | ||||
break; | break; | ||||
} | |||||
return 0; | |||||
} | |||||
return 0; | |||||
} | } | ||||
// Handle tray icon menu commands | // Handle tray icon menu commands | ||||
case WM_COMMAND: | case WM_COMMAND: | ||||
switch (LOWORD(wParam)) { | 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: | case ID_OPTIONS: | ||||
{ | { | ||||
CurrentUserToken token; | CurrentUserToken token; | ||||
break; | break; | ||||
case 3: | case 3: | ||||
thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData); | thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData); | ||||
case 4: | |||||
thread.server.getClientsInfo(&LCInfo); | thread.server.getClientsInfo(&LCInfo); | ||||
CPanel->UpdateListView(&LCInfo); | CPanel->UpdateListView(&LCInfo); | ||||
break; | break; |
#define ID_DISCONNECT 40004 | #define ID_DISCONNECT 40004 | ||||
#define ID_CONNECT 40005 | #define ID_CONNECT 40005 | ||||
#define ID_OPTIONS 40006 | #define ID_OPTIONS 40006 | ||||
#define ID_DISABLE_NEW_CLIENTS 40007 | |||||
// Next default values for new objects | // Next default values for new objects | ||||
// | // | ||||
#ifdef APSTUDIO_INVOKED | #ifdef APSTUDIO_INVOKED | ||||
#ifndef APSTUDIO_READONLY_SYMBOLS | #ifndef APSTUDIO_READONLY_SYMBOLS | ||||
#define _APS_NEXT_RESOURCE_VALUE 111 | #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_CONTROL_VALUE 1024 | ||||
#define _APS_NEXT_SYMED_VALUE 101 | #define _APS_NEXT_SYMED_VALUE 101 | ||||
#endif | #endif |
BEGIN | BEGIN | ||||
POPUP "Tray Menu" | POPUP "Tray Menu" | ||||
BEGIN | BEGIN | ||||
MENUITEM "&Control Panel", ID_CONTR0L_PANEL | |||||
MENUITEM "Control &Panel", ID_CONTR0L_PANEL | |||||
MENUITEM SEPARATOR | MENUITEM SEPARATOR | ||||
MENUITEM "&Options...", ID_OPTIONS | MENUITEM "&Options...", ID_OPTIONS | ||||
MENUITEM "Add &New Client", ID_CONNECT | MENUITEM "Add &New Client", ID_CONNECT | ||||
MENUITEM "&Disconnect Clients", ID_DISCONNECT | MENUITEM "&Disconnect Clients", ID_DISCONNECT | ||||
MENUITEM "Disable New &Clients", ID_DISABLE_NEW_CLIENTS | |||||
MENUITEM SEPARATOR | MENUITEM SEPARATOR | ||||
MENUITEM "&Close VNC Server", ID_CLOSE | |||||
MENUITEM "Close &VNC Server", ID_CLOSE | |||||
MENUITEM "&About...", ID_ABOUT | MENUITEM "&About...", ID_ABOUT | ||||
END | END | ||||
END | END |