mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 20:20:16 +02:00
IDE: todo list: scan main source file ignoring file extension, bug #12125
git-svn-id: trunk@16546 -
This commit is contained in:
parent
c2a3f47f4d
commit
8ae737a76d
@ -1,10 +1,8 @@
|
|||||||
object frmTodo: TfrmTodo
|
object frmTodo: TfrmTodo
|
||||||
Left = 451
|
Left = 462
|
||||||
Height = 300
|
Height = 300
|
||||||
Top = 665
|
Top = 419
|
||||||
Width = 643
|
Width = 643
|
||||||
HorzScrollBar.Page = 642
|
|
||||||
VertScrollBar.Page = 299
|
|
||||||
ActiveControl = lvTodo
|
ActiveControl = lvTodo
|
||||||
Caption = 'frmTodo'
|
Caption = 'frmTodo'
|
||||||
ClientHeight = 300
|
ClientHeight = 300
|
||||||
@ -12,16 +10,17 @@ object frmTodo: TfrmTodo
|
|||||||
KeyPreview = True
|
KeyPreview = True
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnKeyDown = FormKeyDown
|
OnKeyDown = FormKeyDown
|
||||||
|
ParentFont = False
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.25'
|
LCLVersion = '0.9.25'
|
||||||
object StatusBar: TStatusBar
|
object StatusBar: TStatusBar
|
||||||
Height = 20
|
Height = 21
|
||||||
Top = 280
|
Top = 279
|
||||||
Width = 643
|
Width = 643
|
||||||
Panels = <>
|
Panels = <>
|
||||||
end
|
end
|
||||||
object lvTodo: TListView
|
object lvTodo: TListView
|
||||||
Height = 232
|
Height = 231
|
||||||
Top = 48
|
Top = 48
|
||||||
Width = 643
|
Width = 643
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -29,22 +28,22 @@ object frmTodo: TfrmTodo
|
|||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
Width = 42
|
Width = 57
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
Width = 42
|
Width = 57
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
Width = 42
|
Width = 57
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
Width = 42
|
Width = 57
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
@ -54,7 +53,7 @@ object frmTodo: TfrmTodo
|
|||||||
end
|
end
|
||||||
item
|
item
|
||||||
Caption = 'Caption'
|
Caption = 'Caption'
|
||||||
Width = 307
|
Width = 315
|
||||||
end>
|
end>
|
||||||
RowSelect = True
|
RowSelect = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
@ -75,7 +74,7 @@ object frmTodo: TfrmTodo
|
|||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object tbOptions: TToolButton
|
object tbOptions: TToolButton
|
||||||
Left = 161
|
Left = 189
|
||||||
Top = 2
|
Top = 2
|
||||||
AllowAllUp = True
|
AllowAllUp = True
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -83,7 +82,7 @@ object frmTodo: TfrmTodo
|
|||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object tbPrint: TToolButton
|
object tbPrint: TToolButton
|
||||||
Left = 128
|
Left = 142
|
||||||
Top = 2
|
Top = 2
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Print'
|
Caption = 'Print'
|
||||||
@ -96,13 +95,13 @@ object frmTodo: TfrmTodo
|
|||||||
AutoSize = True
|
AutoSize = True
|
||||||
end
|
end
|
||||||
object tbGoto: TToolButton
|
object tbGoto: TToolButton
|
||||||
Left = 51
|
Left = 48
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acGoto
|
Action = acGoto
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
end
|
end
|
||||||
object tbExport: TToolButton
|
object tbExport: TToolButton
|
||||||
Left = 85
|
Left = 95
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acExport
|
Action = acExport
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -1,36 +1,35 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TfrmTodo','FORMDATA',[
|
LazarusResources.Add('TfrmTodo','FORMDATA',[
|
||||||
'TPF0'#8'TfrmTodo'#7'frmTodo'#4'Left'#3#195#1#6'Height'#3','#1#3'Top'#3#153#2
|
'TPF0'#8'TfrmTodo'#7'frmTodo'#4'Left'#3#206#1#6'Height'#3','#1#3'Top'#3#163#1
|
||||||
+#5'Width'#3#131#2#18'HorzScrollBar.Page'#3#130#2#18'VertScrollBar.Page'#3'+'
|
+#5'Width'#3#131#2#13'ActiveControl'#7#6'lvTodo'#7'Caption'#6#7'frmTodo'#12'C'
|
||||||
+#1#13'ActiveControl'#7#6'lvTodo'#7'Caption'#6#7'frmTodo'#12'ClientHeight'#3
|
+'lientHeight'#3','#1#11'ClientWidth'#3#131#2#10'KeyPreview'#9#8'OnCreate'#7
|
||||||
+','#1#11'ClientWidth'#3#131#2#10'KeyPreview'#9#8'OnCreate'#7#10'FormCreate'#9
|
+#10'FormCreate'#9'OnKeyDown'#7#11'FormKeyDown'#10'ParentFont'#8#8'Position'#7
|
||||||
+'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'
|
+#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.25'#0#10'TStatusBar'#9'StatusBar'
|
||||||
+#6#6'0.9.25'#0#10'TStatusBar'#9'StatusBar'#6'Height'#2#20#3'Top'#3#24#1#5'Wi'
|
+#6'Height'#2#21#3'Top'#3#23#1#5'Width'#3#131#2#6'Panels'#14#0#0#0#9'TListVie'
|
||||||
+'dth'#3#131#2#6'Panels'#14#0#0#0#9'TListView'#6'lvTodo'#6'Height'#3#232#0#3
|
+'w'#6'lvTodo'#6'Height'#3#231#0#3'Top'#2'0'#5'Width'#3#131#2#5'Align'#7#8'al'
|
||||||
+'Top'#2'0'#5'Width'#3#131#2#5'Align'#7#8'alClient'#7'Columns'#14#1#8'AutoSiz'
|
+'Client'#7'Columns'#14#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'9'
|
||||||
+'e'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0#1#8'AutoSize'#9#7'Caption'#6#7
|
+#0#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'9'#0#1#8'AutoSize'#9#7
|
||||||
+'Caption'#5'Width'#2'*'#0#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2
|
+'Caption'#6#7'Caption'#5'Width'#2'9'#0#1#8'AutoSize'#9#7'Caption'#6#7'Captio'
|
||||||
+'*'#0#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0#1#7'Caption'#6
|
+'n'#5'Width'#2'9'#0#1#7'Caption'#6#7'Caption'#0#1#7'Caption'#6#7'Caption'#0#1
|
||||||
+#7'Caption'#0#1#7'Caption'#6#7'Caption'#0#1#7'Caption'#6#7'Caption'#5'Width'
|
+#7'Caption'#6#7'Caption'#5'Width'#3';'#1#0#0#9'RowSelect'#9#10'ScrollBars'#7
|
||||||
+#3'3'#1#0#0#9'RowSelect'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#9
|
+#10'ssAutoBoth'#8'TabOrder'#2#0#9'ViewStyle'#7#8'vsReport'#7'OnClick'#7#11'l'
|
||||||
+'ViewStyle'#7#8'vsReport'#7'OnClick'#7#11'lvTodoClick'#0#0#8'TToolBar'#7'Too'
|
+'vTodoClick'#0#0#8'TToolBar'#7'ToolBar'#6'Height'#2'0'#5'Width'#3#131#2#8'Au'
|
||||||
+'lBar'#6'Height'#2'0'#5'Width'#3#131#2#8'AutoSize'#9#12'ButtonHeight'#2'.'#11
|
+'toSize'#9#12'ButtonHeight'#2'.'#11'ButtonWidth'#2'/'#7'Caption'#6#7'ToolBar'
|
||||||
+'ButtonWidth'#2'/'#7'Caption'#6#7'ToolBar'#4'Flat'#9#14'ParentShowHint'#8#12
|
+#4'Flat'#9#14'ParentShowHint'#8#12'ShowCaptions'#9#8'ShowHint'#9#8'TabOrder'
|
||||||
+'ShowCaptions'#9#8'ShowHint'#9#8'TabOrder'#2#1#0#11'TToolButton'#9'tbOptions'
|
+#2#1#0#11'TToolButton'#9'tbOptions'#4'Left'#3#189#0#3'Top'#2#2#10'AllowAllUp'
|
||||||
+#4'Left'#3#161#0#3'Top'#2#2#10'AllowAllUp'#9#8'AutoSize'#9#7'Caption'#6#7'Op'
|
+#9#8'AutoSize'#9#7'Caption'#6#7'Options'#7'Visible'#8#0#0#11'TToolButton'#7
|
||||||
+'tions'#7'Visible'#8#0#0#11'TToolButton'#7'tbPrint'#4'Left'#3#128#0#3'Top'#2
|
+'tbPrint'#4'Left'#3#142#0#3'Top'#2#2#8'AutoSize'#9#7'Caption'#6#5'Print'#7'V'
|
||||||
+#2#8'AutoSize'#9#7'Caption'#6#5'Print'#7'Visible'#8#0#0#11'TToolButton'#9'tb'
|
+'isible'#8#0#0#11'TToolButton'#9'tbRefresh'#4'Left'#2#1#3'Top'#2#2#6'Action'
|
||||||
+'Refresh'#4'Left'#2#1#3'Top'#2#2#6'Action'#7#9'acRefresh'#8'AutoSize'#9#0#0
|
+#7#9'acRefresh'#8'AutoSize'#9#0#0#11'TToolButton'#6'tbGoto'#4'Left'#2'0'#3'T'
|
||||||
+#11'TToolButton'#6'tbGoto'#4'Left'#2'3'#3'Top'#2#2#6'Action'#7#6'acGoto'#8'A'
|
+'op'#2#2#6'Action'#7#6'acGoto'#8'AutoSize'#9#0#0#11'TToolButton'#8'tbExport'
|
||||||
+'utoSize'#9#0#0#11'TToolButton'#8'tbExport'#4'Left'#2'U'#3'Top'#2#2#6'Action'
|
+#4'Left'#2'_'#3'Top'#2#2#6'Action'#7#8'acExport'#8'AutoSize'#9#0#0#0#11'TAct'
|
||||||
+#7#8'acExport'#8'AutoSize'#9#0#0#0#11'TActionList'#10'ActionList'#4'left'#3
|
+'ionList'#10'ActionList'#4'left'#3#158#1#3'top'#2#11#0#7'TAction'#6'acGoto'#7
|
||||||
+#158#1#3'top'#2#11#0#7'TAction'#6'acGoto'#7'Caption'#6#4'Goto'#18'DisableIfN'
|
+'Caption'#6#4'Goto'#18'DisableIfNoHandler'#9#9'OnExecute'#7#13'acGotoExecute'
|
||||||
+'oHandler'#9#9'OnExecute'#7#13'acGotoExecute'#0#0#7'TAction'#9'acRefresh'#7
|
+#0#0#7'TAction'#9'acRefresh'#7'Caption'#6#7'Refresh'#18'DisableIfNoHandler'#9
|
||||||
+'Caption'#6#7'Refresh'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'acRefreshE'
|
+#9'OnExecute'#7#16'acRefreshExecute'#0#0#7'TAction'#8'acExport'#7'Caption'#6
|
||||||
+'xecute'#0#0#7'TAction'#8'acExport'#7'Caption'#6#6'Export'#18'DisableIfNoHan'
|
+#6'Export'#18'DisableIfNoHandler'#9#9'OnExecute'#7#15'acExportExecute'#0#0#0
|
||||||
+'dler'#9#9'OnExecute'#7#15'acExportExecute'#0#0#0#11'TSaveDialog'#11'SaveDia'
|
+#11'TSaveDialog'#11'SaveDialog1'#6'OnShow'#7#15'SaveDialog1Show'#10'DefaultE'
|
||||||
+'log1'#6'OnShow'#7#15'SaveDialog1Show'#10'DefaultExt'#6#4'.csv'#6'Filter'#6#9
|
+'xt'#6#4'.csv'#6'Filter'#6#9'csv|*.csv'#7'Options'#11#14'ofCreatePrompt'#14
|
||||||
+'csv|*.csv'#7'Options'#11#14'ofCreatePrompt'#14'ofEnableSizing'#12'ofViewDet'
|
+'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#192#1#3'top'#2#11#0#0#0
|
||||||
+'ail'#0#4'left'#3#192#1#3'top'#2#11#0#0#0
|
|
||||||
]);
|
]);
|
||||||
|
@ -487,30 +487,34 @@ var CommaList : TStringList;
|
|||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SaveDialog1.FileName:='TodoList_'+FormatDateTime('YYYY_MM_DD',now);
|
SaveDialog1.FileName:='TodoList_'+FormatDateTime('YYYY_MM_DD',now);
|
||||||
if SaveDialog1.Execute then
|
if SaveDialog1.Execute then
|
||||||
begin
|
begin
|
||||||
CommaList:=TStringList.Create;
|
CommaList:=TStringList.Create;
|
||||||
try
|
try
|
||||||
CommaList.Add('Done,Description,Priority,Module,Line,Owner,Category');
|
CommaList.Add('Done,Description,Priority,Module,Line,Owner,Category');
|
||||||
i:=0;
|
i:=0;
|
||||||
while i<lvTodo.Items.Count do
|
while i<lvTodo.Items.Count do
|
||||||
begin
|
begin
|
||||||
todoItm:=TTodoItem(lvTodo.Items[i].Data);
|
todoItm:=TTodoItem(lvTodo.Items[i].Data);
|
||||||
if todoItm.Done then s:='X,' else s:=' ,';
|
if todoItm.Done then
|
||||||
t:=DelChars(todoItm.Text,',');{Strip any commas that can cause a faulty csv file}
|
s:='X,'
|
||||||
s:=s+t+','+IntToStr(todoItm.Priority)+','+todoItm.Filename+
|
else
|
||||||
','+IntToStr(todoItm.LineNumber)+','+todoItm.Owner+','+todoItm.Category;
|
s:=' ,';
|
||||||
CommaList.Add(s);
|
t:=DelChars(todoItm.Text,',');{Strip any commas that can cause a faulty csv file}
|
||||||
i:=i+1;
|
s:=s+t+','+IntToStr(todoItm.Priority)+','+todoItm.Filename+
|
||||||
end;
|
','+IntToStr(todoItm.LineNumber)+','+todoItm.Owner+','+todoItm.Category;
|
||||||
CommaList.SaveToFile(UTF8ToSys(SaveDialog1.FileName));
|
CommaList.Add(s);
|
||||||
finally
|
i:=i+1;
|
||||||
CommaList.Clear;
|
end;
|
||||||
CommaList.Free;
|
CommaList.SaveToFile(UTF8ToSys(SaveDialog1.FileName));
|
||||||
end;
|
finally
|
||||||
end
|
CommaList.Clear;
|
||||||
else MessageDlg('Warning','Filename is: '+SaveDialog1.FileName,mtWarning,[mbClose],0);
|
CommaList.Free;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
MessageDlg('Warning','Filename is: '+SaveDialog1.FileName,mtWarning,[mbClose],0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmTodo.acRefreshExecute(Sender: TObject);
|
procedure TfrmTodo.acRefreshExecute(Sender: TObject);
|
||||||
@ -526,7 +530,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if fBuild then Exit;
|
if fBuild then Exit;
|
||||||
|
|
||||||
//DebugLn(['TfrmTodo.acRefreshExecute MainSourceFilename=',MainSourceFilename]);
|
DebugLn(['TfrmTodo.acRefreshExecute MainSourceFilename=',MainSourceFilename]);
|
||||||
|
|
||||||
Screen.Cursor:=crHourGlass;
|
Screen.Cursor:=crHourGlass;
|
||||||
Owners:=nil;
|
Owners:=nil;
|
||||||
@ -644,7 +648,6 @@ var
|
|||||||
begin
|
begin
|
||||||
DebugLn(['TfrmTodo.ScanFile ',aFileName]);
|
DebugLn(['TfrmTodo.ScanFile ',aFileName]);
|
||||||
ExpandedFilename:=TrimFilename(aFileName);
|
ExpandedFilename:=TrimFilename(aFileName);
|
||||||
if not FilenameIsPascalUnit(ExpandedFilename) then exit;
|
|
||||||
|
|
||||||
Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
|
Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
|
||||||
if Code=nil then exit;
|
if Code=nil then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user