diff --git a/.gitattributes b/.gitattributes index 641c903742..3b1071e4d4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3813,6 +3813,8 @@ ide/infobuild.pp svneol=native#text/plain ide/initialsetupdlgs.pas svneol=native#text/pascal ide/inputfiledialog.pas svneol=native#text/pascal ide/inputhistory.pas svneol=native#text/pascal +ide/inspectchksumchangeddlg.lfm svneol=native#text/plain +ide/inspectchksumchangeddlg.pas svneol=native#text/pascal ide/invertassigntool.pas svneol=native#text/pascal ide/jumphistoryview.lfm svneol=native#text/plain ide/jumphistoryview.pas svneol=native#text/plain diff --git a/ide/findunitdlg.lfm b/ide/findunitdlg.lfm index a092e91a89..031cfeae37 100644 --- a/ide/findunitdlg.lfm +++ b/ide/findunitdlg.lfm @@ -8,7 +8,7 @@ object FindUnitDialog: TFindUnitDialog ClientWidth = 584 OnCreate = FormCreate OnDestroy = FormDestroy - Position = poDesktopCenter + Position = poScreenCenter LCLVersion = '0.9.29' object BtnPanel: TPanel Left = 0 diff --git a/ide/findunitdlg.pas b/ide/findunitdlg.pas index 351f6bcca1..b264409eee 100644 --- a/ide/findunitdlg.pas +++ b/ide/findunitdlg.pas @@ -530,7 +530,7 @@ begin try InfoTreeView.Items.Add(nil,'Message: '+dbgstr(Line)); InfoTreeView.Items.Add(nil,'File: '+dbgstr(aCode.Filename)); - InfoTreeView.Items.Add(nil,'Missingg unit: '+dbgstr(aMissingUnitName)); + InfoTreeView.Items.Add(nil,'Missing unit: '+dbgstr(aMissingUnitName)); Directory:=ExtractFilePath(aCode.Filename); DirNode:=InfoTreeView.Items.Add(nil,'Directory: '+dbgstr(Directory)); diff --git a/ide/inspectchksumchangeddlg.lfm b/ide/inspectchksumchangeddlg.lfm new file mode 100644 index 0000000000..491ed55e77 --- /dev/null +++ b/ide/inspectchksumchangeddlg.lfm @@ -0,0 +1,97 @@ +object InspectChksumChgDialog: TInspectChksumChgDialog + Left = 275 + Height = 471 + Top = 250 + Width = 494 + Caption = 'InspectChksumChgDialog' + ClientHeight = 471 + ClientWidth = 494 + OnCreate = FormCreate + OnDestroy = FormDestroy + Position = poScreenCenter + LCLVersion = '0.9.31' + object InfoGroupBox: TGroupBox + AnchorSideBottom.Control = Splitter1 + Left = 6 + Height = 324 + Top = 6 + Width = 482 + Align = alTop + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Caption = 'InfoGroupBox' + ClientHeight = 305 + ClientWidth = 478 + TabOrder = 0 + object InfoTreeView: TTreeView + Left = 0 + Height = 285 + Top = 0 + Width = 478 + Align = alClient + DefaultItemHeight = 19 + TabOrder = 0 + end + object ProgressBar1: TProgressBar + Left = 0 + Height = 20 + Top = 285 + Width = 478 + Align = alBottom + TabOrder = 1 + end + end + object Splitter1: TSplitter + AnchorSideLeft.Control = Owner + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + Cursor = crVSplit + Left = 0 + Height = 5 + Top = 336 + Width = 494 + Align = alNone + Anchors = [akTop, akLeft, akRight] + ResizeAnchor = akBottom + end + object ActionsRadioGroup: TRadioGroup + AnchorSideTop.Control = Splitter1 + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 72 + Top = 347 + Width = 482 + Align = alBottom + Anchors = [akTop, akLeft, akRight, akBottom] + AutoFill = True + BorderSpacing.Around = 6 + Caption = 'ActionsRadioGroup' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + TabOrder = 2 + end + object ButtonPanel1: TButtonPanel + Left = 6 + Height = 40 + Top = 425 + Width = 482 + OKButton.Name = 'OKButton' + OKButton.Caption = '&OK' + HelpButton.Name = 'HelpButton' + HelpButton.Caption = '&Help' + HelpButton.Enabled = False + CloseButton.Name = 'CloseButton' + CloseButton.Caption = '&Close' + CloseButton.Enabled = False + CancelButton.Name = 'CancelButton' + CancelButton.Caption = 'Cancel' + TabOrder = 3 + ShowButtons = [pbOK, pbCancel] + end +end diff --git a/ide/inspectchksumchangeddlg.pas b/ide/inspectchksumchangeddlg.pas new file mode 100644 index 0000000000..ff485f27ae --- /dev/null +++ b/ide/inspectchksumchangeddlg.pas @@ -0,0 +1,201 @@ +{ + *************************************************************************** + * * + * 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 . 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: + Dialog to show information about the message + "recompiling unit1, checksum changed for unit2" + + ToDo: + - show the location(s) of the first unit + - show the location(s) of the second unit + - actions: + - open a source file + - open a package + - delete a ppu+o file + - recompile a package clean (remove the .compiled file) +} +unit InspectChksumChangedDlg; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Graphics, Dialogs, + StdCtrls, ExtCtrls, ComCtrls, ButtonPanel, + // codetools + CodeCache, + // IDEIntf + LazIDEIntf, TextTools, IDEMsgIntf, PackageIntf, + LazarusIDEStrConsts; + +type + TInspectChksumChgDialog = class; + + { TQuickFixMissingUnit } + + { TICCAction } + + TICCAction = class + public + Dlg: TInspectChksumChgDialog; + Caption: string; + constructor Create(aDlg: TInspectChksumChgDialog; aCaption: string); + end; + + { TInspectChksumChgDialog } + + TInspectChksumChgDialog = class(TForm) + ButtonPanel1: TButtonPanel; + InfoGroupBox: TGroupBox; + ProgressBar1: TProgressBar; + ActionsRadioGroup: TRadioGroup; + Splitter1: TSplitter; + InfoTreeView: TTreeView; + procedure CancelClick(Sender: TObject); + procedure OkClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + FMsg: string; + FUnit1: string; + FUnit2: string; + public + procedure InitWithMsg(aMsg: TIDEMessageLine); + property Msg: string read FMsg; + property Unit1: string read FUnit1; + property Unit2: string read FUnit2; + end; + + { TQuickFixRecompilingChecksumChanged } + + TQuickFixRecompilingChecksumChanged = class(TIDEMsgQuickFixItem) + public + constructor Create; + function IsApplicable(Line: TIDEMessageLine): boolean; override; + procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override; + end; + +procedure InitInspectChecksumChangedQuickFixItems; + +implementation + +procedure InitInspectChecksumChangedQuickFixItems; +begin + RegisterIDEMsgQuickFix(TQuickFixRecompilingChecksumChanged.Create); +end; + +{ TICCAction } + +constructor TICCAction.Create(aDlg: TInspectChksumChgDialog; aCaption: string); +begin + Dlg:=aDlg; + Caption:=aCaption; +end; + +{$R *.lfm} + +{ TInspectChksumChgDialog } + +procedure TInspectChksumChgDialog.FormCreate(Sender: TObject); +begin + Caption:='Inspect checksum changed message'; + InfoGroupBox.Caption:='Hints:'; + ActionsRadioGroup.Caption:='Actions'; + + ButtonPanel1.OKButton.OnClick:=@OkClick; + ButtonPanel1.CancelButton.OnClick:=@CancelClick; +end; + +procedure TInspectChksumChgDialog.OkClick(Sender: TObject); +begin + ModalResult:=mrOK; +end; + +procedure TInspectChksumChgDialog.CancelClick(Sender: TObject); +begin + ModalResult:=mrCancel; +end; + +procedure TInspectChksumChgDialog.FormDestroy(Sender: TObject); +begin + +end; + +procedure TInspectChksumChgDialog.InitWithMsg(aMsg: TIDEMessageLine); +begin + FMsg:=aMsg.Msg; + REMatches(Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i'); + FUnit1:=REVar(1); + FUnit2:=REVar(2); + + InfoTreeView.BeginUpdate; + InfoTreeView.Items.Clear; + + InfoTreeView.Items.Add(nil,'Message: '+dbgstr(Msg)); + InfoTreeView.Items.Add(nil,'ToDo: search for unit '+Unit1); + InfoTreeView.Items.Add(nil,'ToDo: search for unit '+Unit2); + InfoTreeView.Items.Add(nil,'ToDo: search for ppu files of '+Unit2); + + InfoTreeView.EndUpdate; +end; + +{ TQuickFixRecompilingChecksumChanged } + +constructor TQuickFixRecompilingChecksumChanged.Create; +begin + Name:='Show dialog for message Recompiling Unit1, checksum changed for Unit1'; + Caption:='Explore message "checksum changed"'; + Steps:=[imqfoMenuItem]; +end; + +function TQuickFixRecompilingChecksumChanged.IsApplicable(Line: TIDEMessageLine + ): boolean; +begin + Result:=false; + if not REMatches(Line.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i') + then exit; + Result:=true; +end; + +procedure TQuickFixRecompilingChecksumChanged.Execute( + const Msg: TIDEMessageLine; Step: TIMQuickFixStep); +var + Dlg: TInspectChksumChgDialog; +begin + if Step=imqfoMenuItem then begin + debugln(['TQuickFixRecompilingChecksumChanged.Execute ']); + if not REMatches(Msg.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i') + then exit; + debugln(['TQuickFixRecompilingChecksumChanged.Execute Unit1=',REVar(1),', checksum changed for Unit2=',REVar(2)]); + Dlg:=TInspectChksumChgDialog.Create(nil); + try + Dlg.InitWithMsg(Msg); + Dlg.ShowModal; + finally + Dlg.Free; + end; + end; +end; + +end. + diff --git a/ide/lazarus.lpi b/ide/lazarus.lpi index 41992ef581..04fc4ecf52 100644 --- a/ide/lazarus.lpi +++ b/ide/lazarus.lpi @@ -56,7 +56,7 @@ - + @@ -569,6 +569,13 @@ + + + + + + + diff --git a/ide/main.pp b/ide/main.pp index aa0d62db69..a9555dd0b7 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -133,9 +133,10 @@ uses // rest of the ide Splash, IDEDefs, LazarusIDEStrConsts, LazConf, MsgView, SearchResultView, - CodeTemplatesDlg, CodeBrowser, FindUnitDlg, IdeOptionsDlg, EditDefineTree, - PublishModule, EnvironmentOpts, TransferMacros, KeyMapping, IDETranslations, - IDEProcs, ExtToolDialog, ExtToolEditDlg, OutputFilter, JumpHistoryView, + CodeTemplatesDlg, CodeBrowser, FindUnitDlg, InspectChksumChangedDlg, + IdeOptionsDlg, EditDefineTree, PublishModule, EnvironmentOpts, TransferMacros, + KeyMapping, IDETranslations, IDEProcs, ExtToolDialog, ExtToolEditDlg, + OutputFilter, JumpHistoryView, BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg, MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory, IDEFPCInfo, IDEInfoDlg, ProcessList, InitialSetupDlgs, NewDialog, @@ -2058,6 +2059,7 @@ begin InitStandardIDEQuickFixItems; InitCodeBrowserQuickFixItems; InitFindUnitQuickFixItems; + InitInspectChecksumChangedQuickFixItems; end; procedure TMainIDE.SetupStartProject; diff --git a/ide/msgquickfixes.pas b/ide/msgquickfixes.pas index 067493ec9b..3b9df81332 100644 --- a/ide/msgquickfixes.pas +++ b/ide/msgquickfixes.pas @@ -109,15 +109,6 @@ type procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override; end; - { TQuickFixRecompilingChecksumChanged } - - TQuickFixRecompilingChecksumChanged = class(TIDEMsgQuickFixItem) - public - constructor Create; - function IsApplicable(Line: TIDEMessageLine): boolean; override; - procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override; - end; - procedure QuickFixParameterNotUsed(Sender: TObject; Step: TIMQuickFixStep; Msg: TIDEMessageLine); procedure QuickFixUnitNotUsed(Sender: TObject; Step: TIMQuickFixStep; @@ -259,7 +250,6 @@ begin RegisterIDEMsgQuickFix(TQuickFixIdentifierNotFoundAddLocal.Create); RegisterIDEMsgQuickFix(TQuickFixLocalVariableNotUsed_Remove.Create); RegisterIDEMsgQuickFix(TQuickFixHint_Hide.Create); - RegisterIDEMsgQuickFix(TQuickFixRecompilingChecksumChanged.Create); end; procedure FreeStandardIDEQuickFixItems; @@ -267,35 +257,6 @@ begin FreeThenNil(IDEMsgQuickFixes); end; -{ TQuickFixRecompilingChecksumChanged } - -constructor TQuickFixRecompilingChecksumChanged.Create; -begin - Name:='Show dialog for message Recompiling Unit1, checksum changed for Unit1'; - Caption:='Explore message "checksum changed"'; - Steps:=[imqfoMenuItem]; -end; - -function TQuickFixRecompilingChecksumChanged.IsApplicable(Line: TIDEMessageLine - ): boolean; -begin - Result:=false; - if not REMatches(Line.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i') - then exit; - Result:=true; -end; - -procedure TQuickFixRecompilingChecksumChanged.Execute( - const Msg: TIDEMessageLine; Step: TIMQuickFixStep); -begin - if Step=imqfoMenuItem then begin - debugln(['TQuickFixRecompilingChecksumChanged.Execute ']); - if not REMatches(Msg.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i') - then exit; - debugln(['TQuickFixRecompilingChecksumChanged.Execute Unit1=',REVar(1),', checksum changed for Unit2=',REVar(2)]); - end; -end; - { TQuickFixUnitNotFoundPosition } constructor TQuickFixUnitNotFoundPosition.Create;