IDE: started IDE debug window About FPC

git-svn-id: trunk@27587 -
This commit is contained in:
mattias 2010-10-06 17:32:57 +00:00
parent e70299b39d
commit 62165a2e64
9 changed files with 224 additions and 8 deletions

2
.gitattributes vendored
View File

@ -3677,6 +3677,8 @@ ide/idecmdline.pas svneol=native#text/plain
ide/idecontexthelpedit.lfm svneol=native#text/plain
ide/idecontexthelpedit.pas svneol=native#text/plain
ide/idedefs.pas svneol=native#text/pascal
ide/idefpcinfo.lfm svneol=native#text/plain
ide/idefpcinfo.pas svneol=native#text/plain
ide/ideoptiondefs.pas svneol=native#text/pascal
ide/ideoptionsdlg.lfm svneol=native#text/plain
ide/ideoptionsdlg.pas svneol=native#text/pascal

23
ide/idefpcinfo.lfm Normal file
View File

@ -0,0 +1,23 @@
object IDEFPCInfoDialog: TIDEFPCInfoDialog
Left = 275
Height = 450
Top = 250
Width = 704
Caption = 'IDEFPCInfoDialog'
ClientHeight = 450
ClientWidth = 704
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
object Memo1: TMemo
Left = 0
Height = 450
Top = 0
Width = 704
Align = alClient
Lines.Strings = (
'Memo1'
)
TabOrder = 0
end
end

171
ide/idefpcinfo.pas Normal file
View File

@ -0,0 +1,171 @@
{
***************************************************************************
* *
* This source 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 code 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. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Author: Mattias Gaertner
Abstract:
IDE dialog showing stats about the used FPC.
}
unit IDEFPCInfo;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
FileProcs, DefineTemplates,
BaseBuildManager, Project, EnvironmentOpts, LazarusIDEStrConsts, AboutFrm;
type
{ TIDEFPCInfoDialog }
TIDEFPCInfoDialog = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
procedure UpdateMemo;
procedure GatherIDEVersion(sl: TStrings);
procedure GatherEnvironmentVars(sl: TStrings);
procedure GatherGlobalOptions(sl: TStrings);
procedure GatherProjectOptions(sl: TStrings);
procedure GatherActiveOptions(sl: TStrings);
procedure GatherFPCCfg(sl: TStrings);
public
end;
function ShowFPCInfo: TModalResult;
implementation
function ShowFPCInfo: TModalResult;
var
Dlg: TIDEFPCInfoDialog;
begin
Dlg:=TIDEFPCInfoDialog.Create(nil);
try
Result:=Dlg.ShowModal;
finally
Dlg.Free;
end;
end;
{$R *.lfm}
{ TIDEFPCInfoDialog }
procedure TIDEFPCInfoDialog.FormCreate(Sender: TObject);
begin
Caption:='Information about used FPC';
UpdateMemo;
end;
procedure TIDEFPCInfoDialog.UpdateMemo;
var
sl: TStringList;
begin
sl:=TStringList.Create;
try
GatherIDEVersion(sl);
GatherEnvironmentVars(sl);
GatherGlobalOptions(sl);
GatherProjectOptions(sl);
GatherActiveOptions(sl);
GatherFPCCfg(sl);
Memo1.Lines.Assign(sl);
finally
sl.Free;
end;
end;
procedure TIDEFPCInfoDialog.GatherIDEVersion(sl: TStrings);
const
LazarusVersionStr= {$I version.inc};
begin
sl.Add('Lazarus version: '+GetLazarusVersionString);
sl.Add('Lazarus svn revision: '+LazarusRevisionStr);
sl.Add('Lazarus build date: '+{$I %date%});
sl.Add('Lazarus was compiled for '+GetCompiledTargetCPU+'-'+GetCompiledTargetOS);
sl.Add('Lazarus was compiled with fpc '+{$I %FPCVERSION%});
sl.Add('');
end;
procedure TIDEFPCInfoDialog.GatherEnvironmentVars(sl: TStrings);
procedure Add(EnvName: string);
begin
sl.Add(EnvName+'='+GetEnvironmentVariableUTF8(EnvName));
end;
begin
sl.Add('Environment variables:');
Add('PATH');
Add('PP');
Add('FPCDIR');
Add('USESVN2REVISIONINC');
Add('USER');
Add('HOME');
Add('PWD');
Add('LANG');
Add('LANGUAGE');
sl.Add('');
end;
procedure TIDEFPCInfoDialog.GatherGlobalOptions(sl: TStrings);
begin
sl.add('Global IDE options:');
sl.Add('LazarusDirectory='+EnvironmentOptions.LazarusDirectory);
sl.Add('CompilerFilename='+EnvironmentOptions.CompilerFilename);
sl.Add('CompilerMessagesFilename='+EnvironmentOptions.CompilerMessagesFilename);
sl.Add('');
end;
procedure TIDEFPCInfoDialog.GatherProjectOptions(sl: TStrings);
begin
sl.Add('Project:');
if Project1<>nil then begin
sl.Add('lpi='+Project1.ProjectInfoFile);
sl.Add('Directory='+Project1.ProjectDirectory);
sl.Add('TargetOS='+Project1.CompilerOptions.TargetOS);
sl.Add('TargetCPU='+Project1.CompilerOptions.TargetCPU);
sl.Add('CompilerFilename='+Project1.CompilerOptions.CompilerPath);
end else begin
sl.Add('no project');
end;
sl.Add('');
end;
procedure TIDEFPCInfoDialog.GatherActiveOptions(sl: TStrings);
begin
sl.Add('Active target:');
sl.Add('TargetOS='+BuildBoss.GetTargetOS(true));
sl.Add('TargetCPU='+BuildBoss.GetTargetCPU(true));
sl.Add('');
end;
procedure TIDEFPCInfoDialog.GatherFPCCfg(sl: TStrings);
begin
sl.Add('');
end;
end.

