diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 14ad16a34c..d4264af31e 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -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'; diff --git a/ide/projectinspector.pas b/ide/projectinspector.pas index e4fe79389d..06e18a7be3 100644 --- a/ide/projectinspector.pas +++ b/ide/projectinspector.pas @@ -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);