diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-23 16:59:50 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-23 16:59:50 +0100 |
| commit | 2de0a7945bf5941cf0a163b86fa8facbb5b05f2d (patch) | |
| tree | db7cb80e32d9736d2d3aed54ee35315d164ae666 /UConfig.pas | |
| parent | 6c77cc430b1e78bd3d0acf1cc078e60775647956 (diff) | |
| download | tuxcmd-0.6.61.tar.xz | |
Connection Manager UI improvements (format change!)v0.6.61
- add Duplicate button
- add popup menu on the list view
- move selection when deleting
- add sorting to the list view
- save sorting state + column width
- simple cipher saved passwords
- use hash keys for each item when saving - allow duplicate entries
Diffstat (limited to 'UConfig.pas')
| -rw-r--r-- | UConfig.pas | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/UConfig.pas b/UConfig.pas index cfd79d3..3e2ab55 100644 --- a/UConfig.pas +++ b/UConfig.pas @@ -25,8 +25,8 @@ uses Classes, ULocale; resourcestring ConstAppTitle = 'Tux Commander'; - ConstAboutVersion = '0.6.60-dev'; - ConstAboutBuildDate = '2008-11-17'; + ConstAboutVersion = '0.6.61-dev'; + ConstAboutBuildDate = '2008-11-23'; {$IFDEF FPC} {$INCLUDE fpcver.inc} @@ -58,6 +58,7 @@ const ConfDefaultNormalItemFGColor = '#000000'; ConstNumPanelColumns = 10; ConstPathDelim = '#'; ConstFullPathFormatStr = '%s#%s'; + ConstConnMgrXORKey = 65; ConstTerminalCommand_xterm = 'xterm -T "TuxCommand" -e sh -c ''%s ; echo -n Press ENTER to exit... ; read'''; ConstTerminalCommand_rxvt = 'rxvt -T "TuxCommand" -e sh -c ''%s ; echo -n Press ENTER to exit... ; read'''; @@ -112,7 +113,7 @@ var ConfPanelSep, ConfRowHeight, ConfRowHeightReal, ConfNumHistoryItems, ConfUseSmoothScrolling: boolean; ApplicationShuttingDown: boolean; - ConfConnMgrActiveItem: integer; + ConfConnMgrActiveItem, ConfConnMgrSortColumn, ConfConnMgrSortType, ConfConnMgrColumn1Width: integer; ConfConnMgrDoNotSavePasswords, ConfConnMgrDoNotSynchronizeKeyring: boolean; ConfQuickConnectPluginID: string; @@ -140,7 +141,7 @@ function CheckConfFilesMod(var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, C implementation -uses ULibc, SysUtils, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore; +uses ULibc, glib2, SysUtils, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore; var InternalQuickExit, InternalDeleteHistory: boolean; InternalMainGUIConfmtime, InternalBookmarksConfmtime, InternalFAssocConfmtime, InternalMounterConfmtime, @@ -260,6 +261,9 @@ begin ConfConnMgrDoNotSavePasswords := False; ConfConnMgrDoNotSynchronizeKeyring := False; ConfQuickConnectPluginID := ''; + ConfConnMgrSortColumn := -1; + ConfConnMgrSortType := 2; + ConfConnMgrColumn1Width := 230; // Setup default values for colors @@ -945,6 +949,9 @@ begin ConfConnMgrDoNotSavePasswords := IniFile.ReadBool('__General', 'ConnMgrDoNotSavePasswords', ConfConnMgrDoNotSavePasswords); ConfConnMgrDoNotSynchronizeKeyring := IniFile.ReadBool('__General', 'ConnMgrDoNotSynchronizeKeyring', ConfConnMgrDoNotSynchronizeKeyring); ConfQuickConnectPluginID := IniFile.ReadString('__General', 'QuickConnectPluginID', ConfQuickConnectPluginID); + ConfConnMgrSortColumn := IniFile.ReadInteger('__General', 'ConnMgrSortColumn', ConfConnMgrSortColumn); + ConfConnMgrSortType := IniFile.ReadInteger('__General', 'ConnMgrSortType', ConfConnMgrSortType); + ConfConnMgrColumn1Width := IniFile.ReadInteger('__General', 'ConnMgrColumn1Width', ConfConnMgrColumn1Width); end else if Sections[i] = '__QuickConnectHistory' then begin QuickConnectHistory.Clear; @@ -957,11 +964,11 @@ begin end else begin Item := TConnMgrItem.Create; with Item do begin - ConnectionName := Sections[i]; + ConnectionName := IniFile.ReadString(Sections[i], 'ConnectionName', ''); ServiceType := IniFile.ReadString(Sections[i], 'ServiceType', ''); Server := IniFile.ReadString(Sections[i], 'Server', ''); Username := IniFile.ReadString(Sections[i], 'Username', ''); - Password := IniFile.ReadString(Sections[i], 'Password', ''); + Password := XORStr(IniFile.ReadString(Sections[i], 'Password', ''), ConstConnMgrXORKey); TargetDir := IniFile.ReadString(Sections[i], 'TargetDir', ''); PluginID := IniFile.ReadString(Sections[i], 'PluginID', ''); end; @@ -997,6 +1004,9 @@ begin IniFile.WriteBool('__General', 'ConnMgrDoNotSavePasswords', ConfConnMgrDoNotSavePasswords); IniFile.WriteBool('__General', 'ConnMgrDoNotSynchronizeKeyring', ConfConnMgrDoNotSynchronizeKeyring); IniFile.WriteString('__General', 'QuickConnectPluginID', ConfQuickConnectPluginID); + IniFile.WriteInteger('__General', 'ConnMgrSortColumn', ConfConnMgrSortColumn); + IniFile.WriteInteger('__General', 'ConnMgrSortType', ConfConnMgrSortType); + IniFile.WriteInteger('__General', 'ConnMgrColumn1Width', ConfConnMgrColumn1Width); IniFile.WriteInteger('__QuickConnectHistory', 'NumItems', QuickConnectHistory.Count); if QuickConnectHistory.Count > 0 then for i := 0 to QuickConnectHistory.Count - 1 do @@ -1004,12 +1014,13 @@ begin if ConnectionMgrList.Count > 0 then for i := 0 to ConnectionMgrList.Count - 1 do with TConnMgrItem(ConnectionMgrList[i]) do begin - SectionTitle := ConnectionName; + SectionTitle := Format('%d_%d_%d', [g_str_hash(PChar(ConnectionName)), i, g_str_hash(PChar(GetURI(False)))]); IniFile.EraseSection(SectionTitle); + IniFile.WriteString(SectionTitle, 'ConnectionName', ConnectionName); IniFile.WriteString(SectionTitle, 'ServiceType', ServiceType); IniFile.WriteString(SectionTitle, 'Server', Server); IniFile.WriteString(SectionTitle, 'Username', Username); - if not ConfConnMgrDoNotSavePasswords then IniFile.WriteString(SectionTitle, 'Password', Password) + if not ConfConnMgrDoNotSavePasswords then IniFile.WriteString(SectionTitle, 'Password', XORStr(Password, ConstConnMgrXORKey)) else IniFile.WriteString(SectionTitle, 'Password', ''); IniFile.WriteString(SectionTitle, 'TargetDir', TargetDir); IniFile.WriteString(SectionTitle, 'PluginID', PluginID); |
