From c977b8dd20d6f606f692efcd72e916fc020138f3 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 3 Sep 2008 15:16:10 +0200 Subject: Retain list selection in Connection Manager Read/write connections on demand only --- UConnectionManager.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'UConnectionManager.pas') 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; -- cgit v1.2.3