ADD: Make drives list button options page. Add options to show/hide columns in the drives list.

This commit is contained in:
cobines 2011-10-08 16:28:15 +00:00
commit 038d2aaedb
13 changed files with 280 additions and 43 deletions

View file

@ -204,7 +204,7 @@
<PackageName Value="viewerpackage"/>
</Item7>
</RequiredPackages>
<Units Count="150">
<Units Count="151">
<Unit0>
<Filename Value="doublecmd.lpr"/>
<IsPartOfProject Value="True"/>
@ -1146,6 +1146,13 @@
<ResourceBaseClass Value="Frame"/>
<UnitName Value="fOptionsColumnsView"/>
</Unit149>
<Unit150>
<Filename Value="foptionsdriveslistbutton.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmOptionsDrivesListButton"/>
<ResourceBaseClass Value="Frame"/>
<UnitName Value="fOptionsDrivesListButton"/>
</Unit150>
</Units>
</ProjectOptions>
<CompilerOptions>

View file

@ -3241,7 +3241,7 @@ begin
AddVirtualDriveButton(dskPanel);
// Add special buttons
if not gDriveMenuButton then
if not gDrivesListButton then
AddSpecialButtons(dskPanel);
end;
@ -3707,7 +3707,7 @@ procedure TfrmMain.UpdateWindowView;
procedure AnchorFreeSpace(LeftControl, RightControl: TControl; ExcludeVert: Boolean);
begin
if gDriveMenuButton then
if gDrivesListButton then
begin
AnchorHorizontalBetween(LeftControl, btnLeftDrive, btnLeftDirectoryHotlist);
AnchorHorizontalBetween(RightControl, btnRightDrive, btnRightDirectoryHotlist);
@ -3781,6 +3781,8 @@ begin
UpdateDriveButtonSelection(btnRightDrive, FrameRight);
(*/ Disk Panels *)
FDrivesListPopup.UpdateView;
(*Main menu*)
Actions.DoShowMainMenu(gMainMenu);
@ -3802,37 +3804,37 @@ begin
end;
end;
btnLeftDrive.Visible := gDriveMenuButton;
btnLeftDrive.Visible := gDrivesListButton;
btnLeftDrive.Flat := gInterfaceFlat;
btnLeftRoot.Visible := gDriveMenuButton;
btnLeftRoot.Visible := gDrivesListButton;
btnLeftRoot.Flat := gInterfaceFlat;
btnLeftUp.Visible := gDriveMenuButton;
btnLeftUp.Visible := gDrivesListButton;
btnLeftUp.Flat := gInterfaceFlat;
btnLeftHome.Visible := gDriveMenuButton;
btnLeftHome.Visible := gDrivesListButton;
btnLeftHome.Flat := gInterfaceFlat;
btnLeftDirectoryHotlist.Visible := gDriveMenuButton;
btnLeftDirectoryHotlist.Visible := gDrivesListButton;
btnLeftDirectoryHotlist.Flat := gInterfaceFlat;
btnLeftEqualRight.Visible := gDriveMenuButton;
btnLeftEqualRight.Visible := gDrivesListButton;
btnLeftEqualRight.Flat:= gInterfaceFlat;
lblLeftDriveInfo.Visible:= gDriveFreeSpace;
pbxLeftDrive.Visible := gDriveInd;
pnlLeftTools.Visible:= gDriveMenuButton or gDriveFreeSpace or gDriveInd;
pnlLeftTools.Visible:= gDrivesListButton or gDriveFreeSpace or gDriveInd;
btnRightDrive.Visible := gDriveMenuButton;
btnRightDrive.Visible := gDrivesListButton;
btnRightDrive.Flat := gInterfaceFlat;
btnRightRoot.Visible := gDriveMenuButton;
btnRightRoot.Visible := gDrivesListButton;
btnRightRoot.Flat := gInterfaceFlat;
btnRightUp.Visible := gDriveMenuButton;
btnRightUp.Visible := gDrivesListButton;
btnRightUp.Flat := gInterfaceFlat;
btnRightHome.Visible := gDriveMenuButton;;
btnRightHome.Visible := gDrivesListButton;;
btnRightHome.Flat := gInterfaceFlat;
btnRightDirectoryHotlist.Visible := gDriveMenuButton;
btnRightDirectoryHotlist.Visible := gDrivesListButton;
btnRightDirectoryHotlist.Flat := gInterfaceFlat;
btnRightEqualLeft.Visible := gDriveMenuButton;
btnRightEqualLeft.Visible := gDrivesListButton;
btnRightEqualLeft.Flat:= gInterfaceFlat;
lblRightDriveInfo.Visible:= gDriveFreeSpace;
pbxRightDrive.Visible := gDriveInd;
pnlRightTools.Visible:= gDriveMenuButton or gDriveFreeSpace or gDriveInd;
pnlRightTools.Visible:= gDrivesListButton or gDriveFreeSpace or gDriveInd;
// Free space indicator.
if gDriveFreeSpace then
@ -4260,7 +4262,7 @@ var
DriveIndex: Integer;
Drive: PDrive;
begin
if not gDriveMenuButton then
if not gDrivesListButton then
Exit;
DriveIndex := FindMatchingDrive(FileView.CurrentPath);

