mirror of https://gitlab.com/basile.b/dexed.git
libman, prevent alias conflicts
This commit is contained in:
parent
e873bfb483
commit
c46e7fa7ad
|
@ -527,6 +527,7 @@ end;
|
||||||
procedure TCELibManEditorWidget.btnEditAliasClick(Sender: TObject);
|
procedure TCELibManEditorWidget.btnEditAliasClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
al: string;
|
al: string;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if List.Selected.isNil then
|
if List.Selected.isNil then
|
||||||
exit;
|
exit;
|
||||||
|
@ -537,8 +538,17 @@ begin
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
if inputQuery('library alias', '', al) then
|
if inputQuery('library alias', '', al) then
|
||||||
List.Selected.Caption := al;
|
begin
|
||||||
RowToLibrary(List.Selected);
|
for i := 0 to LibMan.librariesCount-1 do
|
||||||
|
if (LibMan.libraryByIndex[i].libAlias = al) and
|
||||||
|
(LibMan.libraryByIndex[i] <> itemForRow(List.Selected)) then
|
||||||
|
begin
|
||||||
|
dlgOkError('This alias is already used by another library, the renaming is canceled');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
List.Selected.Caption := al;
|
||||||
|
RowToLibrary(List.Selected);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue