The code which realizes full functionality ListView Control
in Control Panel has been added.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@435 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/winvnc/ControlPanel.cxx b/winvnc/ControlPanel.cxx
index 134cc21..fb379d6 100644
--- a/winvnc/ControlPanel.cxx
+++ b/winvnc/ControlPanel.cxx
@@ -63,15 +63,24 @@
 
 void ControlPanel::UpdateListView(rfb::ListConnInfo* LCInfo)
 {
+  getSelConnInfo();
   DeleteAllLVItem(IDC_LIST_CONNECTIONS, handle);
-  if(LCInfo->Empty()) return;
+
+  if(LCInfo->Empty()) 
+    return;
+
+  ListConn.Copy(LCInfo);
 
   char* ItemString[3];
   int i = 0;
 
-  for (LCInfo->iBegin(); !LCInfo->iEnd(); LCInfo->iNext()) {
-    LCInfo->iGetCharInfo(ItemString);
+  for (ListConn.iBegin(); !ListConn.iEnd(); ListConn.iNext()) {
+    ListConn.iGetCharInfo(ItemString);
     InsertLVItem(IDC_LIST_CONNECTIONS, handle, i, ItemString, 3);
+    for (ListSelConn.iBegin(); !ListSelConn.iEnd(); ListSelConn.iNext()) {
+      if (ListSelConn.iGetConn() == ListConn.iGetConn())
+        SelectLVItem(IDC_LIST_CONNECTIONS, handle, i);
+    }
     i++;
   } 
 }
@@ -96,9 +105,16 @@
   return FALSE;
 }
 
-void ControlPanel::getSelConnInfo(std::list<DWORD>* conn, std::list<int>* status)
+void ControlPanel::getSelConnInfo()
 {
-  
+  int i = 0;
+  ListSelConn.Clear();
+  if(ListConn.Empty()) return;
+  for (ListConn.iBegin(); !ListConn.iEnd(); ListConn.iNext()) {
+    if (IsSelectedLVItem(IDC_LIST_CONNECTIONS, handle, i))
+      ListSelConn.iAdd(&ListConn);
+    i++;
+  }
 }
 
 ControlPanel::~ControlPanel()
diff --git a/winvnc/ControlPanel.h b/winvnc/ControlPanel.h
index 51eb421..f291b9e 100644
--- a/winvnc/ControlPanel.h
+++ b/winvnc/ControlPanel.h
@@ -31,9 +31,10 @@
     ~ControlPanel();
   protected: 
     virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-    void getSelConnInfo(std::list<DWORD>* conn, std::list<int>* status);
+    void getSelConnInfo();
     HWND m_hSTIcon;
-    std::list<DWORD> Conn;
+    rfb::ListConnInfo ListConn;
+    rfb::ListConnInfo ListSelConn;
   };
 };
 
diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx
index a883cab..533c6a7 100644
--- a/winvnc/STrayIcon.cxx
+++ b/winvnc/STrayIcon.cxx
@@ -183,8 +183,8 @@
       }
       setIcon(thread.server.isServerInUse() ? thread.activeIcon : thread.inactiveIcon);
 
-      thread.server.getClientsInfo(&LCInfo);
       CPanel->UpdateListView(&LCInfo);
+      thread.server.getClientsInfo(&LCInfo);
 
       return 0;