View file

@ -135,7 +135,7 @@ object frmOptions: TfrmOptions
left = 72
top = 16
Bitmap = {
4C691F000000100000001000000066355CFF66355CFF66355CFF66355CFF6635
4C6920000000100000001000000066355CFF66355CFF66355CFF66355CFF6635
5CFF66355CFF66355CFF66355CFF66355CFF66355CFF66355CFF66355CFF6635
5CFF00000000000000000000000066355CFFB395AFFFC6ACC3FFD3BED0FFD1C0
CEFFC9BBC7FFAA97A7FF877184FF755871FF6A4565FF744B6FFF7E5278FF6635
@ -1127,7 +1127,39 @@ object frmOptions: TfrmOptions
0000000000000000000000000000185876808CBEECFF5296D6FF256FB1BF0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000134058401D567D80327EB66B000000000000
0000000000000000000000000000
000000000000000000000000000000000000D8D8D847D6D6D6B3D1D1D1BFCBCB
CBBFC5C5C5BFBEBEBEBFB6B6B6BFAFAFAFBFA5A5A5B3A0A0A047000000000000
0000000000000000000000000000D6D6D618DEDEDEAFEAEAEAFFEAEAEAFFEAEA
EAFFEAEAEAFFEAEAEAFFE9E9E9FFE3E3E3FFDDDDDDFFADADADB08E8E8E180000
0000000000000000000000000000D6D6D64FE1E1E1EFE0E0E0FFDCDCDCFFD8D8
D8FFD5D5D5FFD4D4D4FFD5D5D5FFCCCCCCFFD9D9D9FFBCBCBCEE8E8E8E500000
0000000000000000000000000000D7D7D7B6E6E6E6FFE2E2E2FFDEDEDEFFDBDB
DBFFDADADAFFD8D8D8FFD8D8D8FFD9D9D9FFDDDDDDFFD2D2D2FF909090B60000
0000000000000000000000000000CECECEDAD2D2D2FFC2C2C2FFB4B4B4FFB2B2
B2FFB0B0B0FFAEAEAEFFACACACFFA9A9A9FFB0B0B0FFBBBBBBFF948D87FFE8B9
92FFE8B992FFE8B992FFC1906FFDC6C6C6FFCECECEFFBDBDBDFF909090FF9191
91FF929292FF919191FF909090FF8E8E8EFFABABABFFBCBCBCFF808080FFDCA7
7BFFDCA77BFFDCA77BFFC08B66FFBFBFBFFFC9C9C9FFBABABAFFACACACFFAAAA
AAFFA9A9A9FFA6A6A6FFA4A4A4FFA2A2A2FFA8A8A8FFB8B8B8FF7A7A7AFFFFFF
FFFFFFFFFFFFFFFFFFFFBD8763FFB8B8B8F1CECECEFFC3C3C3FFBFBFBFFFBCBC
BCFFB9B9B9FFB6B6B6FFB3B3B3FFB1B1B1FFAFAFAFFFB7B7B7FF797979FFB9B9
B9FFB9B9B9FFFFFFFFFFBA8560FFA4A4A4649D9D9D80959595808B8B8B80AD92
7EFFBDBDBDFFB8B8B8FFB5B5B5FFB2B2B2FFAFAFAFFFADADADFFBDBDBDFFFDFD
FDFFFDFDFDFFFFFFFFFFB7815EFF00000000000000000000000000000000D5A0
76FFFFFFFFFFC1C1C1FFBEBEBEFFBABABAFFB7B7B7FFB5B5B5FFB2B2B2FFAEAE
AEFFADADADFFFFFFFFFFB57E5CFF00000000000000000000000000000000D49E
75FFFFFFFFFFFFFFFFFFFEFEFEFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFDFFFDFD
FDFFFCFCFCFFFFFFFFFFB27C5AFF00000000000000000000000000000000D19C
73FFFFFFFFFFB9B9B9FFB5B5B5FFB1B1B1FFADADADFFA9A9A9FFA6A6A6FFA2A2
A2FFA1A1A1FFFFFFFFFFB07A58FF00000000000000000000000000000000CC97
6FFFFFFFFFFFFDFDFDFFFDFDFDFFFCFCFCFFFCFCFCFFFCFCFCFFFCFCFCFFFBFB
FBFFFBFBFBFFFFFFFFFFAC7554FF00000000000000000000000000000000CA94
6EFFFFFFFFFFB2B2B2FFADADADFFA8A8A8FFA4A4A4FF9F9F9FFF9D9D9DFF9999
99FF999999FFFFFFFFFFAA7353FF00000000000000000000000000000000C892
6CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFA97251FF00000000000000000000000000000000A971
51A9C38E68FFBB8561FFB9835FFFB47E5CFFB27C5AFFB17B58FFAE7957FFAB75
54FFA97353FFA97151FFA97151A9
}
end
end

