libman, entries can be de/activated without removal

This commit is contained in:
Basile Burg 2016-03-28 00:52:42 +02:00
parent 71fbc48b89
commit c74f6af73f
7 changed files with 192 additions and 103 deletions

BIN
icons/book/book.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
icons/book/book_grey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

View File

@ -442,6 +442,47 @@ LazarusResources.Add('book_open','PNG',[
+#213#31#223'Z'#27#22'8'#179'7c'#191#230'm'#158']'#13#246'm'#246#205'?zj'#215 +#213#31#223'Z'#27#22'8'#179'7c'#191#230'm'#158']'#13#246'm'#246#205'?zj'#215
+#225'O'#1#6#0#215#185#17'o'#26'E'#145#174#0#0#0#0'IEND'#174'B`'#130 +#225'O'#1#6#0#215#185#17'o'#26'E'#145#174#0#0#0#0'IEND'#174'B`'#130
]); ]);
LazarusResources.Add('book_grey','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#4#0#0#0#181#250'7'
+#234#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#0' cHRM'#0#0'z&'#0#0#128#132#0
+#0#250#0#0#0#128#232#0#0'u0'#0#0#234'`'#0#0':'#152#0#0#23'p'#156#186'Q<'#0#0
+#0#2'bKGD'#0#255#135#143#204#191#0#0#0#223'IDAT('#207'm'#209#177'M'#196'0'#24
+#134#225#231'O"Z'#150'`'#9#26'68'#6#160'f'#2#10'J'#10#26'J'#22'8'#137#142#1
+'`'#3':V'#0#150'@:'#233#136's'#142')'#226#220#229#16'_e'#201#175'_'#127#191
+#29#197#221#139#21'YQ'#28#18#26#205#235#253'eGY'#221'xp+'#255#1':'#143'+:F['
+#217#214#187'l'#172#219#141#214#185#17#29'$!I'#174#22#134'g}E'#133#132#180'?'
+'=e'#148#196'l'#232#133#193'h]{'#132#214#137#225#0'$'#141'^v'#189'0<IL@'#232
+#133#164'X'#239#231#8#141'~6L@'#143'va('#181'd'#237'@o'#20'G'#192#207'a'#138
+'A'#24'X<T'#161#150'l'#212'eba'#8#12#179#129#157#176';'#186'`'#246#214#146'Y'
+'#k'#149'=T'#132'<'#3#155#183#143#139#214#231#209'WM'#142#205#27'Q'#196#153
+'S'#255#231#187'|'#253#2#244'&R'#165'%'#217'Iv'#0#0#0'%tEXtdate:create'#0'20'
+'14-03-13T04:26:44+02:00d''t'#165#0#0#0'%tEXtdate:modify'#0'2009-04-08T14:08'
+':08+03:00'#203'|'#247'W'#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'
+#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('book','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#1#192'IDATx'#218#148
+'S=O'#28'1'#20#28#251#12'E'#154'4tHT'#252#129#252#129#20'i'#144#18'A'#149'k@'
+#162#228#31'@'#151'*J'#157'>R$'#10':'#162#20#9#138#146#134#226'ZDq'#162#165#2
+#132't'#5#197'}'#238#238#173#237#199#216#241#238'}'#23'<'#201'k'#175#247#237
+#204#188'y'#182#18#17#188#251#252#239#23#128']'#14'8'#239#225#189'@'#176'<'
+#20#135#214#26#13#173'~_~'#218#217'3a'#147#249#187#223#143'wp'#240#229#2#167
+''''#31'`'#157'G'#0'^'#10#160#20#214'L'#3'G_'#255'F'#194#8' '#226#209#205'<'
+#172#245#24#20'%'#206#218'O'#176'T'#226#2#134'L'#168#27#28#134#236#135'o6'
+#168#210#163#6#8'1,%'#202#27#22#130#209'X'#240#237#253#230'R'#5'G'#127#30#153
+#227'cn'#8']'#213'5'#28's'#147'o'#163#210#177#132'U'#14' ~'#27#133#220#4'a*y'
+#1' '#160'eT'#226'X'#127#243#199#29'J&'#251')'#166'5'#214#240'j]'#147#132'j'
+#147#4'S)'#24'P'#182#230'n'#152'K'#11#156#127#220'Z'#170'`'#255#231#3#201'&'
+#10'M'#229#236'p'#236#8#128'('#143']A'#243#252'>'#206'U3'#2'c'#248#206#246
+#209'h'#31#215#179#10#10#137#155'}'#2#136'Wt\E'#215#231#131#13#195#160#156
+#152'X'#3#244#139#255'&'#246#9'dI'#173#19#235#204#207'T'#227'S.f'#20#240'%'
+#183#201'D+'#177#247#162#166#206'@'#5#144#30'Yjy'#221#198#16'ytVqv'#17']'#173
+'8'#198#225#145#145'L-(p'#146'f'#212'=^u'#23'r+'#179#231' 0'#23'4.\'#146#220
+'q6&'#22'<'#15'#)7w'#186'6('#2#140#250#189'V'#167'}'#245'V7'#12':7'#215#139
+#197'/'#168'P'#200#6#189'V\'#135'[G'#212'm'#174'_'#227'e'#209#229#191#183#207
+#2#12#0'\'#18#219#240#21' '#12#174#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('bullet_black','PNG',[ LazarusResources.Add('bullet_black','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#4#0#0#0#181#250'7' #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#4#0#0#0#181#250'7'
+#234#0#0#0#4'gAMA'#0#0#175#200'7'#5#138#233#0#0#0#25'tEXtSoftware'#0'Adobe I' +#234#0#0#0#4'gAMA'#0#0#175#200'7'#5#138#233#0#0#0#25'tEXtSoftware'#0'Adobe I'

View File

@ -20,11 +20,15 @@ type
fSourcePath: string; fSourcePath: string;
fLibFile: string; fLibFile: string;
fProjFile: string; fProjFile: string;
fEnabled: boolean;
published published
property libAlias: string read fAlias write fAlias; property libAlias: string read fAlias write fAlias;
property libSourcePath: string read fSourcePath write fSourcePath; property libSourcePath: string read fSourcePath write fSourcePath;
property libFile: string read fLibFile write fLibFile; property libFile: string read fLibFile write fLibFile;
property projectFile: string read fProjFile write fProjFile; property projectFile: string read fProjFile write fProjFile;
property enabled: boolean read fEnabled write fEnabled default true;
public
constructor Create(ACollection: TCollection); override;
end; end;
(** (**
@ -33,7 +37,7 @@ type
TLibraryManager = class(TWritableLfmTextComponent) TLibraryManager = class(TWritableLfmTextComponent)
private private
fCol: TCollection; fCol: TCollection;
procedure setCol(const aValue: TCollection); procedure setCol(value: TCollection);
published published
property libraries: TCollection read fCol write setCol; property libraries: TCollection read fCol write setCol;
public public
@ -54,6 +58,12 @@ var
implementation implementation
constructor TLibraryItem.Create(ACollection: TCollection);
begin
inherited create(ACollection);
fEnabled:=true;
end;
constructor TLibraryManager.create(aOwner: TComponent); constructor TLibraryManager.create(aOwner: TComponent);
var var
fName: string; fName: string;
@ -148,9 +158,9 @@ begin
inherited; inherited;
end; end;
procedure TLibraryManager.setCol(const aValue: TCollection); procedure TLibraryManager.setCol(value: TCollection);
begin begin
fCol.assign(aValue); fCol.assign(value);
end; end;
procedure TLibraryManager.updateDCD; procedure TLibraryManager.updateDCD;
@ -166,7 +176,8 @@ begin
for i := 0 to fCol.Count-1 do for i := 0 to fCol.Count-1 do
begin begin
itm := TLibraryItem(fCol.Items[i]); itm := TLibraryItem(fCol.Items[i]);
str.Add(itm.libSourcePath); if itm.enabled then
str.Add(itm.libSourcePath);
end; end;
DcdWrapper.addImportFolders(str); DcdWrapper.addImportFolders(str);
finally finally
@ -188,8 +199,8 @@ begin
for i := 0 to fCol.Count-1 do for i := 0 to fCol.Count-1 do
begin begin
itm := TLibraryItem(fCol.Items[i]); itm := TLibraryItem(fCol.Items[i]);
if someAliases.isNotNil then if (not itm.enabled) or
if someAliases.IndexOf(itm.libAlias) = -1 then (someAliases.isNotNil and (someAliases.IndexOf(itm.libAlias) = -1)) then
continue; continue;
// single lib files // single lib files
if fileExists(itm.libFile) then if fileExists(itm.libFile) then
@ -232,8 +243,8 @@ begin
for i := 0 to fCol.Count-1 do for i := 0 to fCol.Count-1 do
begin begin
itm := TLibraryItem(fCol.Items[i]); itm := TLibraryItem(fCol.Items[i]);
if someAliases.isNotNil then if (not itm.enabled) or
if someAliases.IndexOf(itm.libAlias) = -1 then (someAliases.isNotNil and (someAliases.IndexOf(itm.libAlias) = -1)) then
continue; continue;
// //
if aList.IndexOf(itm.libSourcePath) <> -1 then if aList.IndexOf(itm.libSourcePath) <> -1 then

View File

@ -157,6 +157,15 @@ inherited CELibManEditorWidget: TCELibManEditorWidget
Spacing = 0 Spacing = 0
TabOrder = 11 TabOrder = 11
end end
object btnEnabled: TSpeedButton
Left = 196
Height = 26
Hint = 'disable or enable this library, without removing it from the collection'
Top = 0
Width = 28
Align = alLeft
OnClick = btnEnabledClick
end
end end
object List: TListView[1] object List: TListView[1]
Left = 4 Left = 4
@ -184,7 +193,12 @@ inherited CELibManEditorWidget: TCELibManEditorWidget
item item
AutoSize = True AutoSize = True
Caption = 'project' Caption = 'project'
Width = 409 Width = 54
end
item
AutoSize = True
Caption = 'enabled'
Width = 355
end> end>
GridLines = True GridLines = True
HideSelection = False HideSelection = False

View File

@ -8,7 +8,8 @@ uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, ComCtrls, Buttons, LazFileUtils, strutils, fphttpclient, StdCtrls, Menus, ComCtrls, Buttons, LazFileUtils, strutils, fphttpclient, StdCtrls,
ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap, ce_common, ce_dialogs, ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap, ce_common, ce_dialogs,
ce_sharedres, process, ce_dubproject, ce_observer, ce_dlang, ce_stringrange; ce_sharedres, process, ce_dubproject, ce_observer, ce_dlang, ce_stringrange,
ce_libman;
type type
@ -39,7 +40,9 @@ type
btnSelProj: TBitBtn; btnSelProj: TBitBtn;
List: TListView; List: TListView;
Panel1: TPanel; Panel1: TPanel;
btnEnabled: TSpeedButton;
procedure btnAddLibClick(Sender: TObject); procedure btnAddLibClick(Sender: TObject);
procedure btnEnabledClick(Sender: TObject);
procedure btnDubFetchClick(Sender: TObject); procedure btnDubFetchClick(Sender: TObject);
procedure btnEditAliasClick(Sender: TObject); procedure btnEditAliasClick(Sender: TObject);
procedure btnOpenProjClick(Sender: TObject); procedure btnOpenProjClick(Sender: TObject);
@ -63,9 +66,10 @@ type
procedure projFocused(aProject: ICECommonProject); procedure projFocused(aProject: ICECommonProject);
procedure projCompiling(aProject: ICECommonProject); procedure projCompiling(aProject: ICECommonProject);
procedure projCompiled(aProject: ICECommonProject; success: boolean); procedure projCompiled(aProject: ICECommonProject; success: boolean);
function itemForRow(row: TListItem): TLibraryItem;
procedure RowToLibrary(row: TListItem);
// //
procedure dataToGrid; procedure dataToGrid;
procedure gridToData;
protected protected
procedure DoShow; override; procedure DoShow; override;
public public
@ -76,14 +80,12 @@ type
function sourceRoot(project: ICECommonProject): string; function sourceRoot(project: ICECommonProject): string;
implementation implementation
{$R *.lfm} {$R *.lfm}
uses
ce_libman;
const const
notav: string = '< n/a >'; notav: string = '< n/a >';
enableStr: array [boolean] of string = ('false','true');
constructor TCELibManEditorWidget.Create(aOwner: TComponent); constructor TCELibManEditorWidget.Create(aOwner: TComponent);
begin begin
@ -100,6 +102,7 @@ begin
AssignPng(btnDubFetch, 'dub_small'); AssignPng(btnDubFetch, 'dub_small');
AssignPng(btnSelProj, 'script_bricks'); AssignPng(btnSelProj, 'script_bricks');
AssignPng(btnOpenProj, 'book_open'); AssignPng(btnOpenProj, 'book_open');
AssignPng(btnEnabled, 'book');
end; end;
procedure TCELibManEditorWidget.updateButtonsState; procedure TCELibManEditorWidget.updateButtonsState;
@ -108,6 +111,10 @@ begin
fProj.Filename.fileExists; fProj.Filename.fileExists;
btnOpenProj.Enabled := List.Selected.isNotNil and btnOpenProj.Enabled := List.Selected.isNotNil and
List.Selected.SubItems[2].fileExists; List.Selected.SubItems[2].fileExists;
if List.Selected.isNotNil and itemForRow(List.Selected).enabled then
AssignPng(btnEnabled, 'book')
else
AssignPng(btnEnabled, 'book_grey');
end; end;
procedure TCELibManEditorWidget.projNew(aProject: ICECommonProject); procedure TCELibManEditorWidget.projNew(aProject: ICECommonProject);
@ -146,9 +153,15 @@ procedure TCELibManEditorWidget.projCompiled(aProject: ICECommonProject; success
begin begin
end; end;
function TCELibManEditorWidget.itemForRow(row: TListItem): TLibraryItem;
begin
result := TLibraryItem(row.Data);
end;
procedure TCELibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var AValue: string); procedure TCELibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var AValue: string);
begin begin
gridToData; if Item.isNotNil then
RowToLibrary(item);
end; end;
procedure TCELibManEditorWidget.ListSelectItem(Sender: TObject; procedure TCELibManEditorWidget.ListSelectItem(Sender: TObject;
@ -162,10 +175,12 @@ var
itm: TListItem; itm: TListItem;
begin begin
itm := List.Items.Add; itm := List.Items.Add;
itm.Data := LibMan.libraries.Add;
itm.Caption := notav; itm.Caption := notav;
itm.SubItems.Add(notav); itm.SubItems.Add(notav);
itm.SubItems.Add(notav); itm.SubItems.Add(notav);
itm.SubItems.Add(notav); itm.SubItems.Add(notav);
itm.SubItems.Add(enableStr[true]);
SetFocus; SetFocus;
itm.Selected := True; itm.Selected := True;
end; end;
@ -272,8 +287,8 @@ var
err: integer; err: integer;
idx: integer; idx: integer;
prj: TCEDubProject; prj: TCEDubProject;
cdy: string;
upd: boolean = false; upd: boolean = false;
row: TListItem;
begin begin
if TDubPackageQueryForm.showAndWait(nme) <> mrOk then if TDubPackageQueryForm.showAndWait(nme) <> mrOk then
exit; exit;
@ -374,15 +389,15 @@ begin
try try
for idx := 0 to prj.sourcesCount-1 do for idx := 0 to prj.sourcesCount-1 do
str.Add(prj.sourceAbsolute(idx)); str.Add(prj.sourceAbsolute(idx));
with List.Items.Add do row := List.Items.Add;
begin row.Data := LibMan.libraries.Add;
Caption := nme; row.Caption := nme;
SubItems.Add(prj.outputFilename); row.SubItems.Add(prj.outputFilename);
cdy := sourceRoot(prj as ICECommonProject); row.SubItems.Add(sourceRoot(prj as ICECommonProject));
SubItems.Add(cdy); row.SubItems.Add(prj.filename);
SubItems.Add(prj.filename); row.SubItems.Add(enableStr[true]);
Selected:=true; row.Selected:=true;
end; RowToLibrary(row);
finally finally
str.Free; str.Free;
end; end;
@ -392,7 +407,6 @@ begin
finally finally
prj.Free; prj.Free;
EntitiesConnector.endUpdate; EntitiesConnector.endUpdate;
gridToData;
end; end;
end; end;
@ -405,7 +419,20 @@ begin
al := List.Selected.Caption; al := List.Selected.Caption;
if inputQuery('library alias', '', al) then if inputQuery('library alias', '', al) then
List.Selected.Caption := al; List.Selected.Caption := al;
gridToData; RowToLibrary(List.Selected);
end;
procedure TCELibManEditorWidget.btnEnabledClick(Sender: TObject);
begin
if List.Selected.isNil then
exit;
if List.Selected.SubItems[3] = 'true' then
List.Selected.SubItems[3] := 'false'
else
List.Selected.SubItems[3] := 'true';
RowToLibrary(List.Selected);
updateButtonsState;
end; end;
procedure TCELibManEditorWidget.btnOpenProjClick(Sender: TObject); procedure TCELibManEditorWidget.btnOpenProjClick(Sender: TObject);
@ -447,6 +474,7 @@ var
fname: string; fname: string;
root: string; root: string;
lalias: string; lalias: string;
row: TListItem;
begin begin
if fProj = nil then exit; if fProj = nil then exit;
// //
@ -469,21 +497,21 @@ begin
end; end;
// //
fname := fProj.outputFilename; fname := fProj.outputFilename;
with List.Items.Add do row := List.Items.Add;
begin row.Data := LibMan.libraries.Add;
Caption := ExtractFileNameOnly(fname); row.Caption := ExtractFileNameOnly(fname);
if fname.extractFileExt <> libExt then if fname.extractFileExt <> libExt then
SubItems.add(fname + libExt) row.SubItems.add(fname + libExt)
else else
SubItems.add(fname); row.SubItems.add(fname);
SubItems.add(root); row.SubItems.add(root);
SubItems.add(fProj.filename); row.SubItems.add(fProj.filename);
if not SubItems[0].fileExists then row.SubItems.add(enableStr[true]);
dlgOkInfo('the library file does not exist, maybe the project not been already compiled ?'); if not row.SubItems[0].fileExists then
Selected:= true; dlgOkInfo('the library file does not exist, maybe the project not been already compiled ?');
end; row.Selected:= true;
SetFocus; SetFocus;
gridToData; RowToLibrary(row);
finally finally
str.free; str.free;
end; end;
@ -493,28 +521,27 @@ procedure TCELibManEditorWidget.btnRemLibClick(Sender: TObject);
begin begin
if List.Selected.isNil then if List.Selected.isNil then
exit; exit;
LibMan.libraries.Delete(List.Selected.Index);
List.Items.Delete(List.Selected.Index); List.Items.Delete(List.Selected.Index);
gridToData;
end; end;
procedure TCELibManEditorWidget.btnSelProjClick(Sender: TObject); procedure TCELibManEditorWidget.btnSelProjClick(Sender: TObject);
var var
ini: string = ''; ini: string;
begin begin
if List.Selected.isNil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 2 then //
ini := List.Selected.SubItems[2] ini := List.Selected.SubItems[2];
else while List.Selected.SubItems.Count < 3 do with TOpenDialog.Create(nil) do
List.Selected.SubItems.Add(ini); try
with TOpenDialog.Create(nil) do try
FileName := ini; FileName := ini;
if Execute then if Execute then
List.Selected.SubItems[2] := FileName; List.Selected.SubItems[2] := FileName;
finally finally
free; free;
end; end;
gridToData; RowToLibrary(List.Selected);
end; end;
procedure TCELibManEditorWidget.btnSelFileClick(Sender: TObject); procedure TCELibManEditorWidget.btnSelFileClick(Sender: TObject);
@ -523,28 +550,26 @@ var
begin begin
if List.Selected.isNil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 0 then //
ini := List.Selected.SubItems[0] ini := List.Selected.SubItems[0];
else
List.Selected.SubItems.Add(ini);
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
try try
filename := ini; filename := ini;
if Execute then if Execute then
begin
if not filename.fileExists then
List.Selected.SubItems[0] := filename.extractFilePath
else
begin begin
if not filename.fileExists then List.Selected.SubItems[0] := filename;
List.Selected.SubItems[0] := filename.extractFilePath if (List.Selected.Caption.isEmpty) or (List.Selected.Caption = notav) then
else List.Selected.Caption := ChangeFileExt(filename.extractFileName, '');
begin
List.Selected.SubItems[0] := filename;
if (List.Selected.Caption.isEmpty) or (List.Selected.Caption = notav) then
List.Selected.Caption := ChangeFileExt(filename.extractFileName, '');
end;
end; end;
finally
Free;
end; end;
gridToData; finally
Free;
end;
RowToLibrary(List.Selected);
end; end;
procedure TCELibManEditorWidget.btnSelfoldOfFilesClick(Sender: TObject); procedure TCELibManEditorWidget.btnSelfoldOfFilesClick(Sender: TObject);
@ -553,16 +578,11 @@ var
begin begin
if List.Selected.isNil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 0 then //
dir := List.Selected.SubItems[0] dir := List.Selected.SubItems[0];
else
begin
dir := '';
List.Selected.SubItems.Add(dir);
end;
if selectDirectory('folder of static libraries', dir, outdir, True, 0) then if selectDirectory('folder of static libraries', dir, outdir, True, 0) then
List.Selected.SubItems[0] := outdir; List.Selected.SubItems[0] := outdir;
gridToData; RowToLibrary(List.Selected);
end; end;
procedure TCELibManEditorWidget.btnSelRootClick(Sender: TObject); procedure TCELibManEditorWidget.btnSelRootClick(Sender: TObject);
@ -571,39 +591,39 @@ var
begin begin
if List.Selected.isNil then if List.Selected.isNil then
exit; exit;
if List.Selected.SubItems.Count > 1 then //
dir := List.Selected.SubItems[1] dir := List.Selected.SubItems[1];
else
begin
dir := '';
while List.Selected.SubItems.Count < 2 do
List.Selected.SubItems.Add(dir);
end;
if selectDirectory('sources root', dir, outdir, True, 0) then if selectDirectory('sources root', dir, outdir, True, 0) then
List.Selected.SubItems[1] := outdir; List.Selected.SubItems[1] := outdir;
gridToData; RowToLibrary(List.Selected);
end; end;
procedure TCELibManEditorWidget.btnMoveUpClick(Sender: TObject); procedure TCELibManEditorWidget.btnMoveUpClick(Sender: TObject);
var
i: integer;
begin begin
if list.Selected.isNil then if list.Selected.isNil then
exit; exit;
if list.Selected.Index = 0 then if list.Selected.Index = 0 then
exit; exit;
// //
list.Items.Exchange(list.Selected.Index, list.Selected.Index - 1); i := list.Selected.Index;
gridToData; list.Items.Exchange(i, i - 1);
LibMan.libraries.Exchange(i, i - 1);
end; end;
procedure TCELibManEditorWidget.btnMoveDownClick(Sender: TObject); procedure TCELibManEditorWidget.btnMoveDownClick(Sender: TObject);
var
i: integer;
begin begin
if list.Selected.isNil then if list.Selected.isNil then
exit; exit;
if list.Selected.Index = list.Items.Count - 1 then if list.Selected.Index = list.Items.Count - 1 then
exit; exit;
// //
list.Items.Exchange(list.Selected.Index, list.Selected.Index + 1); i := list.Selected.Index;
gridToData; list.Items.Exchange(i, i + 1);
LibMan.libraries.Exchange(i, i + 1);
end; end;
procedure TCELibManEditorWidget.DoShow; procedure TCELibManEditorWidget.DoShow;
@ -626,32 +646,30 @@ begin
begin begin
itm := TLibraryItem(LibMan.libraries.Items[i]); itm := TLibraryItem(LibMan.libraries.Items[i]);
row := List.Items.Add; row := List.Items.Add;
row.Data:= itm;
row.Caption := itm.libAlias; row.Caption := itm.libAlias;
row.SubItems.Add(itm.libFile); row.SubItems.Add(itm.libFile);
row.SubItems.Add(itm.libSourcePath); row.SubItems.Add(itm.libSourcePath);
row.SubItems.Add(itm.projectFile); row.SubItems.Add(itm.projectFile);
row.SubItems.Add(enableStr[itm.enabled]);
end; end;
List.EndUpdate; List.EndUpdate;
end; end;
procedure TCELibManEditorWidget.gridToData; procedure TCELibManEditorWidget.RowToLibrary(row: TListItem);
var var
itm: TLibraryItem; itm: TLibraryItem;
row: TListItem;
begin begin
if LibMan.isNil then itm := itemForRow(row);
if itm.isNil then
exit; exit;
LibMan.libraries.BeginUpdate;
LibMan.libraries.Clear; itm.libAlias := row.Caption;
for row in List.Items do itm.libFile := row.SubItems[0];
begin itm.libSourcePath := row.SubItems[1];
itm := TLibraryItem(LibMan.libraries.Add); itm.projectFile := row.SubItems[2];
itm.libAlias := row.Caption; itm.enabled := row.SubItems[3] = enableStr[true];
itm.libFile := row.SubItems[0];
itm.libSourcePath := row.SubItems[1];
itm.projectFile:= row.SubItems[2];
end;
LibMan.libraries.EndUpdate;
LibMan.updateDCD; LibMan.updateDCD;
end; end;

View File

@ -1,2 +1,7 @@
- new symbolic strings, ENV_XXX, see issue #27 - new symbolic strings, ENV_XXX, see issue #27
- fetch DUB package, list of online package can be displayed. - fetch DUB package, list of online package can be displayed.
- libman, entries can be disabled without removal, example: useful when testing new dmd version with runnable, no need to recompile all libs of the registry.
- support for gdmd
- input process widget: kill process, in case of error, infinite loop, emergency kill
- editor note about usefull commands: comment selection, invert version all/none
- tuto are obsolete