summaryrefslogtreecommitdiff
path: root/UConfig.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-09-03 15:16:10 +0200
committerTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-09-03 15:16:10 +0200
commitc977b8dd20d6f606f692efcd72e916fc020138f3 (patch)
treed641a3fa94035a3e5003fc609899b7ba85e3c6b6 /UConfig.pas
parent7a2696850bf538fff83cc4e208287f96168a7e3c (diff)
downloadtuxcmd-c977b8dd20d6f606f692efcd72e916fc020138f3.tar.xz
Retain list selection in Connection Manager
Read/write connections on demand only
Diffstat (limited to 'UConfig.pas')
-rw-r--r--UConfig.pas37
1 files changed, 18 insertions, 19 deletions
diff --git a/UConfig.pas b/UConfig.pas
index f95321e..5e13616 100644
--- a/UConfig.pas
+++ b/UConfig.pas
@@ -107,6 +107,7 @@ var ConfPanelSep, ConfRowHeight, ConfRowHeightReal, ConfNumHistoryItems,
ConfUseSmoothScrolling: boolean;
ApplicationShuttingDown: boolean;
+ ConfConnMgrActiveItem: integer;
@@ -246,6 +247,7 @@ begin
ConfQuickSearchActivationKey := 0;
ConfSortDirectoriesLikeFiles := False;
ConfQuickRenameSkipExt := True;
+ ConfConnMgrActiveItem := 0;
// Setup default values for colors
@@ -921,23 +923,22 @@ begin
IniFile.ReadSections(Sections);
if Sections.Count > 0 then
for i := 0 to Sections.Count - 1 do
-{ if Sections[i] = 'General' then begin
- ConfMounterUseFSTab := IniFile.ReadBool('General', 'MounterUseFSTab', ConfMounterUseFSTab);
- ConfMounterPushDown := IniFile.ReadBool('General', 'MounterPushDown', ConfMounterPushDown);
- end else} begin
- Item := TConnMgrItem.Create;
- with Item do begin
- ConnectionName := Sections[i];
- ServiceType := IniFile.ReadString(Sections[i], 'ServiceType', '');
- Server := IniFile.ReadString(Sections[i], 'Server', '');
- Username := IniFile.ReadString(Sections[i], 'Username', '');
- Password := IniFile.ReadString(Sections[i], 'Password', '');
- TargetDir := IniFile.ReadString(Sections[i], 'TargetDir', '');
- PluginID := IniFile.ReadString(Sections[i], 'PluginID', '');
- URI := ConstructURI(False, ServiceType, Server, Username, Password, TargetDir);
+ if Sections[i] = '__General' then begin
+ ConfConnMgrActiveItem := IniFile.ReadInteger('__General', 'ConfConnMgrActiveItem', ConfConnMgrActiveItem);
+ end else begin
+ Item := TConnMgrItem.Create;
+ with Item do begin
+ ConnectionName := Sections[i];
+ ServiceType := IniFile.ReadString(Sections[i], 'ServiceType', '');
+ Server := IniFile.ReadString(Sections[i], 'Server', '');
+ Username := IniFile.ReadString(Sections[i], 'Username', '');
+ Password := IniFile.ReadString(Sections[i], 'Password', '');
+ TargetDir := IniFile.ReadString(Sections[i], 'TargetDir', '');
+ PluginID := IniFile.ReadString(Sections[i], 'PluginID', '');
+ URI := ConstructURI(False, ServiceType, Server, Username, Password, TargetDir);
+ end;
+ ConnectionMgrList.Add(Item);
end;
- ConnectionMgrList.Add(Item);
- end;
Sections.Free;
finally
try IniFile.Free; except end;
@@ -964,7 +965,7 @@ begin
IniFile := TMyIniFile.Create(s, False);
try try
-// IniFile.WriteBool('General', 'MounterUseFSTab', ConfMounterUseFSTab);
+ IniFile.WriteInteger('__General', 'ConnMgrActiveItem', ConfConnMgrActiveItem);
if ConnectionMgrList.Count > 0 then
for i := 0 to ConnectionMgrList.Count - 1 do
with TConnMgrItem(ConnectionMgrList[i]) do begin
@@ -1150,7 +1151,6 @@ initialization
ReadAssoc;
ReadBookmarks;
ReadMounter;
- ReadConnections;
// Apply the settings
LoadIcons;
@@ -1158,7 +1158,6 @@ initialization
finalization
// Save the settings
WriteBookmarks;
-// WriteConnections; -- not needed, saving when Connection Manager closes
WriteMainSettings;
if ConfSavePanelTabs then begin
WriteTabs(True, LeftPanelTabs, LeftTabSortIDs, LeftTabSortTypes);