View file

@ -0,0 +1,48 @@
inherited frmOptionsDrivesListButton: TfrmOptionsDrivesListButton
object gbDrivesList: TGroupBox[0]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 105
Top = 6
Width = 308
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Drives list'
ChildSizing.LeftRightSpacing = 10
ChildSizing.TopBottomSpacing = 4
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 83
ClientWidth = 304
TabOrder = 0
object cbShowLabel: TCheckBox
Left = 10
Height = 25
Top = 4
Width = 141
Caption = 'Show label'
TabOrder = 0
end
object cbShowFileSystem: TCheckBox
AnchorSideTop.Side = asrBottom
Left = 10
Height = 25
Top = 29
Width = 141
Caption = 'Show file system'
TabOrder = 1
end
object cbShowFreeSpace: TCheckBox
Left = 10
Height = 25
Top = 54
Width = 141
Caption = 'Show free space'
TabOrder = 2
end
end
end

View file

@ -0,0 +1,4 @@
TFRMOPTIONSDRIVESLISTBUTTON.GBDRIVESLIST.CAPTION=Drives list
TFRMOPTIONSDRIVESLISTBUTTON.CBSHOWLABEL.CAPTION=Show label
TFRMOPTIONSDRIVESLISTBUTTON.CBSHOWFILESYSTEM.CAPTION=Show file system
TFRMOPTIONSDRIVESLISTBUTTON.CBSHOWFREESPACE.CAPTION=Show free space

View file

