summaryrefslogtreecommitdiff
path: root/UConfig.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UConfig.pas')
-rw-r--r--UConfig.pas27
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);