View File

@ -53,7 +53,7 @@
<PackageName Value="SynEdit"/>
</Item5>
</RequiredPackages>
<Units Count="71">
<Units Count="72">
<Unit0>
<Filename Value="lazarus.pp"/>
<IsPartOfProject Value="True"/>
@ -538,6 +538,13 @@
<IsPartOfProject Value="True"/>
<UnitName Value="FPCSrcScan"/>
</Unit70>
<Unit71>
<Filename Value="idefpcinfo.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="IDEFPCInfoDialog"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="IDEFPCInfo"/>
</Unit71>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -304,6 +304,7 @@ resourcestring
lisMenuViewDebugEvents = 'Event Log';
lisMenuIDEInternals = 'IDE internals';
lisMenuPackageLinks = 'Package links ...';
lisMenuAboutFPC = 'About FPC';
lisMenuNewProject = 'New Project ...';
lisMenuNewProjectFromFile = 'New Project from file ...';

View File

@ -136,7 +136,7 @@ uses
PublishModule, EnvironmentOpts, TransferMacros, KeyMapping, IDETranslations,
IDEProcs, ExtToolDialog, ExtToolEditDlg, OutputFilter, JumpHistoryView,
BuildLazDialog, MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory,
ProcessList, InitialSetupDlgs, NewDialog, MakeResStrDlg,
IDEFPCInfo, ProcessList, InitialSetupDlgs, NewDialog, MakeResStrDlg,
DialogProcs, FindReplaceDialog, FindInFilesDlg, CodeExplorer, BuildFileDlg,
ProcedureList, ExtractProcDlg, FindRenameIdentifier, AbstractsMethodsDlg,
EmptyMethodsDlg, UnusedUnitsDlg, FindOverloadsDlg, CleanDirDlg,
@ -272,6 +272,7 @@ type
procedure mnuViewAnchorEditorClicked(Sender: TObject);
procedure mnuViewComponentPaletteClicked(Sender: TObject);
procedure mnuViewIDESpeedButtonsClicked(Sender: TObject);
procedure mnuViewFPCInfoClicked(Sender: TObject);
// project menu
procedure mnuNewProjectClicked(Sender: TObject);
@ -2419,6 +2420,8 @@ begin
itmViewAnchorEditor.OnClick := @mnuViewAnchorEditorClicked;
itmViewComponentPalette.OnClick := @mnuViewComponentPaletteClicked;
itmViewIDESpeedButtons.OnClick := @mnuViewIDESpeedButtonsClicked;
itmViewFPCInfo.OnClick:=@mnuViewFPCInfoClicked;
end;
end;
@ -2552,6 +2555,11 @@ begin
DoToggleViewIDESpeedButtons;
end;
procedure TMainIDE.mnuViewFPCInfoClicked(Sender: TObject);
begin
ShowFPCInfo;
end;
procedure TMainIDE.SetDesigning(AComponent: TComponent; Value: Boolean);
begin
SetComponentDesignMode(AComponent, Value);

View File

@ -220,6 +220,7 @@ type
itmViewDebugEvents: TIDEMenuCommand;
//itmViewIDEInternalsWindows: TIDEMenuSection;
itmViewPackageLinks: TIDEMenuCommand;
itmViewFPCInfo: TIDEMenuCommand;
// project menu
//mnuProject: TIDEMenuSection;

View File

@ -577,16 +577,17 @@ begin
begin
CreateMenuItem(itmViewDebugWindows,itmViewWatches,'itmViewWatches',lisMenuViewWatches,'debugger_watches');
CreateMenuItem(itmViewDebugWindows,itmViewBreakPoints,'itmViewBreakPoints',lisMenuViewBreakPoints,'debugger_breakpoints');
CreateMenuItem(itmViewDebugWindows,itmViewLocals,'itmViewLocals',lisMenuViewLocalVariables,'');
CreateMenuItem(itmViewDebugWindows,itmViewRegisters,'itmViewRegisters',lisMenuViewRegisters,'');
CreateMenuItem(itmViewDebugWindows,itmViewLocals,'itmViewLocals',lisMenuViewLocalVariables);
CreateMenuItem(itmViewDebugWindows,itmViewRegisters,'itmViewRegisters',lisMenuViewRegisters);
CreateMenuItem(itmViewDebugWindows,itmViewCallStack,'itmViewCallStack',lisMenuViewCallStack,'debugger_call_stack');
CreateMenuItem(itmViewDebugWindows,itmViewAssembler,'itmViewAssembler',lisMenuViewAssembler,'');
CreateMenuItem(itmViewDebugWindows,itmViewAssembler,'itmViewAssembler',lisMenuViewAssembler);
CreateMenuItem(itmViewDebugWindows,itmViewDebugEvents,'itmViewDebugEvents',lisMenuViewDebugEvents,''{'debugger_events'});
CreateMenuItem(itmViewDebugWindows,itmViewDebugOutput,'itmViewDebugOutput',lisMenuViewDebugOutput,'debugger_output');
end;
CreateMenuSubSection(ParentMI, itmViewIDEInternalsWindows, 'itmViewIDEInternalsWindows', lisMenuIDEInternals, '');
CreateMenuSubSection(ParentMI, itmViewIDEInternalsWindows, 'itmViewIDEInternalsWindows', lisMenuIDEInternals);
begin
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks, '');
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
end;
end;
end;

View File

@ -28,7 +28,9 @@
Author: Mattias Gaertner
Abstract:
Package links helps the IDE to find package filenames by name
Package links helps the IDE to find package filenames by name.
If you are searching for the dialog to see the package links: pkglinksdlg.pas
}
unit PackageLinks;