mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Bug [ 1945378 ] Crash on changing icon size
This commit is contained in:
parent
f5b855b4d1
commit
bcd89cdded
3 changed files with 67 additions and 48 deletions
|
|
@ -1,4 +1,5 @@
|
|||
17.05.2008 ADD: Feature Request [ 1951507 ] Wipe file
|
||||
03.07.2008 FIX: Bug [ 1945378 ] Crash on changing icon size
|
||||
17.05.2008 ADD: Feature Request [ 1951507 ] Wipe file
|
||||
02.05.2008 ADD: Feature Request [ 1880894 ] Open in tab directory under cursor (Ctrl+Up)
|
||||
28.04.2008 FIX: Bug [ 1953396 ] Error if "Directory hotlist" (Ctrl+D) is empty
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
|||
82
fmain.pas
82
fmain.pas
|
|
@ -340,6 +340,8 @@ type
|
|||
function ExecCmd(Cmd:string; param:string='') : Boolean;
|
||||
function ExecCmdEx(NumberOfButton:Integer) : Boolean;
|
||||
procedure UpdateWindowView;
|
||||
procedure LoadWindowState;
|
||||
procedure SaveWindowState;
|
||||
procedure SaveShortCuts;
|
||||
procedure LoadShortCuts;
|
||||
published
|
||||
|
|
@ -378,16 +380,7 @@ begin
|
|||
slCommandHistory.Free;
|
||||
end;
|
||||
|
||||
Left := gIni.ReadInteger('Configuration', 'Main.Left', Left);
|
||||
Top := gIni.ReadInteger('Configuration', 'Main.Top', Top);
|
||||
Width := gIni.ReadInteger('Configuration', 'Main.Width', Width);
|
||||
Height := gIni.ReadInteger('Configuration', 'Main.Height', Height);
|
||||
if gIni.ReadBool('Configuration', 'maximized', True) then
|
||||
Self.WindowState := wsMaximized;
|
||||
|
||||
|
||||
LoadTabs(nbLeft);
|
||||
LoadTabs(nbRight);
|
||||
LoadWindowState;
|
||||
|
||||
nbLeft.Options:=[nboShowCloseButtons];
|
||||
nbRight.Options:=[nboShowCloseButtons];
|
||||
|
|
@ -797,31 +790,13 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmMain.frmMainClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
var
|
||||
x:Integer;
|
||||
begin
|
||||
try
|
||||
(* Save columns widths *)
|
||||
with FrameLeft do
|
||||
begin
|
||||
for x:=0 to ColSet.GetColumnSet(ActiveColm).ColumnsCount - 1 do
|
||||
ColSet.GetColumnSet(ActiveColm).SetColumnWidth(x, dgPanel.ColWidths[x]);
|
||||
ColSet.GetColumnSet(ActiveColm).Save(gIni);
|
||||
try
|
||||
SaveWindowState;
|
||||
SaveGlobs;
|
||||
except
|
||||
end;
|
||||
|
||||
(* Save all tabs *)
|
||||
SaveTabs(nbLeft);
|
||||
SaveTabs(nbRight);
|
||||
|
||||
gIni.WriteInteger('Configuration', 'Main.Left', Left);
|
||||
gIni.WriteInteger('Configuration', 'Main.Top', Top);
|
||||
gIni.WriteInteger('Configuration', 'Main.Width', Width);
|
||||
gIni.WriteInteger('Configuration', 'Main.Height', Height);
|
||||
gIni.WriteBool('Configuration', 'maximized', (WindowState = wsMaximized));
|
||||
SaveGlobs; // must be last
|
||||
except
|
||||
end;
|
||||
Application.Terminate;
|
||||
Application.Terminate;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.frmMainKeyUp(Sender: TObject; var Key: Word;
|
||||
|
|
@ -2694,6 +2669,47 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.LoadWindowState;
|
||||
begin
|
||||
(* Load window bounds and state*)
|
||||
Left := gIni.ReadInteger('Configuration', 'Main.Left', Left);
|
||||
Top := gIni.ReadInteger('Configuration', 'Main.Top', Top);
|
||||
Width := gIni.ReadInteger('Configuration', 'Main.Width', Width);
|
||||
Height := gIni.ReadInteger('Configuration', 'Main.Height', Height);
|
||||
if gIni.ReadBool('Configuration', 'maximized', True) then
|
||||
Self.WindowState := wsMaximized;
|
||||
|
||||
(* Load all tabs *)
|
||||
LoadTabs(nbLeft);
|
||||
LoadTabs(nbRight);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.SaveWindowState;
|
||||
var
|
||||
x: Integer;
|
||||
begin
|
||||
try
|
||||
(* Save columns widths *)
|
||||
with FrameLeft do
|
||||
begin
|
||||
for x:=0 to ColSet.GetColumnSet(ActiveColm).ColumnsCount - 1 do
|
||||
ColSet.GetColumnSet(ActiveColm).SetColumnWidth(x, dgPanel.ColWidths[x]);
|
||||
ColSet.GetColumnSet(ActiveColm).Save(gIni);
|
||||
end;
|
||||
|
||||
(* Save all tabs *)
|
||||
SaveTabs(nbLeft);
|
||||
SaveTabs(nbRight);
|
||||
(* Save window bounds and state*)
|
||||
gIni.WriteInteger('Configuration', 'Main.Left', Left);
|
||||
gIni.WriteInteger('Configuration', 'Main.Top', Top);
|
||||
gIni.WriteInteger('Configuration', 'Main.Width', Width);
|
||||
gIni.WriteInteger('Configuration', 'Main.Height', Height);
|
||||
gIni.WriteBool('Configuration', 'maximized', (WindowState = wsMaximized));
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
// Save ShortCuts to config file
|
||||
procedure TfrmMain.SaveShortCuts;
|
||||
begin
|
||||
|
|
|
|||
30
uglobs.pas
30
uglobs.pas
|
|
@ -321,11 +321,6 @@ end;
|
|||
|
||||
procedure InitGlobs;
|
||||
begin
|
||||
{ Load location of configuration files }
|
||||
gIni := TIniFileEx.Create(gpCfgDir + 'doublecmd.ini');
|
||||
gUseIniInProgramDir := gIni.ReadBool('Configuration', 'UseIniInProgramDir', True);
|
||||
gIni.Free;
|
||||
|
||||
{ Create default configuration files if need }
|
||||
// main ini file
|
||||
if not mbFileExists(gpIniDir + 'doublecmd.ini') then
|
||||
|
|
@ -379,19 +374,20 @@ begin
|
|||
HotMan.Free;
|
||||
if Assigned(Actions) then
|
||||
Actions.Free;
|
||||
|
||||
{ Save location of configuration files }
|
||||
gIni := TIniFileEx.Create(gpCfgDir + 'doublecmd.ini');
|
||||
gIni.WriteBool('Configuration', 'UseIniInProgramDir', gUseIniInProgramDir);
|
||||
gIni.Free;
|
||||
|
||||
end;
|
||||
|
||||
function LoadGlobs : Boolean;
|
||||
var
|
||||
Ini: TIniFileEx;
|
||||
begin
|
||||
Result := False;
|
||||
DebugLn('Loading configuration...');
|
||||
InitGlobs;
|
||||
|
||||
{ Load location of configuration files }
|
||||
Ini := TIniFileEx.Create(gpCfgDir + 'doublecmd.ini');
|
||||
gUseIniInProgramDir := Ini.ReadBool('Configuration', 'UseIniInProgramDir', True);
|
||||
Ini.Free;
|
||||
|
||||
{ Layout page }
|
||||
|
||||
|
|
@ -538,7 +534,7 @@ end;
|
|||
|
||||
procedure SaveGlobs;
|
||||
var
|
||||
x:Integer;
|
||||
Ini: TIniFileEx;
|
||||
begin
|
||||
if gSaveDirHistory then
|
||||
glsDirHistory.SaveToFile(gpIniDir + 'dirhistory.txt');
|
||||
|
|
@ -645,11 +641,17 @@ begin
|
|||
//TODO: Save hotkeys
|
||||
//HotMan.Save();
|
||||
|
||||
DeInitGlobs;
|
||||
{ Save location of configuration files }
|
||||
try
|
||||
Ini:= TIniFileEx.Create(gpCfgDir + 'doublecmd.ini');
|
||||
Ini.WriteBool('Configuration', 'UseIniInProgramDir', gUseIniInProgramDir);
|
||||
finally
|
||||
Ini.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
finalization
|
||||
|
||||
DeInitGlobs;
|
||||
end.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue