diff options
| author | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-03 15:16:10 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-03 15:16:10 +0200 |
| commit | c977b8dd20d6f606f692efcd72e916fc020138f3 (patch) | |
| tree | d641a3fa94035a3e5003fc609899b7ba85e3c6b6 /UConnectionManager.pas | |
| parent | 7a2696850bf538fff83cc4e208287f96168a7e3c (diff) | |
| download | tuxcmd-c977b8dd20d6f606f692efcd72e916fc020138f3.tar.xz | |
Retain list selection in Connection Manager
Read/write connections on demand only
Diffstat (limited to 'UConnectionManager.pas')
| -rw-r--r-- | UConnectionManager.pas | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/UConnectionManager.pas b/UConnectionManager.pas index a730026..0fbb4d1 100644 --- a/UConnectionManager.pas +++ b/UConnectionManager.pas @@ -153,7 +153,7 @@ begin ListView.OnSelectionChanged := ListViewSelectionChanged; ListView.OnDblClick := ListViewDblClick; ListView.SetFocus; - if ListView.Items.Count > 0 then ListView.Items[0].SetCursor(0, False, False, 0, 0); + if ListView.Items.Count > 0 then ListView.Items[ConfConnMgrActiveItem].SetCursor(0, False, False, 0, 0); ListViewSelectionChanged(Self); AddConnectionButton.OnClick := AddConnectionButtonClick; EditButton.OnClick := EditButtonClick; @@ -291,6 +291,8 @@ var i: integer; Item: TGTKListItem; ConnMgrItem: TConnMgrItem; begin + ReadConnections; + if ConnectionMgrList.Count > 0 then for i := 0 to ConnectionMgrList.Count - 1 do begin ConnMgrItem := ConnectionMgrList[i]; @@ -300,7 +302,8 @@ begin Item.SetValue(2, ConstructURI(True, ConnMgrItem.ServiceType, ConnMgrItem.Server, ConnMgrItem.Username, ConnMgrItem.Password, ConnMgrItem.TargetDir)); end; - + if (ConfConnMgrActiveItem < 0) or (ConfConnMgrActiveItem > ConnectionMgrList.Count) then + ConfConnMgrActiveItem := 0; end; |
