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