* now lhelp tabs are not shown if the items they represent are not available

git-svn-id: trunk@17669 -
This commit is contained in:
andrew 2008-12-03 03:36:09 +00:00
parent 9a205e2a39
commit 45a0a8e636

View File

@ -259,6 +259,8 @@ var
Stream: TMemoryStream; Stream: TMemoryStream;
fChm: TChmReader; fChm: TChmReader;
ParentNode: TTreeNode; ParentNode: TTreeNode;
i: Integer;
HasSearchIndex: Boolean = False;
begin begin
if fFillingToc = True then begin if fFillingToc = True then begin
Application.QueueAsyncCall(@FillToc, Data); Application.QueueAsyncCall(@FillToc, Data);
@ -283,8 +285,10 @@ begin
DoFill(ParentNode); DoFill(ParentNode);
Free; Free;
end; end;
Stream.Free;
end; end;
Stream.Free; fContentsTab.TabVisible := fContentsTree.Items.Count > 1;
// we fill the index here too but only for the main file // we fill the index here too but only for the main file
if fChms.IndexOfObject(fChm) < 1 then if fChms.IndexOfObject(fChm) < 1 then
begin begin
@ -299,15 +303,24 @@ begin
end; end;
end; end;
end; end;
fIndexTab.TabVisible := fIndexView.Items.Count > 0;
if ParentNode.Index = 0 then ParentNode.Expanded := True; if ParentNode.Index = 0 then ParentNode.Expanded := True;
fContentsTree.Visible := True; fContentsTree.Visible := True;
{$IFDEF CHM_DEBUG_TIME} {$IFDEF CHM_DEBUG_TIME}
writeln('Eind: ',FormatDateTime('hh:nn:ss.zzz', Now)); writeln('Eind: ',FormatDateTime('hh:nn:ss.zzz', Now));
{$ENDIF} {$ENDIF}
fFillingToc := False; fFillingToc := False;
i := 0;
while (HasSearchIndex = False) and (i < fChms.Count) do
begin
HasSearchIndex := fChms.Chm[i].ObjectExists('/$FIftiMain') > 0;
inc(i);
end;
fSearchTab.TabVisible := HasSearchIndex;
end; end;
procedure TChmContentProvider.IpHtmlPanelDocumentOpen(Sender: TObject); procedure TChmContentProvider.IpHtmlPanelDocumentOpen(Sender: TObject);