mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Error message when open folder in "Quick view" mode
This commit is contained in:
parent
158bc5f7aa
commit
08560bb8f0
2 changed files with 42 additions and 21 deletions
|
|
@ -59,9 +59,18 @@ inherited frmViewer: TfrmViewer
|
|||
Position = poDefault
|
||||
SessionProperties = 'Height;Width;Left;Top;WindowState'
|
||||
ShowInTaskBar = stAlways
|
||||
object pnlLister: TPanel[0]
|
||||
object pnlFolder: TPanel[0]
|
||||
Left = 179
|
||||
Height = 437
|
||||
Height = 441
|
||||
Top = 0
|
||||
Width = 461
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 6
|
||||
end
|
||||
object pnlLister: TPanel[1]
|
||||
Left = 179
|
||||
Height = 441
|
||||
Top = 0
|
||||
Width = 461
|
||||
Align = alClient
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ type
|
|||
miSearchPrev: TMenuItem;
|
||||
miPrint: TMenuItem;
|
||||
miSearchNext: TMenuItem;
|
||||
pnlFolder: TPanel;
|
||||
pnlPreview: TPanel;
|
||||
pnlEditFile: TPanel;
|
||||
PanelEditImage: TPanel;
|
||||
|
|
@ -315,7 +316,7 @@ implementation
|
|||
uses
|
||||
FileUtil, IntfGraphics, uLng, uShowMsg, uGlobs, LCLType, LConvEncoding, DCClassesUtf8,
|
||||
uFindMmap, DCStrUtils, uDCUtils, LCLIntf, uDebug, uHotkeyManager, uConvEncoding,
|
||||
DCOSUtils, uOSUtils;
|
||||
DCBasicTypes, DCOSUtils, uOSUtils;
|
||||
|
||||
const
|
||||
HotkeysCategory = 'Viewer';
|
||||
|
|
@ -387,8 +388,11 @@ end;
|
|||
procedure TfrmViewer.LoadFile(const aFileName: UTF8String);
|
||||
var
|
||||
i: Integer;
|
||||
dwFileAttributes: TFileAttrs;
|
||||
begin
|
||||
if not mbFileExists(aFileName) then
|
||||
dwFileAttributes := mbFileGetAttr(aFileName);
|
||||
|
||||
if dwFileAttributes = faInvalidAttributes then
|
||||
begin
|
||||
ShowMessage(rsMsgErrNoFiles);
|
||||
Exit;
|
||||
|
|
@ -401,30 +405,37 @@ begin
|
|||
for i := 0 to Status.Panels.Count - 1 do
|
||||
Status.Panels[i].Text := '';
|
||||
|
||||
Screen.Cursor:=crHourGlass;
|
||||
Screen.Cursor:= crHourGlass;
|
||||
try
|
||||
bPlugin:= CheckPlugins(aFileName);
|
||||
if bPlugin then
|
||||
if FPS_ISDIR(dwFileAttributes) then
|
||||
begin
|
||||
Status.Panels[sbpPluginName].Text:= WlxPlugins.GetWLxModule(ActivePlugin).Name;
|
||||
ActivatePanel(pnlLister);
|
||||
end
|
||||
else if CheckGraphics(aFileName) then
|
||||
begin
|
||||
LoadGraphics(aFileName);
|
||||
ActivatePanel(pnlImage);
|
||||
ActivatePanel(pnlFolder);
|
||||
pnlFolder.Caption:= rsPropsFolder + ': ' + aFileName;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ViewerControl.FileName := aFileName; //handled by miProcess.Click
|
||||
ActivatePanel(pnlText);
|
||||
// miProcess.Click;
|
||||
end;
|
||||
bPlugin:= CheckPlugins(aFileName);
|
||||
if bPlugin then
|
||||
begin
|
||||
Status.Panels[sbpPluginName].Text:= WlxPlugins.GetWLxModule(ActivePlugin).Name;
|
||||
ActivatePanel(pnlLister);
|
||||
end
|
||||
else if CheckGraphics(aFileName) then
|
||||
begin
|
||||
LoadGraphics(aFileName);
|
||||
ActivatePanel(pnlImage);
|
||||
end
|
||||
else
|
||||
begin
|
||||
ViewerControl.FileName := aFileName;
|
||||
ActivatePanel(pnlText);
|
||||
end;
|
||||
|
||||
Status.Panels[sbpFileName].Text:=aFileName;
|
||||
Status.Panels[sbpFileSize].Text:= cnvFormatFileSize(ViewerControl.FileSize) + ' (100 %)';
|
||||
Status.Panels[sbpFileName].Text:= aFileName;
|
||||
Status.Panels[sbpFileSize].Text:= cnvFormatFileSize(ViewerControl.FileSize) + ' (100 %)';
|
||||
end;
|
||||
finally
|
||||
Screen.Cursor:=crDefault;
|
||||
Screen.Cursor:= crDefault;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -2063,6 +2074,7 @@ end;
|
|||
|
||||
procedure TfrmViewer.ActivatePanel(Panel: TPanel);
|
||||
begin
|
||||
pnlFolder.Hide;
|
||||
pnlLister.Hide;
|
||||
pnlImage.Hide;
|
||||
pnlText.Hide;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue