diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-17 19:16:43 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-17 19:16:43 +0100 |
| commit | 6c77cc430b1e78bd3d0acf1cc078e60775647956 (patch) | |
| tree | 3f187b66079eceb7a40656abf812d0881234bdbf /UConfig.pas | |
| parent | 21a190555adb42a71cb6eb6a1aec5353708bc6bd (diff) | |
| download | tuxcmd-0.6.60.tar.xz | |
Implement Quick Connect featurev0.6.60
Diffstat (limited to 'UConfig.pas')
| -rw-r--r-- | UConfig.pas | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/UConfig.pas b/UConfig.pas index ce0ca82..cfd79d3 100644 --- a/UConfig.pas +++ b/UConfig.pas @@ -25,8 +25,8 @@ uses Classes, ULocale; resourcestring ConstAppTitle = 'Tux Commander'; - ConstAboutVersion = '0.6.59-dev'; - ConstAboutBuildDate = '2008-11-16'; + ConstAboutVersion = '0.6.60-dev'; + ConstAboutBuildDate = '2008-11-17'; {$IFDEF FPC} {$INCLUDE fpcver.inc} @@ -114,6 +114,7 @@ var ConfPanelSep, ConfRowHeight, ConfRowHeightReal, ConfNumHistoryItems, ApplicationShuttingDown: boolean; ConfConnMgrActiveItem: integer; ConfConnMgrDoNotSavePasswords, ConfConnMgrDoNotSynchronizeKeyring: boolean; + ConfQuickConnectPluginID: string; @@ -258,6 +259,7 @@ begin ConfRightClickSelect := False; ConfConnMgrDoNotSavePasswords := False; ConfConnMgrDoNotSynchronizeKeyring := False; + ConfQuickConnectPluginID := ''; // Setup default values for colors @@ -915,7 +917,7 @@ procedure ReadConnections; var s: string; IniFile: TMyIniFile; Sections: TStringList; - i: integer; + i, j, k: integer; Item: TConnMgrItem; begin try @@ -942,6 +944,16 @@ begin ConfConnMgrActiveItem := IniFile.ReadInteger('__General', 'ConnMgrActiveItem', ConfConnMgrActiveItem); ConfConnMgrDoNotSavePasswords := IniFile.ReadBool('__General', 'ConnMgrDoNotSavePasswords', ConfConnMgrDoNotSavePasswords); ConfConnMgrDoNotSynchronizeKeyring := IniFile.ReadBool('__General', 'ConnMgrDoNotSynchronizeKeyring', ConfConnMgrDoNotSynchronizeKeyring); + ConfQuickConnectPluginID := IniFile.ReadString('__General', 'QuickConnectPluginID', ConfQuickConnectPluginID); + end else + if Sections[i] = '__QuickConnectHistory' then begin + QuickConnectHistory.Clear; + if not InternalDeleteHistory then begin + j := IniFile.ReadInteger('__QuickConnectHistory', 'NumItems', 0); + if j > 0 then + for k := 0 to j - 1 do + QuickConnectHistory.Add(IniFile.ReadString('__QuickConnectHistory', Format('Item%d', [k]), '')); + end; end else begin Item := TConnMgrItem.Create; with Item do begin @@ -984,6 +996,11 @@ begin IniFile.WriteInteger('__General', 'ConnMgrActiveItem', ConfConnMgrActiveItem); IniFile.WriteBool('__General', 'ConnMgrDoNotSavePasswords', ConfConnMgrDoNotSavePasswords); IniFile.WriteBool('__General', 'ConnMgrDoNotSynchronizeKeyring', ConfConnMgrDoNotSynchronizeKeyring); + IniFile.WriteString('__General', 'QuickConnectPluginID', ConfQuickConnectPluginID); + IniFile.WriteInteger('__QuickConnectHistory', 'NumItems', QuickConnectHistory.Count); + if QuickConnectHistory.Count > 0 then + for i := 0 to QuickConnectHistory.Count - 1 do + IniFile.WriteString('__QuickConnectHistory', Format('Item%d', [i]), QuickConnectHistory[i]); if ConnectionMgrList.Count > 0 then for i := 0 to ConnectionMgrList.Count - 1 do with TConnMgrItem(ConnectionMgrList[i]) do begin @@ -1159,6 +1176,8 @@ initialization CommandLineHistory.CaseSensitive := True; Bookmarks := TStringList.Create; Bookmarks.CaseSensitive := True; + QuickConnectHistory := TStringList.Create; + QuickConnectHistory.CaseSensitive := True; // Initialize the modules DoInitPlugins; // Initialize locales @@ -1186,5 +1205,6 @@ finalization LeftLocalEngine.Free; RightLocalEngine.Free; CommandLineHistory.Free; + QuickConnectHistory.Free; Bookmarks.Free; end. |
