Changeset 44 for trunk/NewView/MainForm.pas
- Timestamp:
- Jan 2, 2007, 8:30:33 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/MainForm.pas
r38 r44 830 830 ACLFileIOUtility, 831 831 ACLUtility, 832 ACLProfile,833 832 ACLDialogs, 834 833 ACLString, 835 834 RunProgramUnit, 836 835 StringUtilsUnit, 836 DebugUnit, 837 837 838 838 // Components … … 1160 1160 if SettingFont or StartingUp then 1161 1161 exit; 1162 ProfileEvent( 'SetTopicFont');1162 LogEvent(LogSettings, 'SetTopicFont'); 1163 1163 1164 1164 SettingFont := true; … … 1171 1171 Settings.NormalFont := NewFont; 1172 1172 1173 ProfileEvent( 'Saving settings');1173 LogEvent(LogSettings, 'Saving settings'); 1174 1174 1175 1175 SaveSettings; 1176 ProfileEvent( 'Applying settings');1176 LogEvent(LogSettings, 'Applying settings'); 1177 1177 ApplySettings; 1178 1178 1179 1179 SettingFont := false; 1180 ProfileEvent( 'SetTopicFont done');1180 LogEvent(LogSettings, 'SetTopicFont done'); 1181 1181 End; 1182 1182 … … 2263 2263 var 2264 2264 i: integer; 2265 tmpCmdLine: String;2266 tmpSplittedCmdLine : TStringList;2267 2265 tmpRc : Integer; 2268 2266 tmpWindowPosition : TWindowPosition; … … 2270 2268 with InformationForm.InformationMemo do 2271 2269 begin 2272 tmpCmdLine := nativeOS2GetCmdLineParameter;2273 tmpSplittedCmdLine := TStringList.Create;2274 2270 2275 2271 Lines.Clear; 2276 Lines.Add(ParameterCountLabel +IntToStr(tmpSplittedCmdLine.count));2277 tmpRc := splitCmdLineParameter(tmpCmdLine, tmpSplittedCmdLine);2278 for i := 0 to tmpSplittedCmdLine.Count -1 do2279 Lines.Add( ' '2280 + IntToStr( i )2281 + ' ['2282 + tmpSplittedCmdLine[i]2283 + ']' );2284 2285 tmpSplittedCmdLine.Destroy;2286 2272 Lines.Add(''); 2287 2273 Lines.Add('parsed infos:'); 2288 2274 Lines.Add('getShowUsageFlag: ' + boolToStr(CmdLineParameters.getShowUsageFlag)); 2289 Lines.Add('getSearch TextFlag: ' + boolToStr(CmdLineParameters.getSearchTextFlag));2275 Lines.Add('getSearchFlag: ' + boolToStr(CmdLineParameters.getSearchFlag)); 2290 2276 Lines.Add('getSearchText: ' + CmdLineParameters.getSearchText); 2291 Lines.Add('getGlobalSearchTextFlag: ' + boolToStr(CmdLineParameters.getGlobalSearchTextFlag)); 2292 Lines.Add('getGlobalSearchText: ' + CmdLineParameters.getGlobalSearchText); 2277 Lines.Add('getGlobalSearchFlag: ' + boolToStr(CmdLineParameters.getGlobalSearchFlag)); 2293 2278 Lines.Add('getLanguage: ' + CmdLineParameters.getLanguage); 2294 2279 Lines.Add('getHelpManagerFlag: ' + boolToStr(CmdLineParameters.getHelpManagerFlag)); … … 2306 2291 Lines.Add('getWindowTitle: ' + CmdLineParameters.getWindowTitle); 2307 2292 Lines.Add('getFileNames: ' + CmdLineParameters.getFileNames); 2308 Lines.Add('getTopics: ' + CmdLineParameters.getTopics);2309 2310 2293 end; 2311 2294 … … 2918 2901 FileIndex: longint; 2919 2902 Begin 2920 ProfileEvent( 'DisplayTopicInWindow');2903 LogEvent(LogDisplay, 'DisplayTopicInWindow'); 2921 2904 2922 2905 SetWaitCursor; … … 3020 3003 Var CanClose: Boolean); 3021 3004 Begin 3022 ProfileEvent( '-------- Shutdown ----------');3005 LogEvent(LogShutdown, '-------- Shutdown ----------'); 3023 3006 3024 3007 … … 3515 3498 S: string; 3516 3499 begin 3517 ProfileEvent( 'Load bookmarks for ' + HelpFile.Filename);3500 LogEvent(LogSettings, 'Load bookmarks for ' + HelpFile.Filename); 3518 3501 3519 3502 BookmarksFileName:= ChangeFileExt( HelpFile.FileName, '.bmk' ); … … 3564 3547 HelpFile: THelpFile; 3565 3548 begin 3566 ProfileEvent( 'Save notes');3549 LogEvent(LogSettings, 'Save notes'); 3567 3550 3568 3551 for FileIndex := 0 to CurrentOpenFiles.Count - 1 do … … 3581 3564 BookmarkCount: integer; 3582 3565 begin 3583 ProfileEvent( 'Save bookmarks for ' + HelpFile.Filename);3566 LogEvent(LogSettings, 'Save bookmarks for ' + HelpFile.Filename); 3584 3567 3585 3568 BookmarksFileName:= ChangeFileExt( HelpFile.FileName, '.bmk' ); … … 3644 3627 Procedure TMainForm.MainFormOnDestroy (Sender: TObject); 3645 3628 Begin 3646 ProfileEvent( 'MainFormOnDestroy' ); 3647 3648 ProfileEvent( 'Write window position' ); 3649 3629 LogEvent(LogShutdown, 'MainFormOnDestroy'); 3630 3631 LogEvent(LogSettings, 'Write window position'); 3650 3632 WriteWindowPos( self ); 3651 3633 3652 ProfileEvent( 'Update colors');3634 LogEvent(LogSettings, 'Update colors'); 3653 3635 GetColors; 3654 3636 3655 ProfileEvent( 'Save settings' ); 3656 3637 LogEvent(LogSettings, 'Save settings'); 3657 3638 SaveSettings; 3658 3659 ProfileEvent( ' Done' ); 3639 LogEvent(LogSettings, 'Save settings done'); 3660 3640 3661 3641 // else- don't save position/size if doing own help … … 3663 3643 TopicText.Destroy; 3664 3644 3665 ProfileEvent( 'Destroy MRU menu items');3645 LogEvent(LogShutdown, 'Destroy MRU menu items'); 3666 3646 MRUMenuItems.Destroy; 3667 3647 3668 ProfileEvent( 'Destroy navigate to menu items');3648 LogEvent(LogShutdown, 'Destroy navigate to menu items'); 3669 3649 NavigateToMenuItems.Destroy; 3670 3650 3671 ProfileEvent( 'Destroy pagehistory');3651 LogEvent(LogShutdown, 'Destroy pagehistory'); 3672 3652 PageHistory.Destroy; 3673 3653 3674 ProfileEvent( 'Clear/destroy notes');3654 LogEvent(LogShutdown, 'Clear/destroy notes'); 3675 3655 ClearNotes; 3676 3656 Notes.Destroy; 3677 3657 3678 ProfileEvent( 'Clear/destroy bookmarks');3658 LogEvent(LogShutdown, 'Clear/destroy bookmarks'); 3679 3659 ClearBookmarks; 3680 3660 Bookmarks.Destroy; 3681 3661 3682 ProfileEvent( 'Destroy bookmark menu items');3662 LogEvent(LogShutdown, 'Destroy bookmark menu items'); 3683 3663 BookmarksMenuItems.Destroy; 3684 3664 3685 ProfileEvent( 'Destroy files/index/windows');3665 LogEvent(LogShutdown, 'Destroy files/index/windows'); 3686 3666 CurrentOpenFiles.Destroy; 3687 3667 DisplayedIndex.Destroy; … … 3702 3682 g_CurrentLanguageFile.Destroy; 3703 3683 3704 ProfileEvent( 'Close global filelist');3684 LogEvent(LogShutdown, 'Close global filelist'); 3705 3685 GlobalFilelist.Destroy; 3706 3686 3707 ProfileEvent( 'Close shared memory');3687 LogEvent(LogShutdown, 'Close shared memory'); 3708 3688 SharedMemory.Destroy; 3709 3689 3710 3690 AllFilesWordSequences.Destroy; 3711 3691 3712 ProfileEvent( 'MainFormOnDestroy done');3692 LogEvent(LogShutdown, 'MainFormOnDestroy done'); 3713 3693 End; 3714 3694 3715 3695 Procedure TMainForm.MainFormOnSetupShow (Sender: TObject); 3716 3696 Begin 3717 ProfileEvent( 'OnSetupShow');3697 LogEvent(LogSettings, 'OnSetupShow'); 3718 3698 TabSet.TabIndex := 0; 3719 3699 Notebook.PageIndex := 0; … … 3843 3823 var 3844 3824 tmpCmdLine: String; 3845 tmpSplittedCmdLine : TStringList;3846 3825 tmpRc : Integer; 3847 3826 Begin 3848 ProfileEvent( 'MainFormOnCreate');3827 LogEvent(LogStartup, 'MainFormOnCreate'); 3849 3828 3850 3829 StartingUp := true; … … 3858 3837 // parse parameters into Parameters object 3859 3838 tmpCmdLine := nativeOS2GetCmdLineParameter; 3860 tmpSplittedCmdLine := TStringList.Create;3861 tmpRc := splitCmdLineParameter(tmpCmdLine, tmpSplittedCmdLine);3862 3839 CmdLineParameters := TCmdLineParameters.Create; 3863 CmdLineParameters.parseCmdLine(tmp SplittedCmdLine);3864 tmpSplittedCmdLine.destroy; 3840 CmdLineParameters.parseCmdLine(tmpCmdLine); 3841 3865 3842 RegisterForLanguages( OnLanguageEvent ); 3866 3843 … … 3885 3862 ContentsOutline.SmoothScroll := false; 3886 3863 3887 ProfileEvent( 'Choosing default font: Trying WarpSans');3864 LogEvent(LogStartup, 'Choosing default font: Trying WarpSans'); 3888 3865 3889 3866 Font := GetNiceDefaultFont; … … 3896 3873 // in TApplication.Run 3897 3874 3898 ProfileEvent( 'Starting NewView: MainFormOnCreate');3875 LogEvent(LogStartup, 'Starting NewView: MainFormOnCreate'); 3899 3876 3900 3877 Application.OnHint := OnHint; … … 3928 3905 NavigateToMenuItems := TList.Create; 3929 3906 3930 ProfileEvent( 'Loading settings');3907 LogEvent(LogSettings, 'Loading settings'); 3931 3908 3932 3909 LoadSettings; … … 3934 3911 3935 3912 // load default strings 3936 ProfileEvent( 'Loading language');3913 LogEvent(LogSettings, 'Loading language'); 3937 3914 3938 3915 if CmdLineParameters.getLanguage <> '' then … … 3941 3918 LoadDefaultLanguage( 'newview' ); 3942 3919 3943 ProfileEvent( 'Applying settings' ); 3944 3920 LogEvent(LogSettings, 'Applying settings'); 3945 3921 ApplySettings; 3946 3922 3947 3923 // default position is centered.. 3948 ProfileEvent( 'Set default position');3924 LogEvent(LogSettings, 'Set default position'); 3949 3925 if Width > Screen.Width then 3950 3926 Width := Screen.Width; … … 3954 3930 Bottom := ( Screen.Height - Height ) div 2; 3955 3931 3956 ProfileEvent( 'ReadWindowPos' ); 3957 3932 LogEvent(LogSettings, 'ReadWindowPos'); 3958 3933 ReadWindowPos( Self ); 3959 3934 3960 3935 PositionWindow; 3961 3936 3962 ProfileEvent( 'Creating MRU list');3937 LogEvent(LogSettings, 'Creating MRU list'); 3963 3938 3964 3939 CreateMRUMenuItems; … … 3966 3941 CloseFile; 3967 3942 3968 ProfileEvent( 'OnCreate done');3943 LogEvent(LogStartup, 'OnCreate done'); 3969 3944 3970 3945 if CmdLineParameters.getWindowPositionFlag then … … 3978 3953 end; 3979 3954 3980 ProfileEvent( 'MainFormOnCreate Done');3955 LogEvent(LogStartup, 'MainFormOnCreate Done'); 3981 3956 End; 3982 3957 … … 4075 4050 EnableCallstackLogging( true ); 4076 4051 4077 ProfileEvent( 'MainFormOnShow');4052 LogEvent(LogStartup, 'MainFormOnShow'); 4078 4053 4079 4054 if CmdLineParameters.getOwnerWindow <> NULLHANDLE then 4080 4055 begin 4081 ProfileEvent('Setting owner: '4082 + IntToStr( CmdLineParameters.getOwnerWindow ));4056 LogEvent(LogStartup, 'Setting owner: ' 4057 + IntToStr( CmdLineParameters.getOwnerWindow)); 4083 4058 WinSetOwner( Frame.Handle, 4084 4059 CmdLineParameters.getOwnerWindow ); … … 4088 4063 if CmdLineParameters.getHelpManagerFlag then 4089 4064 begin 4090 ProfileEvent(' Help Manager Title: '4065 LogEvent(LogStartup, ' Help Manager Title: ' 4091 4066 + StrNPas( pSharedStruct ^. Title, 4092 4067 SHARED_STRUCT_TITLE_SIZE ) ); 4093 4068 HelpManagerVersion := StrNPas( pSharedStruct ^. Version, 4094 4069 SHARED_STRUCT_VERSION_SIZE ); 4095 ProfileEvent( ' Help Manager Version: ' 4096 + HelpManagerVersion ); 4070 LogEvent(LogStartup, ' Help Manager Version: ' + HelpManagerVersion ); 4097 4071 4098 4072 end; … … 4100 4074 CoolBar.SetMinConstButtonWidth; 4101 4075 4102 ProfileEvent( 'Post WM_OPENED');4076 LogEvent(LogStartup, 'Post WM_OPENED'); 4103 4077 4104 4078 ResetProgress; … … 4189 4163 LoadSupportDLL; 4190 4164 4191 ProfileEvent( 'WMOpened: SetLayout');4165 LogEvent(LogStartup, 'WMOpened: SetLayout'); 4192 4166 4193 4167 if CmdLineParameters.getHelpManagerFlag then … … 4201 4175 // ApplySettings; 4202 4176 4203 ProfileEvent( 'Enable controls');4177 LogEvent(LogStartup, 'Enable controls'); 4204 4178 EnableControls; 4205 4179 … … 4207 4181 // ReadWindowPos( Self ); 4208 4182 4209 ProfileEvent( 'Finish paint');4183 LogEvent(LogStartup, 'Finish paint'); 4210 4184 Update; 4211 4185 4212 4186 if not CmdLineParameters.getHelpManagerFlag then 4213 4187 begin 4214 ProfileEvent( 'Check environment vars');4188 LogEvent(LogStartup, 'Check environment vars'); 4215 4189 CheckEnvironmentVars; 4216 4190 4217 4191 if CmdLineParameters.getShowUsageFlag then 4218 4192 begin 4219 ProfileEvent( 'Showing usage');4193 LogEvent(LogStartup, 'Showing usage'); 4220 4194 ShowUsage; 4221 4195 exit; … … 4233 4207 StringToList(cmdLineParameters.getFileNames, Filenames, '+' ); 4234 4208 4235 ProfileEvent( 'Call OpenFiles');4209 LogEvent(LogStartup, 'Call OpenFiles'); 4236 4210 4237 4211 OpenFirstTopic := true; 4238 if ( CmdLineParameters.getTopics<> '' )4239 or CmdLineParameters.getSearch TextFlag then4212 if ( CmdLineParameters.getSearchText <> '' ) 4213 or CmdLineParameters.getSearchFlag then 4240 4214 // if we're going to search, don't open first topic 4241 4215 OpenFirstTopic := false; … … 4253 4227 Filenames.Destroy; 4254 4228 4255 if CmdLineParameters.get Topics<> '' then4229 if CmdLineParameters.getSearchText <> '' then 4256 4230 begin 4257 4231 // search in contents only! 4258 ProfileEvent( 'Do startup topic search');4259 4260 StartupTopicSearch( CmdLineParameters.get Topics);4232 LogEvent(LogStartup, 'Do startup topic search'); 4233 4234 StartupTopicSearch( CmdLineParameters.getSearchText ); 4261 4235 end 4262 else if CmdLineParameters.getSearch TextFlag then4236 else if CmdLineParameters.getSearchFlag then 4263 4237 begin 4264 4238 // search in specified files 4265 ProfileEvent( 'Do search for topic');4239 LogEvent(LogStartup, 'Do search for topic'); 4266 4240 DisplaySearch; 4267 4241 … … 4270 4244 end; 4271 4245 4272 if CmdLineParameters.getGlobalSearch TextFlag then4246 if CmdLineParameters.getGlobalSearchFlag then 4273 4247 begin 4274 4248 // Global search 4275 ProfileEvent( 'Do global search: ' + CmdLineParameters.getGlobalSearchText );4276 DoGlobalSearch( CmdLineParameters.get GlobalSearchText );4249 LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getSearchText ); 4250 DoGlobalSearch( CmdLineParameters.getSearchText ); 4277 4251 end; 4278 4252 4279 4253 if ( length(CmdLineParameters.getFileNames) = 0 ) 4280 and ( not CmdLineParameters.get GlobalSearchTextFlag ) then4254 and ( not CmdLineParameters.getSearchFlag ) then 4281 4255 begin 4282 4256 // user hasn't requested any particular file … … 4299 4273 end; 4300 4274 4301 ProfileEvent( 'Open finished');4275 LogEvent(LogStartup, 'Open finished'); 4302 4276 4303 4277 if CmdLineParameters.getHelpManagerFlag then … … 4313 4287 StartingUp := false; 4314 4288 4315 ProfileEvent( 'RUN PROGRAM');4289 LogEvent(LogStartup, 'RUN PROGRAM'); 4316 4290 end; 4317 4291 … … 4401 4375 - Notebook.Bottom; 4402 4376 4403 ProfileEvent( 'TMainForm.SetLayout');4404 ProfileEvent( ' RealClientHeight: ' + IntToStr( RealClientHeight ));4405 4406 ProfileEvent( ' Form Width: ' + IntToStr( Width ));4407 ProfileEvent(' Form Height: ' + IntToStr( Height ) );4408 ProfileEvent(' Form ClientWidth: ' + IntToStr( ClientWidth ) );4409 ProfileEvent(' Form ClientHeight: ' + IntToStr( ClientHeight ) );4410 ProfileEvent(' CoolBar.Height: ' + IntToStr( CoolBar.Height ) );4411 ProfileEvent(' CoolBar.Bottom: ' + IntToStr( CoolBar.Bottom ) );4377 LogEvent(LogStartup, 'TMainForm.SetLayout'); 4378 LogEvent(LogStartup, ' RealClientHeight: ' + IntToStr( RealClientHeight )); 4379 4380 LogEvent(LogStartup, ' Form Width: ' + IntToStr( Width )); 4381 LogEvent(LogStartup, ' Form Height: ' + IntToStr( Height ) ); 4382 LogEvent(LogStartup, ' Form ClientWidth: ' + IntToStr( ClientWidth ) ); 4383 LogEvent(LogStartup, ' Form ClientHeight: ' + IntToStr( ClientHeight ) ); 4384 LogEvent(LogStartup, ' CoolBar.Height: ' + IntToStr( CoolBar.Height ) ); 4385 LogEvent(LogStartup, ' CoolBar.Bottom: ' + IntToStr( CoolBar.Bottom ) ); 4412 4386 4413 4387 if CurrentOpenFiles.Count > 0 then … … 4449 4423 DisplayPanel.Width:= ClientWidth - DisplayPanel.Left; 4450 4424 DisplayPanel.Height := RealClientHeight; 4451 ProfileEvent(' DisplayPanel.Width: ' + IntToStr( DisplayPanel.Width ) );4452 ProfileEvent(' DisplayPanel.Height: ' + IntToStr( DisplayPanel.Height ) );4453 ProfileEvent(' DisplayPanel.Bottom: ' + IntToStr( DisplayPanel.Bottom ) );4425 LogEvent(LogStartup, ' DisplayPanel.Width: ' + IntToStr( DisplayPanel.Width ) ); 4426 LogEvent(LogStartup, ' DisplayPanel.Height: ' + IntToStr( DisplayPanel.Height ) ); 4427 LogEvent(LogStartup, ' DisplayPanel.Bottom: ' + IntToStr( DisplayPanel.Bottom ) ); 4454 4428 4455 4429 ProgressBar.Left:= 1; … … 5777 5751 begin 5778 5752 ContentsOutline.BeginUpdate; 5779 ProfileEvent( 'Load contents outline');5753 LogEvent(LogStartup, 'Load contents outline'); 5780 5754 5781 5755 // we don't clear it first, to allow adding additional files 5782 5756 // into the contents tree 5783 5757 5784 ProfileEvent( 'Loop files');5758 LogEvent(LogStartup, 'Loop files'); 5785 5759 5786 5760 FirstNode := nil; … … 5791 5765 begin 5792 5766 HelpFile := Files[ FileIndex ]; 5793 ProfileEvent('File ' + IntToStr( FileIndex ) );5767 LogEvent(LogStartup, 'File ' + IntToStr( FileIndex ) ); 5794 5768 TopicIndex := 0; 5795 5769 while TopicIndex < HelpFile.TopicCount do … … 5826 5800 end; 5827 5801 end; 5828 ProfileEvent(' EndUpdate' );5802 LogEvent(LogStartup, ' EndUpdate' ); 5829 5803 ContentsOutline.EndUpdate; 5830 5804 5831 5805 if Settings.OpenWithExpandedContents then 5832 5806 begin 5833 ProfileEvent(' Expand all contents' );5807 LogEvent(LogStartup, ' Expand all contents' ); 5834 5808 ContentsOutline.ExpandAll 5835 5809 end 5836 5810 else if ContentsOutline.ChildCount = 1 then 5837 5811 begin 5838 ProfileEvent(' Expand first node' );5812 LogEvent(LogStartup, ' Expand first node' ); 5839 5813 // Contents has only one top level node... expand it 5840 5814 FirstNode.Expand; … … 5842 5816 5843 5817 ContentsLoaded := true; 5844 ProfileEvent(' Contents loaded' );5818 LogEvent(LogStartup, ' Contents loaded' ); 5845 5819 5846 5820 end; … … 5860 5834 5861 5835 begin 5862 ProfileEvent('Save notes for ' + HelpFile.Filename );5836 LogEvent(LogStartup, 'Save notes for ' + HelpFile.Filename ); 5863 5837 5864 5838 if not HelpFile.NotesLoaded then … … 5867 5841 exit; 5868 5842 5869 ProfileEvent('Really saving' );5843 LogEvent(LogStartup, 'Really saving' ); 5870 5844 5871 5845 NotesFileName := ChangeFileExt( HelpFile.FileName, '.nte' ); … … 5953 5927 5954 5928 begin 5955 ProfileEvent('Load notes for ' + HelpFile.Filename );5929 LogEvent(LogStartup, 'Load notes for ' + HelpFile.Filename ); 5956 5930 5957 5931 if HelpFile.NotesLoaded then … … 6119 6093 StopPrinting; 6120 6094 6121 ProfileEvent('Set Caption' );6095 LogEvent(LogShutdown, 'Set Caption' ); 6122 6096 MainTitle := ''; 6123 6097 SetMainCaption; 6124 6098 6125 ProfileEvent('Close Windows' );6099 LogEvent(LogShutdown, 'Close Windows' ); 6126 6100 CloseWindows; 6127 ProfileEvent( 'Set selected node to nil' ); 6128 6101 6102 LogEvent(LogShutdown, 'Set selected node to nil' ); 6129 6103 ContentsOutline.SelectedNode:= Nil; 6130 6104 6131 6105 M1:= MemAvail; 6132 6106 6133 ProfileEvent( 'Clear contents outline' ); 6134 6107 LogEvent(LogShutdown, 'Clear contents outline' ); 6135 6108 ContentsOutline.Clear; 6136 6109 6137 ProfileEvent('Free contents: ' + IntToStr( MemAvail - M1 ) );6110 LogEvent(LogShutdown, 'Free contents: ' + IntToStr( MemAvail - M1 ) ); 6138 6111 M1:= MemAvail; 6139 6112 6140 6113 DisplayedIndex.Clear; 6141 6114 IndexListBox.Clear; 6142 ProfileEvent('Clear index ' + IntToStr( MemAvail - M1 ) );6115 LogEvent(LogShutdown, 'Clear index ' + IntToStr( MemAvail - M1 ) ); 6143 6116 M1:= MemAvail; 6144 6117 … … 6146 6119 SearchResultsListBox.Clear; 6147 6120 6148 ProfileEvent('Notes, search etc ' + IntToStr( MemAvail - M1 ) );6121 LogEvent(LogShutdown, 'Notes, search etc ' + IntToStr( MemAvail - M1 ) ); 6149 6122 M1:= MemAvail; 6150 6123 … … 6159 6132 ClearAllWordSequences; 6160 6133 6161 ProfileEvent('Destroy helpfile objects' );6134 LogEvent(LogShutdown, 'Destroy helpfile objects' ); 6162 6135 6163 6136 // Now destroy help files … … 6172 6145 CurrentOpenFiles.Clear; 6173 6146 6174 ProfileEvent('Destroy helpfiles ' + IntToStr( MemAvail - M1 ) );6147 LogEvent(LogShutdown, 'Destroy helpfiles ' + IntToStr( MemAvail - M1 ) ); 6175 6148 M1 := MemAvail; 6176 6149 6177 ProfileEvent('Clear notes' );6150 LogEvent(LogShutdown, 'Clear notes' ); 6178 6151 ClearNotes; 6179 6152 6180 ProfileEvent('Clear bookmarks' );6153 LogEvent(LogShutdown, 'Clear bookmarks' ); 6181 6154 ClearBookmarks; 6182 6155 6183 6156 ClearPageHistory; 6184 6157 6185 ProfileEvent('Enable controls' );6158 LogEvent(LogShutdown, 'Enable controls' ); 6186 6159 EnableControls; 6187 6160 6188 ProfileEvent('CloseFile done' );6161 LogEvent(LogShutdown, 'CloseFile done' ); 6189 6162 6190 6163 end; … … 6241 6214 i : longint; 6242 6215 begin 6243 ProfileEvent('Create index' );6216 LogEvent(LogStartup, 'Create index' ); 6244 6217 6245 6218 SetWaitCursor; 6246 6219 6247 ProfileEvent(' Get/sort lists' );6220 LogEvent(LogStartup, ' Get/sort lists' ); 6248 6221 6249 6222 ProgressBar.Position := 70; … … 6294 6267 ProgressBar.Position := 80; 6295 6268 6296 ProfileEvent(' Merge lists' );6269 LogEvent(LogStartup, ' Merge lists' ); 6297 6270 6298 6271 pLastEntry := NullStr; … … 6397 6370 6398 6371 ProgressBar.Position := 95; 6399 ProfileEvent(' Display index (count = '6372 LogEvent(LogStartup, ' Display index (count = ' 6400 6373 + IntToStr( DisplayedIndex.Count ) 6401 6374 + ')' ); … … 6404 6377 IndexListBox.Items.Assign( DisplayedIndex ); 6405 6378 6406 ProfileEvent(' Tidy up' );6379 LogEvent(LogStartup, ' Tidy up' ); 6407 6380 6408 6381 IndexLists.Destroy; … … 6415 6388 6416 6389 SetStatus( 'Index loaded' ); 6417 ProfileEvent(' Done' );6390 LogEvent(LogStartup, ' Done' ); 6418 6391 end; 6419 6392 … … 6527 6500 RequiredFileHandles: LONG; 6528 6501 begin 6529 ProfileEvent('LoadFiles' );6502 LogEvent(LogStartup, 'LoadFiles' ); 6530 6503 6531 6504 LoadingFilenameList := TStringList.Create; … … 6533 6506 TranslateIPFEnvironmentVars( FileNames, LoadingFilenameList ); 6534 6507 6535 ProfileEvent('Finding files' );6508 LogEvent(LogStartup, 'Finding files' ); 6536 6509 6537 6510 ProgressBar.Show; … … 6542 6515 begin 6543 6516 FileName := LoadingFilenameList[ FileIndex ]; 6544 ProfileEvent(' File: ' + FileName );6517 LogEvent(LogStartup, ' File: ' + FileName ); 6545 6518 6546 6519 // Find the help file, if possible … … 6548 6521 if FullFilePath <> '' then 6549 6522 begin 6550 ProfileEvent(' Full path: ' + FullFilePath );6523 LogEvent(LogStartup, ' Full path: ' + FullFilePath ); 6551 6524 end 6552 6525 else 6553 6526 begin 6554 ProfileEvent(' File not found' );6527 LogEvent(LogStartup, ' File not found' ); 6555 6528 FullFilePath := FileName; // we'll complain later. 6556 6529 end; … … 6579 6552 begin 6580 6553 Filename := LoadingFilenameList[ FileIndex ]; 6581 ProfileEvent(' Loading: ' + Filename );6554 LogEvent(LogStartup, ' Loading: ' + Filename ); 6582 6555 try 6583 6556 LoadingFileIndex := FileIndex; … … 6659 6632 FileIndex: longint; 6660 6633 begin 6661 ProfileEvent('DisplayFiles' );6634 LogEvent(LogStartup, 'DisplayFiles' ); 6662 6635 // Now load the various parts of the file(s) 6663 6636 // into the user interface … … 6693 6666 SetStatus( LoadingStatusDone ); 6694 6667 6695 ProfileEvent('DisplayFiles Done' );6668 LogEvent(LogStartup, 'DisplayFiles Done' ); 6696 6669 6697 6670 end; … … 6704 6677 FirstContentsNode: TNode; 6705 6678 begin 6706 ProfileEvent('OpenFiles' );6679 LogEvent(LogStartup, 'OpenFiles' ); 6707 6680 6708 6681 if not OKToCloseFile then … … 6761 6734 if FirstContentsNode <> nil then 6762 6735 begin 6763 ProfileEvent(' Select first node' );6736 LogEvent(LogStartup, ' Select first node' ); 6764 6737 ContentsOutline.SelectedNode := FirstContentsNode; 6765 6738 end; … … 6775 6748 if DisplayFirstTopic then 6776 6749 begin 6777 ProfileEvent('Display first topic' );6750 LogEvent(LogStartup, 'Display first topic' ); 6778 6751 DisplaySelectedContentsTopic; 6779 6752 end; 6780 6753 6781 ProfileEvent('OpenFiles complete' );6754 LogEvent(LogStartup, 'OpenFiles complete' ); 6782 6755 end; 6783 6756 … … 6788 6761 FirstNewContentsNode: TNode; 6789 6762 begin 6790 ProfileEvent('OpenAdditionalFiles' );6763 LogEvent(LogStartup, 'OpenAdditionalFiles' ); 6791 6764 6792 6765 if not OKToCloseFile then … … 6829 6802 DisplaySelectedContentsTopic; 6830 6803 6831 ProfileEvent('OpenAdditionalFiles complete' );6804 LogEvent(LogStartup, 'OpenAdditionalFiles complete' ); 6832 6805 end; 6833 6806
Note:
See TracChangeset
for help on using the changeset viewer.