mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:30:33 +02:00
IDE: added dialog: View / IDE internals / modified items
git-svn-id: trunk@34686 -
This commit is contained in:
parent
5c78a96a5e
commit
d56af331dd
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4272,6 +4272,8 @@ ide/idehelpmanager.pas svneol=native#text/pascal
|
|||||||
ide/ideinfodlg.lfm svneol=native#text/plain
|
ide/ideinfodlg.lfm svneol=native#text/plain
|
||||||
ide/ideinfodlg.pas svneol=native#text/plain
|
ide/ideinfodlg.pas svneol=native#text/plain
|
||||||
ide/ideminilibc.pas svneol=native#text/plain
|
ide/ideminilibc.pas svneol=native#text/plain
|
||||||
|
ide/idemodifiedinfo.lfm svneol=native#text/plain
|
||||||
|
ide/idemodifiedinfo.pas svneol=native#text/plain
|
||||||
ide/ideoptiondefs.pas svneol=native#text/pascal
|
ide/ideoptiondefs.pas svneol=native#text/pascal
|
||||||
ide/ideoptionsdlg.lfm svneol=native#text/plain
|
ide/ideoptionsdlg.lfm svneol=native#text/plain
|
||||||
ide/ideoptionsdlg.pas svneol=native#text/pascal
|
ide/ideoptionsdlg.pas svneol=native#text/pascal
|
||||||
|
41
ide/idemodifiedinfo.lfm
Normal file
41
ide/idemodifiedinfo.lfm
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
object IDEModifiedInfoDialog: TIDEModifiedInfoDialog
|
||||||
|
Left = 275
|
||||||
|
Height = 450
|
||||||
|
Top = 250
|
||||||
|
Width = 704
|
||||||
|
Caption = 'IDEModifiedInfoDialog'
|
||||||
|
ClientHeight = 450
|
||||||
|
ClientWidth = 704
|
||||||
|
OnCreate = FormCreate
|
||||||
|
Position = poScreenCenter
|
||||||
|
LCLVersion = '0.9.31'
|
||||||
|
object PageControl1: TPageControl
|
||||||
|
Left = 0
|
||||||
|
Height = 450
|
||||||
|
Top = 0
|
||||||
|
Width = 704
|
||||||
|
ActivePage = ProjectTabSheet
|
||||||
|
Align = alClient
|
||||||
|
TabIndex = 0
|
||||||
|
TabOrder = 0
|
||||||
|
object ProjectTabSheet: TTabSheet
|
||||||
|
Caption = 'Project'
|
||||||
|
ClientHeight = 414
|
||||||
|
ClientWidth = 696
|
||||||
|
object ProjectMemo: TMemo
|
||||||
|
Left = 0
|
||||||
|
Height = 414
|
||||||
|
Top = 0
|
||||||
|
Width = 696
|
||||||
|
Align = alClient
|
||||||
|
Lines.Strings = (
|
||||||
|
'ValuesMemo'
|
||||||
|
''
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
141
ide/idemodifiedinfo.pas
Normal file
141
ide/idemodifiedinfo.pas
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
{
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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 what is modified.
|
||||||
|
}
|
||||||
|
unit IDEModifiedInfo;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||||
|
StdCtrls, ComCtrls, Project, SourceEditor;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TIDEModifiedInfoDialog }
|
||||||
|
|
||||||
|
TIDEModifiedInfoDialog = class(TForm)
|
||||||
|
ProjectMemo: TMemo;
|
||||||
|
PageControl1: TPageControl;
|
||||||
|
ProjectTabSheet: TTabSheet;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure UpdateProjectMemo;
|
||||||
|
procedure GatherProject(AProject: TProject; sl: TStrings);
|
||||||
|
public
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ShowIDEModifiedInfo: TModalResult;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function ShowIDEModifiedInfo: TModalResult;
|
||||||
|
var
|
||||||
|
Dlg: TIDEModifiedInfoDialog;
|
||||||
|
begin
|
||||||
|
Dlg:=TIDEModifiedInfoDialog.Create(nil);
|
||||||
|
try
|
||||||
|
Result:=Dlg.ShowModal;
|
||||||
|
finally
|
||||||
|
Dlg.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TIDEModifiedInfoDialog }
|
||||||
|
|
||||||
|
procedure TIDEModifiedInfoDialog.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Caption:='Modified items in IDE';
|
||||||
|
|
||||||
|
UpdateProjectMemo;
|
||||||
|
PageControl1.PageIndex:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEModifiedInfoDialog.UpdateProjectMemo;
|
||||||
|
var
|
||||||
|
sl: TStringList;
|
||||||
|
begin
|
||||||
|
sl:=TStringList.Create;
|
||||||
|
try
|
||||||
|
GatherProject(Project1,sl);
|
||||||
|
|
||||||
|
ProjectMemo.Lines.Assign(sl);
|
||||||
|
finally
|
||||||
|
sl.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEModifiedInfoDialog.GatherProject(AProject: TProject; sl: TStrings
|
||||||
|
);
|
||||||
|
var
|
||||||
|
aFile: TUnitInfo;
|
||||||
|
HeaderWritten: Boolean;
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
// summary
|
||||||
|
if AProject.Modified then
|
||||||
|
sl.Add('Project.Modified');
|
||||||
|
if AProject.SessionModified then
|
||||||
|
sl.Add('Project.SessionModified');
|
||||||
|
if Project1.SomethingModified(true,false) then
|
||||||
|
sl.Add('Project.SomethingModified Data');
|
||||||
|
if Project1.SomethingModified(false,true) then
|
||||||
|
sl.Add('Project.SomethingModified Session');
|
||||||
|
if SourceEditorManager.SomethingModified(false) then
|
||||||
|
sl.Add('SourceEditorManager.SomethingModified');
|
||||||
|
if AProject.BuildModes.IsModified(false) then
|
||||||
|
sl.Add('Project.BuildModes.IsModified data');
|
||||||
|
if AProject.BuildModes.IsModified(true) then
|
||||||
|
sl.Add('Project.BuildModes.IsModified session');
|
||||||
|
|
||||||
|
// details
|
||||||
|
HeaderWritten:=false;
|
||||||
|
aFile:=AProject.FirstPartOfProject;
|
||||||
|
while aFile<>nil do begin
|
||||||
|
if aFile.Modified or aFile.SessionModified
|
||||||
|
or ((aFile.Source<>nil) and aFile.Source.Modified)
|
||||||
|
then begin
|
||||||
|
if not HeaderWritten then begin
|
||||||
|
sl.Add('');
|
||||||
|
sl.Add('Project units:');
|
||||||
|
s:=aFile.GetShortFilename(true);
|
||||||
|
if aFile.Modified then
|
||||||
|
s:=s+' Modified';
|
||||||
|
if aFile.SessionModified then
|
||||||
|
s:=s+' SessionModified';
|
||||||
|
if (aFile.Source<>nil) and (aFile.Source.Modified) then
|
||||||
|
s:=s+' Source.Modified';
|
||||||
|
sl.Add(s);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
aFile:=aFile.NextPartOfProject;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -308,6 +308,7 @@ resourcestring
|
|||||||
lisMenuPackageLinks = 'Package Links ...';
|
lisMenuPackageLinks = 'Package Links ...';
|
||||||
lisMenuAboutFPC = 'About FPC';
|
lisMenuAboutFPC = 'About FPC';
|
||||||
lisAboutIDE = 'About IDE';
|
lisAboutIDE = 'About IDE';
|
||||||
|
lisAboutModifiedItemsInTheIDE = 'About modified items in the IDE';
|
||||||
|
|
||||||
lisMenuNewProject = 'New Project ...';
|
lisMenuNewProject = 'New Project ...';
|
||||||
lisMenuNewProjectFromFile = 'New Project from File ...';
|
lisMenuNewProjectFromFile = 'New Project from File ...';
|
||||||
|
16
ide/main.pp
16
ide/main.pp
@ -145,10 +145,11 @@ uses
|
|||||||
OutputFilter, JumpHistoryView, ManageExamples,
|
OutputFilter, JumpHistoryView, ManageExamples,
|
||||||
BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg,
|
BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg,
|
||||||
MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory,
|
MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory,
|
||||||
IDEFPCInfo, IDEInfoDlg, ProcessList, InitialSetupDlgs, NewDialog,
|
IDEFPCInfo, IDEInfoDlg, IDEModifiedInfo, ProcessList, InitialSetupDlgs,
|
||||||
MakeResStrDlg, DialogProcs, FindReplaceDialog, FindInFilesDlg, CodeExplorer,
|
NewDialog, MakeResStrDlg, DialogProcs, FindReplaceDialog, FindInFilesDlg,
|
||||||
BuildFileDlg, ProcedureList, ExtractProcDlg, FindRenameIdentifier,
|
CodeExplorer, BuildFileDlg, ProcedureList, ExtractProcDlg,
|
||||||
AbstractsMethodsDlg, EmptyMethodsDlg, UnusedUnitsDlg, UseUnitDlg, FindOverloadsDlg,
|
FindRenameIdentifier, AbstractsMethodsDlg, EmptyMethodsDlg, UnusedUnitsDlg,
|
||||||
|
UseUnitDlg, FindOverloadsDlg,
|
||||||
CleanDirDlg, CodeContextForm, AboutFrm, CompatibilityRestrictions,
|
CleanDirDlg, CodeContextForm, AboutFrm, CompatibilityRestrictions,
|
||||||
RestrictionBrowser, ProjectWizardDlg, IDECmdLine, IDEGuiCmdLine, CodeExplOpts,
|
RestrictionBrowser, ProjectWizardDlg, IDECmdLine, IDEGuiCmdLine, CodeExplOpts,
|
||||||
// main ide
|
// main ide
|
||||||
@ -259,6 +260,7 @@ type
|
|||||||
procedure mnuViewIDESpeedButtonsClicked(Sender: TObject);
|
procedure mnuViewIDESpeedButtonsClicked(Sender: TObject);
|
||||||
procedure mnuViewFPCInfoClicked(Sender: TObject);
|
procedure mnuViewFPCInfoClicked(Sender: TObject);
|
||||||
procedure mnuViewIDEInfoClicked(Sender: TObject);
|
procedure mnuViewIDEInfoClicked(Sender: TObject);
|
||||||
|
procedure mnuViewIDEModifiedInfoClicked(Sender: TObject);
|
||||||
|
|
||||||
// source menu
|
// source menu
|
||||||
procedure mnuSourceClicked(Sender: TObject);
|
procedure mnuSourceClicked(Sender: TObject);
|
||||||
@ -2525,6 +2527,7 @@ begin
|
|||||||
|
|
||||||
itmViewFPCInfo.OnClick:=@mnuViewFPCInfoClicked;
|
itmViewFPCInfo.OnClick:=@mnuViewFPCInfoClicked;
|
||||||
itmViewIDEInfo.OnClick:=@mnuViewIDEInfoClicked;
|
itmViewIDEInfo.OnClick:=@mnuViewIDEInfoClicked;
|
||||||
|
itmViewIDEModifiedInfo.OnClick:=@mnuViewIDEModifiedInfoClicked;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2722,6 +2725,11 @@ begin
|
|||||||
ShowIDEInfo;
|
ShowIDEInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.mnuViewIDEModifiedInfoClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ShowIDEModifiedInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SetDesigning(AComponent: TComponent; Value: Boolean);
|
procedure TMainIDE.SetDesigning(AComponent: TComponent; Value: Boolean);
|
||||||
begin
|
begin
|
||||||
SetComponentDesignMode(AComponent, Value);
|
SetComponentDesignMode(AComponent, Value);
|
||||||
|
@ -197,6 +197,7 @@ type
|
|||||||
itmViewPackageLinks: TIDEMenuCommand;
|
itmViewPackageLinks: TIDEMenuCommand;
|
||||||
itmViewFPCInfo: TIDEMenuCommand;
|
itmViewFPCInfo: TIDEMenuCommand;
|
||||||
itmViewIDEInfo: TIDEMenuCommand;
|
itmViewIDEInfo: TIDEMenuCommand;
|
||||||
|
itmViewIDEModifiedInfo: TIDEMenuCommand;
|
||||||
|
|
||||||
// source menu
|
// source menu
|
||||||
//mnuSource: TIDEMenuSection;
|
//mnuSource: TIDEMenuSection;
|
||||||
|
@ -538,6 +538,7 @@ begin
|
|||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
|
||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
|
||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEInfo, 'itmViewIDEInfo', lisAboutIDE);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEInfo, 'itmViewIDEInfo', lisAboutIDE);
|
||||||
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEModifiedInfo, 'itmViewIDEModifiedInfo', lisAboutModifiedItemsInTheIDE);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -5293,7 +5293,7 @@ end;
|
|||||||
|
|
||||||
function TProject.SomeDataModified(Verbose: boolean): boolean;
|
function TProject.SomeDataModified(Verbose: boolean): boolean;
|
||||||
var
|
var
|
||||||
i: Integer;
|
AnUnitInfo: TUnitInfo;
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
if Modified then
|
if Modified then
|
||||||
@ -5308,13 +5308,16 @@ begin
|
|||||||
DebugLn(['TProject.SomeDataModified CompilerOptions/BuildModes']);
|
DebugLn(['TProject.SomeDataModified CompilerOptions/BuildModes']);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
for i := 0 to UnitCount - 1 do
|
AnUnitInfo:=FirstPartOfProject;
|
||||||
if (Units[i].IsPartOfProject) and Units[i].Modified then
|
while AnUnitInfo<>nil do begin
|
||||||
|
if AnUnitInfo.Modified then
|
||||||
begin
|
begin
|
||||||
if Verbose then
|
if Verbose then
|
||||||
DebugLn('TProject.SomeDataModified PartOfProject ',Units[i].Filename);
|
DebugLn('TProject.SomeDataModified PartOfProject ',AnUnitInfo.Filename);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
AnUnitInfo:=AnUnitInfo.NextPartOfProject;
|
||||||
|
end;
|
||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user