@ -0,0 +1,90 @@
{
Double Commander
-------------------------------------------------------------------------
Drives list button options page
Copyright (C) 2006-2011 Koblov Alexander (Alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}
unit fOptionsDrivesListButton;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, StdCtrls,
fOptionsFrame;
type
{ TfrmOptionsDrivesListButton }
TfrmOptionsDrivesListButton = class(TOptionsEditor)
cbShowLabel: TCheckBox;
cbShowFileSystem: TCheckBox;
cbShowFreeSpace: TCheckBox;
gbDrivesList: TGroupBox;
protected
procedure Load; override;
function Save: TOptionsEditorSaveFlags; override;
public
class function GetIconIndex: Integer; override;
class function GetTitle: String; override;
end;
implementation
{$R *.lfm}
uses
uGlobs, uLng;
{ TfrmOptionsDrivesListButton }
procedure TfrmOptionsDrivesListButton.Load;
begin
cbShowLabel.Checked := dlbShowLabel in gDrivesListButtonOptions;
cbShowFileSystem.Checked := dlbShowFileSystem in gDrivesListButtonOptions;
cbShowFreeSpace.Checked := dlbShowFreeSpace in gDrivesListButtonOptions;
end;
function TfrmOptionsDrivesListButton.Save: TOptionsEditorSaveFlags;
begin
gDrivesListButtonOptions := [];
if cbShowLabel.Checked then
Include(gDrivesListButtonOptions, dlbShowLabel);
if cbShowFileSystem.Checked then
Include(gDrivesListButtonOptions, dlbShowFileSystem);
if cbShowFreeSpace.Checked then
Include(gDrivesListButtonOptions, dlbShowFreeSpace);
Result := [];
end;
class function TfrmOptionsDrivesListButton.GetIconIndex: Integer;
begin
Result := 31;
end;
class function TfrmOptionsDrivesListButton.GetTitle: String;
begin
Result := rsOptionsEditorDrivesListButton;
end;
end.

View file

@ -93,6 +93,7 @@ uses
fOptionsConfiguration,
fOptionsCustomColumns,
fOptionsDragDrop,
fOptionsDrivesListButton,
fOptionsFileOperations,
fOptionsFilePanelsColors,
fOptionsFileTypesColors,
@ -225,6 +226,7 @@ var
ColumnsView,
FilesViews,
Keyboard,
Layout,
Mouse,
Tools: TOptionsEditorRec;
begin
@ -247,7 +249,8 @@ begin
ColumnsView := FilesViews.Add(TfrmOptionsColumnsView);
ColumnsView.Add(TfrmOptionsCustomColumns);
Main.Add(TfrmOptionsPlugins);
Main.Add(TfrmOptionsLayout);
Layout := Main.Add(TfrmOptionsLayout);
Layout.Add(TfrmOptionsDrivesListButton);
Main.Add(TfrmOptionsFileOperations);
Main.Add(TfrmOptionsTabs);
Main.Add(TfrmOptionsLog);

View file

@ -4,17 +4,22 @@ inherited frmOptionsLayout: TfrmOptionsLayout
ClientHeight = 588
ClientWidth = 784
object gbScreenLayout: TGroupBox[0]
Left = 10
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 572
Top = 6
Width = 756
Width = 772
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Around = 6
Caption = ' Screen layout '
ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6
ClientHeight = 550
ClientWidth = 752
ClientWidth = 768
TabOrder = 0
object cbShowMainMenu: TCheckBox
Left = 12
@ -47,15 +52,15 @@ inherited frmOptionsLayout: TfrmOptionsLayout
OnChange = cbShowDiskPanelChange
TabOrder = 3
end
object cbShowDriveMenuButton: TCheckBox
object cbShowDrivesListButton: TCheckBox
AnchorSideTop.Control = cbFlatDiskPanel
AnchorSideTop.Side = asrBottom
Left = 12
Height = 25
Top = 168
Width = 194
Width = 182
BorderSpacing.Top = 2
Caption = 'Show d&rive menu button'
Caption = 'Show d&rives list button'
TabOrder = 6
end
object cbShowCurDir: TCheckBox
@ -227,7 +232,7 @@ inherited frmOptionsLayout: TfrmOptionsLayout
TabOrder = 19
end
object cbShowDriveFreeSpace: TCheckBox
AnchorSideTop.Control = cbShowDriveMenuButton
AnchorSideTop.Control = cbShowDrivesListButton
AnchorSideTop.Side = asrBottom
Left = 12
Height = 25

View file

@ -2,7 +2,7 @@ TFRMOPTIONSLAYOUT.GBSCREENLAYOUT.CAPTION= Screen layout
TFRMOPTIONSLAYOUT.CBSHOWMAINMENU.CAPTION=Show main menu
TFRMOPTIONSLAYOUT.CBSHOWMAINTOOLBAR.CAPTION=Show &button bar
TFRMOPTIONSLAYOUT.CBSHOWDISKPANEL.CAPTION=Show &drive buttons
TFRMOPTIONSLAYOUT.CBSHOWDRIVEMENUBUTTON.CAPTION=Show d&rive menu button
TFRMOPTIONSLAYOUT.CBSHOWDRIVESLISTBUTTON.CAPTION=Show d&rives list button
TFRMOPTIONSLAYOUT.CBSHOWCURDIR.CAPTION=Show &current directory
TFRMOPTIONSLAYOUT.CBSHOWTABHEADER.CAPTION=Show &tabstop header
TFRMOPTIONSLAYOUT.CBSHOWSTATUSBAR.CAPTION=Show &status bar

View file

@ -46,7 +46,7 @@ type
cbShowCurDir: TCheckBox;
cbShowDiskPanel: TCheckBox;
cbShowDriveFreeSpace: TCheckBox;
cbShowDriveMenuButton: TCheckBox;
cbShowDrivesListButton: TCheckBox;
cbShowKeysPanel: TCheckBox;
cbShowMainMenu: TCheckBox;
cbShowMainToolBar: TCheckBox;
@ -114,7 +114,7 @@ begin
cbShowDiskPanel.Checked := gDriveBar1;
cbTwoDiskPanels.Checked := gDriveBar2;
cbFlatDiskPanel.Checked := gDriveBarFlat;
cbShowDriveMenuButton.Checked := gDriveMenuButton;
cbShowDrivesListButton.Checked := gDrivesListButton;
cbShowTabs.Checked := gDirectoryTabs;
cbShowCurDir.Checked := gCurDir;
cbShowTabHeader.Checked := gTabHeader;
@ -141,7 +141,7 @@ begin
gDriveBar1 := cbShowDiskPanel.Checked;
gDriveBar2 := cbTwoDiskPanels.Checked;
gDriveBarFlat := cbFlatDiskPanel.Checked;
gDriveMenuButton := cbShowDriveMenuButton.Checked;
gDrivesListButton := cbShowDrivesListButton.Checked;
gDirectoryTabs := cbShowTabs.Checked;
gCurDir := cbShowCurDir.Checked;
gTabHeader := cbShowTabHeader.Checked;

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
Control that shows drives list and allows selecting a drive.
Copyright (C) 2009-2010 Przemyslaw Nagay (cobines@gmail.com)
Copyright (C) 2009-2011 Przemyslaw Nagay (cobines@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,6 +34,8 @@ type
TDriveSelected = procedure (Sender: TObject; ADriveIndex: Integer;
APanel: TFilePanelSelect) of object;
{ TDrivesListPopup }
TDrivesListPopup = class(TStringGrid)
private
FDrivesList: TDrivesList;
@ -95,6 +97,7 @@ type
constructor Create(AOwner: TComponent; AParent: TWinControl); reintroduce;
procedure UpdateDrivesList(ADrivesList: TDrivesList);
procedure UpdateView;
{en
Shows the drive list.
@ -121,7 +124,7 @@ implementation
uses
StdCtrls, Graphics, LCLProc,
uPixMapManager, uOSUtils, uDCUtils, uOSForms;
uPixMapManager, uOSUtils, uDCUtils, uOSForms, uGlobs;
const
DriveIconSize = 16;
@ -155,7 +158,8 @@ begin
ScrollBars := ssAutoVertical;
Visible := False;
ColCount := 5;
while Columns.Count < 5 do
Columns.Add;
RowCount := 0 + DummyRows;
FixedCols := 0;
FixedRows := 0;
@ -178,7 +182,6 @@ procedure TDrivesListPopup.UpdateDrivesList(ADrivesList: TDrivesList);
begin
FDrivesList := ADrivesList;
ColCount := 5;
RowCount := LowestRow + ADrivesList.Count;
Clean;
SetLength(FShortCuts, ADrivesList.Count);
@ -191,6 +194,13 @@ begin
end;
end;
procedure TDrivesListPopup.UpdateView;
begin
Columns.Items[2].Visible := dlbShowLabel in gDrivesListButtonOptions;
Columns.Items[3].Visible := dlbShowFileSystem in gDrivesListButtonOptions;
Columns.Items[4].Visible := dlbShowFreeSpace in gDrivesListButtonOptions;
end;
procedure TDrivesListPopup.Show(AtPoint: TPoint; APanel: TFilePanelSelect;
ASelectedDriveIndex: Integer = -1);
begin

View file

@ -74,6 +74,9 @@ type
// fswmWholeDrive - watch whole drives instead of single directories to omit problems with deleting watched directories
TWatcherMode = (fswmPreventDelete, fswmAllowDelete, fswmWholeDrive);
TDrivesListButtonOption = (dlbShowLabel, dlbShowFileSystem, dlbShowFreeSpace);
TDrivesListButtonOptions = set of TDrivesListButtonOption;
const
{ Default hotkey list version number }
hkVersion = 5;
@ -82,7 +85,9 @@ const
// History:
// 2 - removed Layout/SmallIcons
// renamed Layout/SmallIconSize to Layout/IconSize
ConfigVersion = 2;
// 3 - Layout/DriveMenuButton -> Layout/DrivesListButton and added subnodes:
// ShowLabel, ShowFileSystem, ShowFreeSpace
ConfigVersion = 3;
var
{ For localization }
@ -112,7 +117,7 @@ var
gDriveBar1,
gDriveBar2,
gDriveBarFlat,
gDriveMenuButton,
gDrivesListButton,
gDirectoryTabs,
gCurDir,
gTabHeader,
@ -127,6 +132,7 @@ var
gProgInMenuBar,
gPanelOfOp,
gHorizontalFilePanels: Boolean;
gDrivesListButtonOptions: TDrivesListButtonOptions;
{ Toolbar }
gToolBarButtonSize,
@ -696,7 +702,7 @@ begin
gDriveBar1 := True;
gDriveBar2 := True;
gDriveBarFlat := True;
gDriveMenuButton := True;
gDrivesListButton := True;
gDirectoryTabs := True;
gCurDir := True;
gTabHeader := True;
@ -711,6 +717,7 @@ begin
gProgInMenuBar := False;
gPanelOfOp := True;
gHorizontalFilePanels := False;
gDrivesListButtonOptions := [dlbShowLabel, dlbShowFileSystem, dlbShowFreeSpace];
{ File operations page }
gCopyBlockSize := 524288;
@ -1087,7 +1094,7 @@ begin
gDriveBar1 := gIni.ReadBool('Layout', 'DriveBar1', True);
gDriveBar2 := gIni.ReadBool('Layout', 'DriveBar2', True);
gDriveBarFlat := gIni.ReadBool('Layout', 'DriveBarFlat', True);
gDriveMenuButton := gIni.ReadBool('Layout', 'DriveMenuButton', True);
gDrivesListButton := gIni.ReadBool('Layout', 'DriveMenuButton', True);
gDirectoryTabs := gIni.ReadBool('Layout', 'DirectoryTabs', True);
gCurDir := gIni.ReadBool('Layout', 'CurDir', True);
gTabHeader := gIni.ReadBool('Layout', 'TabHeader', True);
@ -1258,7 +1265,7 @@ begin
gIni.WriteBool('Layout', 'DriveBar1', gDriveBar1);
gIni.WriteBool('Layout', 'DriveBar2', gDriveBar2);
gIni.WriteBool('Layout', 'DriveBarFlat', gDriveBarFlat);
gIni.WriteBool('Layout', 'DriveMenuButton', gDriveMenuButton);
gIni.WriteBool('Layout', 'DriveMenuButton', gDrivesListButton);
gIni.WriteBool('Layout', 'DirectoryTabs', gDirectoryTabs);
gIni.WriteBool('Layout', 'CurDir', gCurDir);
gIni.WriteBool('Layout', 'TabHeader', gTabHeader);
@ -1419,6 +1426,18 @@ procedure LoadXmlConfig;
gConfig.GetFont(Node, '', FontOptions.Name, FontOptions.Size, Integer(FontOptions.Style),
FontOptions.Name, FontOptions.Size, Integer(FontOptions.Style));
end;
procedure LoadOption(Node: TXmlNode; var Options: TDrivesListButtonOptions; Option: TDrivesListButtonOption; AName: String);
var
Value: Boolean;
begin
if gConfig.TryGetValue(Node, AName, Value) then
begin
if Value then
Include(Options, Option)
else
Exclude(Options, Option);
end;
end;
var
Root, Node, SubNode: TXmlNode;
LoadedConfigVersion: Integer;
@ -1517,7 +1536,19 @@ begin
gDriveBar1 := GetValue(Node, 'DriveBar1', gDriveBar1);
gDriveBar2 := GetValue(Node, 'DriveBar2', gDriveBar2);
gDriveBarFlat := GetValue(Node, 'DriveBarFlat', gDriveBarFlat);
gDriveMenuButton := GetValue(Node, 'DriveMenuButton', gDriveMenuButton);
if LoadedConfigVersion < 3 then
gDrivesListButton := GetValue(Node, 'DriveMenuButton', gDrivesListButton)
else
begin
SubNode := Node.FindNode('DrivesListButton');
if Assigned(SubNode) then
begin
gDrivesListButton := GetAttr(SubNode, 'Enabled', gDrivesListButton);
LoadOption(SubNode, gDrivesListButtonOptions, dlbShowLabel, 'ShowLabel');
LoadOption(SubNode, gDrivesListButtonOptions, dlbShowFileSystem, 'ShowFileSystem');
LoadOption(SubNode, gDrivesListButtonOptions, dlbShowFreeSpace, 'ShowFreeSpace');
end;
end;
gDirectoryTabs := GetValue(Node, 'DirectoryTabs', gDirectoryTabs);
gCurDir := GetValue(Node, 'CurrentDirectory', gCurDir);
gTabHeader := GetValue(Node, 'TabHeader', gTabHeader);
@ -1800,7 +1831,11 @@ begin
SetValue(Node, 'DriveBar1', gDriveBar1);
SetValue(Node, 'DriveBar2', gDriveBar2);
SetValue(Node, 'DriveBarFlat', gDriveBarFlat);
SetValue(Node, 'DriveMenuButton', gDriveMenuButton);
SubNode := FindNode(Node, 'DrivesListButton', True);
SetAttr(SubNode, 'Enabled', gDrivesListButton);
SetValue(SubNode, 'ShowLabel', dlbShowLabel in gDrivesListButtonOptions);
SetValue(SubNode, 'ShowFileSystem', dlbShowFileSystem in gDrivesListButtonOptions);
SetValue(SubNode, 'ShowFreeSpace', dlbShowFreeSpace in gDrivesListButtonOptions);
SetValue(Node, 'DirectoryTabs', gDirectoryTabs);
SetValue(Node, 'CurrentDirectory', gCurDir);
SetValue(Node, 'TabHeader', gTabHeader);

View file

@ -338,6 +338,7 @@ resourcestring
rsOptionsEditorCustomColumns = 'Custom columns';
rsOptionsEditorConfiguration = 'Configuration';
rsOptionsEditorDragAndDrop = 'Drag & drop';
rsOptionsEditorDrivesListButton = 'Drives list button';
rsOptionsEditorFileOperations = 'File operations';
rsOptionsEditorFilePanels = 'File panels';
rsOptionsEditorFileTypes = 'File types';