Merge branch 'IDE/PjInsp/ReorderWarn' into 'main'

IDE/PjInsp: Display a warning that to change the order of items needs to disable alphabetical sorting

See merge request freepascal.org/lazarus/lazarus!408
This commit is contained in:
n7800 2025-03-09 19:03:27 +00:00
commit 40d1f27a21
2 changed files with 26 additions and 9 deletions

View File

@ -2792,6 +2792,7 @@ resourcestring
lisPLDOnlinePackagesCannotBeDeleted = 'Online packages cannot be deleted';
lisPESortFilesAlphabetically = 'Sort files alphabetically';
lisPEShowDirectoryHierarchy = 'Show directory hierarchy';
lisPEOffSortForReorder = 'To reorder items, disable alphabetical sorting';
lisPEShowPropsPanel = 'Show properties panel';
lisClearFilter = 'Clear filter';
dlgCaseSensitive = '&Case sensitive';

View File

@ -58,7 +58,7 @@ uses
Classes, SysUtils,
// LCL
LCLType, LCLIntf, LResources, Forms, Controls, Buttons, ComCtrls, Menus, Dialogs,
ExtCtrls, StdCtrls, Graphics,
ExtCtrls, StdCtrls, Graphics, LCLStrConsts,
// LazControls
TreeFilterEdit,
// LazUtils
@ -659,20 +659,36 @@ procedure TProjectInspectorForm.MoveDependencyUpClick(Sender: TObject);
var
Dependency: TPkgDependency;
begin
Dependency:=GetSingleSelectedDependency;
if SortAlphabetically or (Dependency=nil) or Dependency.Removed
or (Dependency.PrevRequiresDependency=nil) then exit;
LazProject.MoveRequiredDependencyUp(Dependency);
if SortAlphabetically then
begin
IDEMessageDialog(rsMtWarning, lisPEOffSortForReorder, mtWarning, [mbOK]);
exit;
end;
Dependency := GetSingleSelectedDependency;
if (Dependency = nil) or Dependency.Removed then
exit;
if assigned(Dependency.PrevRequiresDependency) then
LazProject.MoveRequiredDependencyUp(Dependency);
end;
procedure TProjectInspectorForm.MoveDependencyDownClick(Sender: TObject);
var
Dependency: TPkgDependency;
begin
Dependency:=GetSingleSelectedDependency;
if SortAlphabetically or (Dependency=nil) or Dependency.Removed
or (Dependency.NextRequiresDependency=nil) then exit;
LazProject.MoveRequiredDependencyDown(Dependency);
if SortAlphabetically then
begin
IDEMessageDialog(rsMtWarning, lisPEOffSortForReorder, mtWarning, [mbOK]);
exit;
end;
Dependency := GetSingleSelectedDependency;
if (Dependency = nil) or Dependency.Removed then
exit;
if assigned(Dependency.NextRequiresDependency) then
LazProject.MoveRequiredDependencyDown(Dependency);
end;
procedure TProjectInspectorForm.PropsGroupBoxResize(Sender: TObject);