- Timestamp:
- Feb 3, 2011, 8:01:00 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FreePascalManager.lpi
r3 r4 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count="1 1">40 <Units Count="14"> 41 41 <Unit0> 42 42 <Filename Value="FreePascalManager.lpr"/> 43 43 <IsPartOfProject Value="True"/> 44 44 <UnitName Value="FreePascalManager"/> 45 <UsageCount Value="27"/> 45 <WindowIndex Value="0"/> 46 <TopLine Value="1"/> 47 <CursorPos X="1" Y="15"/> 48 <UsageCount Value="63"/> 46 49 </Unit0> 47 50 <Unit1> … … 51 54 <ResourceBaseClass Value="Form"/> 52 55 <UnitName Value="UMainForm"/> 56 <IsVisibleTab Value="True"/> 53 57 <EditorIndex Value="0"/> 54 58 <WindowIndex Value="0"/> 55 <TopLine Value="1 "/>56 <CursorPos X=" 33" Y="18"/>57 <UsageCount Value=" 27"/>59 <TopLine Value="140"/> 60 <CursorPos X="60" Y="144"/> 61 <UsageCount Value="63"/> 58 62 <Loaded Value="True"/> 59 63 <LoadedDesigner Value="True"/> … … 67 71 <EditorIndex Value="2"/> 68 72 <WindowIndex Value="0"/> 69 <TopLine Value=" 37"/>70 <CursorPos X=" 29" Y="52"/>71 <UsageCount Value=" 27"/>73 <TopLine Value="81"/> 74 <CursorPos X="77" Y="102"/> 75 <UsageCount Value="63"/> 72 76 <Loaded Value="True"/> 73 77 <LoadedDesigner Value="True"/> … … 77 81 <IsPartOfProject Value="True"/> 78 82 <UnitName Value="UInstance"/> 79 <EditorIndex Value=" 4"/>80 <WindowIndex Value="0"/> 81 <TopLine Value=" 4"/>82 <CursorPos X=" 1" Y="18"/>83 <UsageCount Value=" 27"/>83 <EditorIndex Value="3"/> 84 <WindowIndex Value="0"/> 85 <TopLine Value="13"/> 86 <CursorPos X="24" Y="27"/> 87 <UsageCount Value="63"/> 84 88 <Loaded Value="True"/> 85 89 </Unit3> … … 88 92 <IsPartOfProject Value="True"/> 89 93 <UnitName Value="USource"/> 90 <IsVisibleTab Value="True"/> 91 <EditorIndex Value="5"/> 92 <WindowIndex Value="0"/> 93 <TopLine Value="49"/> 94 <CursorPos X="14" Y="54"/> 95 <UsageCount Value="27"/> 94 <EditorIndex Value="4"/> 95 <WindowIndex Value="0"/> 96 <TopLine Value="77"/> 97 <CursorPos X="39" Y="108"/> 98 <UsageCount Value="63"/> 96 99 <Loaded Value="True"/> 97 100 </Unit4> … … 101 104 <TopLine Value="1670"/> 102 105 <CursorPos X="14" Y="1683"/> 103 <UsageCount Value=" 10"/>106 <UsageCount Value="7"/> 104 107 </Unit5> 105 108 <Unit6> 106 109 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\lclclasses.pp"/> 107 110 <UnitName Value="LCLClasses"/> 108 <WindowIndex Value="0"/> 109 <TopLine Value="5"/> 111 <EditorIndex Value="1"/> 112 <WindowIndex Value="0"/> 113 <TopLine Value="34"/> 110 114 <CursorPos X="20" Y="47"/> 111 <UsageCount Value="9"/> 115 <UsageCount Value="10"/> 116 <Loaded Value="True"/> 112 117 </Unit6> 113 118 <Unit7> 114 119 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\packages\fcl-xml\src\dom.pp"/> 115 120 <UnitName Value="DOM"/> 116 <EditorIndex Value="1"/> 117 <WindowIndex Value="0"/> 118 <TopLine Value="233"/> 119 <CursorPos X="14" Y="246"/> 120 <UsageCount Value="13"/> 121 <Loaded Value="True"/> 121 <WindowIndex Value="0"/> 122 <TopLine Value="253"/> 123 <CursorPos X="14" Y="266"/> 124 <UsageCount Value="29"/> 122 125 </Unit7> 123 126 <Unit8> 124 127 <Filename Value="E:\Projekty\Knihovny\Free Pascal\synapse\httpsend.pas"/> 125 128 <UnitName Value="httpsend"/> 126 <EditorIndex Value="3"/>127 129 <WindowIndex Value="0"/> 128 130 <TopLine Value="749"/> 129 131 <CursorPos X="3" Y="753"/> 130 <UsageCount Value="11"/> 131 <Loaded Value="True"/> 132 <UsageCount Value="27"/> 132 133 </Unit8> 133 134 <Unit9> … … 136 137 <TopLine Value="58"/> 137 138 <CursorPos X="72" Y="81"/> 138 <UsageCount Value=" 21"/>139 <UsageCount Value="18"/> 139 140 <DefaultSyntaxHighlighter Value="XML"/> 140 141 </Unit9> … … 144 145 <TopLine Value="1"/> 145 146 <CursorPos X="46" Y="49"/> 146 <UsageCount Value=" 20"/>147 <UsageCount Value="16"/> 147 148 <DefaultSyntaxHighlighter Value="XML"/> 148 149 </Unit10> 150 <Unit11> 151 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\packages\fcl-base\src\contnrs.pp"/> 152 <UnitName Value="contnrs"/> 153 <WindowIndex Value="0"/> 154 <TopLine Value="67"/> 155 <CursorPos X="17" Y="80"/> 156 <UsageCount Value="27"/> 157 </Unit11> 158 <Unit12> 159 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\include\customform.inc"/> 160 <WindowIndex Value="0"/> 161 <TopLine Value="865"/> 162 <CursorPos X="1" Y="878"/> 163 <UsageCount Value="10"/> 164 </Unit12> 165 <Unit13> 166 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\forms.pp"/> 167 <UnitName Value="Forms"/> 168 <WindowIndex Value="0"/> 169 <TopLine Value="594"/> 170 <CursorPos X="14" Y="607"/> 171 <UsageCount Value="10"/> 172 </Unit13> 149 173 </Units> 150 174 <JumpHistory Count="30" HistoryIndex="29"> 151 175 <Position1> 152 <Filename Value="U Source.pas"/>153 <Caret Line=" 79" Column="1" TopLine="65"/>176 <Filename Value="UOptions.pas"/> 177 <Caret Line="106" Column="18" TopLine="95"/> 154 178 </Position1> 155 179 <Position2> 156 <Filename Value="U Source.pas"/>157 <Caret Line=" 80" Column="1" TopLine="65"/>180 <Filename Value="UMainForm.pas"/> 181 <Caret Line="77" Column="24" TopLine="65"/> 158 182 </Position2> 159 183 <Position3> 160 <Filename Value="U Source.pas"/>161 <Caret Line=" 78" Column="36" TopLine="65"/>184 <Filename Value="UOptions.pas"/> 185 <Caret Line="139" Column="1" TopLine="128"/> 162 186 </Position3> 163 187 <Position4> 164 <Filename Value="U Source.pas"/>165 <Caret Line="7 7" Column="1" TopLine="65"/>188 <Filename Value="UOptions.pas"/> 189 <Caret Line="72" Column="1" TopLine="62"/> 166 190 </Position4> 167 191 <Position5> 168 <Filename Value="U Source.pas"/>169 <Caret Line=" 79" Column="1" TopLine="65"/>192 <Filename Value="UOptions.pas"/> 193 <Caret Line="102" Column="77" TopLine="81"/> 170 194 </Position5> 171 195 <Position6> 172 <Filename Value="U Source.pas"/>173 <Caret Line=" 80" Column="1" TopLine="65"/>196 <Filename Value="UMainForm.pas"/> 197 <Caret Line="243" Column="35" TopLine="221"/> 174 198 </Position6> 175 199 <Position7> 176 <Filename Value="U Source.pas"/>177 <Caret Line=" 85" Column="1" TopLine="65"/>200 <Filename Value="UMainForm.pas"/> 201 <Caret Line="141" Column="35" TopLine="139"/> 178 202 </Position7> 179 203 <Position8> 180 <Filename Value="U Source.pas"/>181 <Caret Line=" 78" Column="17" TopLine="65"/>204 <Filename Value="UMainForm.pas"/> 205 <Caret Line="142" Column="35" TopLine="140"/> 182 206 </Position8> 183 207 <Position9> 184 <Filename Value="U Options.pas"/>185 <Caret Line=" 48" Column="16" TopLine="37"/>208 <Filename Value="UMainForm.pas"/> 209 <Caret Line="143" Column="35" TopLine="141"/> 186 210 </Position9> 187 211 <Position10> 188 <Filename Value="U Options.pas"/>189 <Caret Line=" 52" Column="29" TopLine="37"/>212 <Filename Value="UMainForm.pas"/> 213 <Caret Line="144" Column="35" TopLine="142"/> 190 214 </Position10> 191 215 <Position11> 192 <Filename Value="U Source.pas"/>193 <Caret Line=" 76" Column="19" TopLine="59"/>216 <Filename Value="UMainForm.pas"/> 217 <Caret Line="145" Column="35" TopLine="143"/> 194 218 </Position11> 195 219 <Position12> 196 <Filename Value="U Source.pas"/>197 <Caret Line=" 85" Column="1" TopLine="72"/>220 <Filename Value="UMainForm.pas"/> 221 <Caret Line="146" Column="35" TopLine="144"/> 198 222 </Position12> 199 223 <Position13> 200 <Filename Value="U Source.pas"/>201 <Caret Line=" 97" Column="54" TopLine="78"/>224 <Filename Value="UMainForm.pas"/> 225 <Caret Line="158" Column="1" TopLine="145"/> 202 226 </Position13> 203 227 <Position14> 204 <Filename Value="U Source.pas"/>205 <Caret Line=" 83" Column="1" TopLine="78"/>228 <Filename Value="UMainForm.pas"/> 229 <Caret Line="164" Column="1" TopLine="145"/> 206 230 </Position14> 207 231 <Position15> 208 <Filename Value="U Source.pas"/>209 <Caret Line=" 84" Column="1" TopLine="78"/>232 <Filename Value="UMainForm.pas"/> 233 <Caret Line="165" Column="1" TopLine="145"/> 210 234 </Position15> 211 235 <Position16> 212 <Filename Value="U Source.pas"/>213 <Caret Line=" 85" Column="1" TopLine="78"/>236 <Filename Value="UMainForm.pas"/> 237 <Caret Line="166" Column="1" TopLine="145"/> 214 238 </Position16> 215 239 <Position17> 216 <Filename Value="U Source.pas"/>217 <Caret Line=" 86" Column="1" TopLine="78"/>240 <Filename Value="UMainForm.pas"/> 241 <Caret Line="167" Column="1" TopLine="146"/> 218 242 </Position17> 219 243 <Position18> 220 <Filename Value="U Source.pas"/>221 <Caret Line=" 87" Column="1" TopLine="78"/>244 <Filename Value="UMainForm.pas"/> 245 <Caret Line="168" Column="1" TopLine="147"/> 222 246 </Position18> 223 247 <Position19> 224 <Filename Value="U Source.pas"/>225 <Caret Line=" 88" Column="1" TopLine="78"/>248 <Filename Value="UMainForm.pas"/> 249 <Caret Line="165" Column="1" TopLine="148"/> 226 250 </Position19> 227 251 <Position20> 228 <Filename Value="U Source.pas"/>229 <Caret Line=" 89" Column="1" TopLine="78"/>252 <Filename Value="UMainForm.pas"/> 253 <Caret Line="164" Column="6" TopLine="148"/> 230 254 </Position20> 231 255 <Position21> 232 <Filename Value="U Source.pas"/>233 <Caret Line=" 90" Column="1" TopLine="78"/>256 <Filename Value="UMainForm.pas"/> 257 <Caret Line="155" Column="11" TopLine="154"/> 234 258 </Position21> 235 259 <Position22> 236 <Filename Value="U Source.pas"/>237 <Caret Line=" 91" Column="1" TopLine="78"/>260 <Filename Value="UMainForm.pas"/> 261 <Caret Line="101" Column="15" TopLine="98"/> 238 262 </Position22> 239 263 <Position23> 240 <Filename Value="U Source.pas"/>241 <Caret Line=" 92" Column="1" TopLine="78"/>264 <Filename Value="UMainForm.pas"/> 265 <Caret Line="130" Column="1" TopLine="130"/> 242 266 </Position23> 243 267 <Position24> 244 <Filename Value="U Source.pas"/>245 <Caret Line=" 93" Column="1" TopLine="78"/>268 <Filename Value="UMainForm.pas"/> 269 <Caret Line="174" Column="46" TopLine="160"/> 246 270 </Position24> 247 271 <Position25> 248 <Filename Value="U Source.pas"/>249 <Caret Line=" 94" Column="1" TopLine="78"/>272 <Filename Value="UMainForm.pas"/> 273 <Caret Line="176" Column="11" TopLine="163"/> 250 274 </Position25> 251 275 <Position26> 252 <Filename Value="U Source.pas"/>253 <Caret Line=" 95" Column="1" TopLine="78"/>276 <Filename Value="UMainForm.pas"/> 277 <Caret Line="131" Column="56" TopLine="127"/> 254 278 </Position26> 255 279 <Position27> 256 <Filename Value="U Source.pas"/>257 <Caret Line=" 96" Column="1" TopLine="78"/>280 <Filename Value="UMainForm.pas"/> 281 <Caret Line="132" Column="56" TopLine="128"/> 258 282 </Position27> 259 283 <Position28> 260 <Filename Value="U Source.pas"/>261 <Caret Line=" 99" Column="1" TopLine="78"/>284 <Filename Value="UMainForm.pas"/> 285 <Caret Line="133" Column="56" TopLine="129"/> 262 286 </Position28> 263 287 <Position29> 264 <Filename Value="U Source.pas"/>265 <Caret Line="1 00" Column="1" TopLine="79"/>288 <Filename Value="UMainForm.pas"/> 289 <Caret Line="134" Column="56" TopLine="130"/> 266 290 </Position29> 267 291 <Position30> 268 <Filename Value="U Source.pas"/>269 <Caret Line=" 99" Column="30" TopLine="80"/>292 <Filename Value="UMainForm.pas"/> 293 <Caret Line="133" Column="1" TopLine="131"/> 270 294 </Position30> 271 295 </JumpHistory> … … 281 305 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 282 306 </SearchPaths> 307 <CodeGeneration> 308 <Checks> 309 <IOChecks Value="True"/> 310 <RangeChecks Value="True"/> 311 <OverflowChecks Value="True"/> 312 <StackChecks Value="True"/> 313 </Checks> 314 <VerifyObjMethodCallValidity Value="True"/> 315 </CodeGeneration> 283 316 <Linking> 317 <Debugging> 318 <UseHeaptrc Value="True"/> 319 </Debugging> 284 320 <Options> 285 321 <Win32> … … 289 325 </Linking> 290 326 <Other> 327 <CompilerMessages> 328 <UseMsgFile Value="True"/> 329 </CompilerMessages> 291 330 <CompilerPath Value="$(CompPath)"/> 292 331 </Other> 293 332 </CompilerOptions> 294 333 <Debugging> 295 <BreakPoints Count="3">296 <Item1>297 <Source Value="UMainForm.pas"/>298 <Line Value="240"/>299 </Item1>300 <Item2>301 <Source Value="USource.pas"/>302 <Line Value="83"/>303 </Item2>304 <Item3>305 <Source Value="USource.pas"/>306 <Line Value="52"/>307 </Item3>308 </BreakPoints>309 334 <Exceptions Count="3"> 310 335 <Item1> -
trunk/UInstance.pas
r2 r4 6 6 7 7 uses 8 Classes, SysUtils, USource ;8 Classes, SysUtils, USource, Contnrs; 9 9 10 10 type 11 12 11 { TInstance } 13 12 … … 15 14 Id: Integer; 16 15 Name: string; 16 Downloaded: Boolean; 17 Compiled: Boolean; 17 18 IDESource: TSource; 18 19 IDERevision: string; … … 24 25 procedure Start; 25 26 procedure Update; 27 procedure Download; 28 end; 29 30 { TInstanceList } 31 32 TInstanceList = class(TObjectList) 33 function GetNewId: Integer; 26 34 end; 27 35 28 36 implementation 37 38 { TInstanceList } 39 40 function TInstanceList.GetNewId: Integer; 41 var 42 I: Integer; 43 begin 44 Result := 1; 45 for I := 0 to Count - 1 do 46 if TInstance(Items[I]).Id >= Result then 47 Result := TInstance(Items[I]).Id + 1; 48 end; 29 49 30 50 { TInstance } … … 45 65 end; 46 66 67 procedure TInstance.Download; 68 begin 69 70 end; 71 47 72 end. 48 73 -
trunk/UMainForm.lfm
r3 r4 1 1 object MainForm: TMainForm 2 Left = 2 662 Left = 259 3 3 Height = 363 4 Top = 13 95 Width = 5674 Top = 138 5 Width = 643 6 6 Caption = 'Free Pascal Manager' 7 7 ClientHeight = 363 8 ClientWidth = 5678 ClientWidth = 643 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy … … 15 15 Height = 301 16 16 Top = 24 17 Width = 54817 Width = 624 18 18 Anchors = [akTop, akLeft, akRight, akBottom] 19 19 Columns = < … … 29 29 Caption = 'IDE version' 30 30 Width = 150 31 end 32 item 33 Caption = 'Downloaded' 34 end 35 item 36 Caption = 'Compiled' 31 37 end> 32 38 OwnerData = True 39 PopupMenu = PopupMenu1 33 40 ReadOnly = True 34 41 RowSelect = True … … 48 55 object Button1: TButton 49 56 Left = 8 50 Height = 2 757 Height = 25 51 58 Top = 333 52 59 Width = 75 … … 56 63 end 57 64 object Button2: TButton 58 Left = 9 665 Left = 90 59 66 Height = 25 60 67 Top = 333 … … 65 72 end 66 73 object Button3: TButton 67 Left = 1 8474 Left = 172 68 75 Height = 25 69 76 Top = 333 … … 75 82 end 76 83 object Button4: TButton 77 Left = 27284 Left = 336 78 85 Height = 25 79 86 Top = 333 … … 83 90 TabOrder = 4 84 91 end 85 object Button 5: TButton86 Left = 4 4092 object ButtonEdit: TButton 93 Left = 496 87 94 Height = 25 88 95 Top = 333 89 96 Width = 75 90 Action = A Options91 Anchors = [akLeft ]97 Action = AEdit 98 Anchors = [akLeft, akBottom] 92 99 TabOrder = 5 93 100 end 94 101 object Button6: TButton 95 Left = 355102 Left = 416 96 103 Height = 25 97 104 Top = 333 … … 100 107 Anchors = [akLeft, akBottom] 101 108 TabOrder = 6 109 end 110 object Button5: TButton 111 Left = 254 112 Height = 25 113 Top = 333 114 Width = 75 115 Action = ADownload 116 TabOrder = 7 102 117 end 103 118 object ActionList1: TActionList … … 116 131 OnExecute = AStartExecute 117 132 end 118 object A Update: TAction119 Caption = ' Update'120 OnExecute = A UpdateExecute133 object ADownload: TAction 134 Caption = 'Download' 135 OnExecute = ADownloadExecute 121 136 end 122 object AOptions: TAction 123 Caption = 'Options' 137 object AEdit: TAction 138 Caption = 'Edit' 139 OnExecute = AEditExecute 124 140 end 125 141 object ACompile: TAction … … 127 143 OnExecute = ACompileExecute 128 144 end 145 object AUpdate: TAction 146 Caption = 'Update' 147 OnExecute = AUpdateExecute 148 end 149 end 150 object PopupMenu1: TPopupMenu 151 left = 40 152 top = 66 153 object MenuItem2: TMenuItem 154 Action = AStart 155 end 156 object MenuItem6: TMenuItem 157 Action = ADownload 158 end 159 object MenuItem3: TMenuItem 160 Action = ACompile 161 end 162 object MenuItem4: TMenuItem 163 Action = ADownload 164 end 165 object MenuItem5: TMenuItem 166 Action = ARemove 167 end 168 object MenuItem1: TMenuItem 169 Action = AEdit 170 end 129 171 end 130 172 end -
trunk/UMainForm.pas
r3 r4 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 StdCtrls, ActnList, Contnrs, USource, UInstance, UOptions,9 StdCtrls, ActnList, Menus, Contnrs, USource, UInstance, UOptions, 10 10 DOM, XMLWrite, XMLRead, HTTPSend; 11 11 … … 14 14 SourceURL = 'http://tv.zdechov.net/fpc/SourceList.xml'; 15 15 16 const 17 BooleanText: array[Boolean] of string = ('No', 'Yes'); 18 16 19 type 17 20 … … 21 24 AAdd: TAction; 22 25 ACompile: TAction; 23 AOptions: TAction; 26 AUpdate: TAction; 27 AEdit: TAction; 24 28 ARemove: TAction; 25 29 AStart: TAction; 26 A Update: TAction;30 ADownload: TAction; 27 31 ActionList1: TActionList; 28 32 Button1: TButton; … … 31 35 Button4: TButton; 32 36 Button5: TButton; 37 ButtonEdit: TButton; 33 38 Button6: TButton; 34 39 Label1: TLabel; 35 40 ListView1: TListView; 41 MenuItem1: TMenuItem; 42 MenuItem2: TMenuItem; 43 MenuItem3: TMenuItem; 44 MenuItem4: TMenuItem; 45 MenuItem5: TMenuItem; 46 MenuItem6: TMenuItem; 47 PopupMenu1: TPopupMenu; 36 48 procedure AAddExecute(Sender: TObject); 37 49 procedure ACompileExecute(Sender: TObject); 50 procedure AEditExecute(Sender: TObject); 38 51 procedure ARemoveExecute(Sender: TObject); 39 52 procedure AStartExecute(Sender: TObject); 53 procedure ADownloadExecute(Sender: TObject); 40 54 procedure AUpdateExecute(Sender: TObject); 41 55 procedure FormCreate(Sender: TObject); … … 50 64 procedure SaveInstanceList; 51 65 public 52 Instances: T ObjectList;66 Instances: TInstanceList; 53 67 Sources: TSourceList; 54 68 end; … … 65 79 procedure TMainForm.FormCreate(Sender: TObject); 66 80 begin 67 Instances := T ObjectList.Create;81 Instances := TInstanceList.Create; 68 82 Sources := TSourceList.Create; 69 83 LoadInstanceList; … … 72 86 procedure TMainForm.AAddExecute(Sender: TObject); 73 87 begin 74 OptionsForm.ShowModal; 88 OptionsForm.Instance := nil; 89 if OptionsForm.ShowModal = mrOK then begin 90 Instances.Add(OptionsForm.Instance); 91 ReloadList; 92 end; 75 93 end; 76 94 … … 84 102 end; 85 103 104 procedure TMainForm.AEditExecute(Sender: TObject); 105 begin 106 if Assigned(ListView1.Selected) then begin 107 OptionsForm.Instance := ListView1.Selected.Data; 108 if OptionsForm.ShowModal = mrYes then 109 ReloadList; 110 end; 111 end; 112 86 113 procedure TMainForm.ARemoveExecute(Sender: TObject); 87 114 begin … … 98 125 if ListView1.Selected.Index < Instances.Count then begin 99 126 TInstance(Instances[ListView1.Selected.Index]).Start; 127 ReloadList; 128 end; 129 end; 130 131 procedure TMainForm.ADownloadExecute(Sender: TObject); 132 begin 133 if Assigned(ListView1.Selected) then 134 if ListView1.Selected.Index < Instances.Count then begin 135 TInstance(Instances[ListView1.Selected.Index]).Download; 100 136 ReloadList; 101 137 end; … … 120 156 procedure TMainForm.FormShow(Sender: TObject); 121 157 begin 158 ReloadList; 122 159 ListView1SelectItem(nil, nil, False); 123 160 end; … … 129 166 Item.Caption := Name; 130 167 Item.Data := Instances[Item.Index]; 131 Item.SubItems.Add(FPCRevision); 132 Item.SubItems.Add(IDERevision); 168 if Assigned(FPCSource) then 169 Item.SubItems.Add(FPCSource.Name + ' ' + FPCSource.VersionNumber) 170 else Item.SubItems.Add(''); 171 if Assigned(IDESource) then 172 Item.SubItems.Add(IDESource.Name + ' ' + IDESource.VersionNumber) 173 else Item.SubItems.Add(''); 174 Item.SubItems.Add(BooleanText[Downloaded]); 175 Item.SubItems.Add(BooleanText[Compiled]); 133 176 end; 134 177 end; … … 137 180 Selected: Boolean); 138 181 begin 139 ACompile.Enabled := Assigned(ListView1.Selected); 140 AUpdate.Enabled := Assigned(ListView1.Selected); 141 AStart.Enabled := Assigned(ListView1.Selected); 142 ARemove.Enabled := Assigned(ListView1.Selected); 143 AOptions.Enabled := Assigned(ListView1.Selected); 182 if Assigned(ListView1.Selected) then 183 with TInstance(ListView1.Selected.Data) do begin 184 AEdit.Enabled := True; 185 ACompile.Enabled := Downloaded; 186 ADownload.Enabled := True; 187 AStart.Enabled := Downloaded and Compiled; 188 ARemove.Enabled := True; 189 end else begin 190 AEdit.Enabled := False; 191 ACompile.Enabled := False; 192 ADownload.Enabled := False; 193 AStart.Enabled := False; 194 ARemove.Enabled := False; 195 end; 144 196 end; 145 197 … … 164 216 ReadXMLFile(Doc, UTF8Decode(ConfigFileName)); 165 217 166 Instances. Free;167 Sources. Free;218 Instances.Clear; 219 Sources.Clear; 168 220 169 221 NewNode := Doc.DocumentElement.FindNode('Sources'); … … 172 224 NewSource := TSource.Create; 173 225 with NewSource do begin 174 NewNode := Doc.DocumentElement.FindNode('Id');226 NewNode := Child.FindNode('Id'); 175 227 if Assigned(NewNode) then 176 228 Id := StrToInt(NewNode.TextContent); 177 NewNode := Doc.DocumentElement.FindNode('Name');229 NewNode := Child.FindNode('Name'); 178 230 if Assigned(NewNode) then 179 231 Name := UTF8Encode(string(NewNode.TextContent)); 180 NewNode := Doc.DocumentElement.FindNode('SubversionURL');232 NewNode := Child.FindNode('SubversionURL'); 181 233 if Assigned(NewNode) then 182 234 SubversionURL := UTF8Encode(string(NewNode.TextContent)); 183 NewNode := Doc.DocumentElement.FindNode('VersionNumber');235 NewNode := Child.FindNode('VersionNumber'); 184 236 if Assigned(NewNode) then 185 237 VersionNumber := UTF8Encode(string(NewNode.TextContent)); 186 NewNode := Doc.DocumentElement.FindNode('VersionType');238 NewNode := Child.FindNode('VersionType'); 187 239 if Assigned(NewNode) then 188 240 VersionType := UTF8Encode(string(NewNode.TextContent)); 189 NewNode := Doc.DocumentElement.FindNode('SourceType');241 NewNode := Child.FindNode('SourceType'); 190 242 if Assigned(NewNode) then 191 243 SourceType := TSourceType(StrToInt(NewNode.TextContent)); 192 244 end; 245 Sources.Add(NewSource); 193 246 Child := Child.NextSibling; 194 247 end; … … 199 252 NewInstance := TInstance.Create; 200 253 with NewInstance do begin 201 NewNode := Doc.DocumentElement.FindNode('Id');254 NewNode := Child.FindNode('Id'); 202 255 if Assigned(NewNode) then 203 256 Id := StrToInt(NewNode.TextContent); 204 NewNode := Doc.DocumentElement.FindNode('Name');257 NewNode := Child.FindNode('Name'); 205 258 if Assigned(NewNode) then 206 259 Name := UTF8Encode(string(NewNode.TextContent)); 207 NewNode := Doc.DocumentElement.FindNode('IDEDate');260 NewNode := Child.FindNode('IDEDate'); 208 261 if Assigned(NewNode) then 209 262 IDEDate := StrToDateTime(string(NewNode.TextContent)); 210 NewNode := Doc.DocumentElement.FindNode('IDERevision');263 NewNode := Child.FindNode('IDERevision'); 211 264 if Assigned(NewNode) then 212 265 IDERevision := UTF8Encode(string(NewNode.TextContent)); 213 NewNode := Doc.DocumentElement.FindNode('IDESource');266 NewNode := Child.FindNode('IDESource'); 214 267 if Assigned(NewNode) then 215 268 IDESource := Sources.FindById(StrToInt(NewNode.TextContent)); 216 NewNode := Doc.DocumentElement.FindNode('FPCDate');269 NewNode := Child.FindNode('FPCDate'); 217 270 if Assigned(NewNode) then 218 271 FPCDate := StrToDateTime(string(NewNode.TextContent)); 219 NewNode := Doc.DocumentElement.FindNode('FPCRevision');272 NewNode := Child.FindNode('FPCRevision'); 220 273 if Assigned(NewNode) then 221 274 FPCRevision := UTF8Encode(string(NewNode.TextContent)); 222 NewNode := Doc.DocumentElement.FindNode('FPCSource');275 NewNode := Child.FindNode('FPCSource'); 223 276 if Assigned(NewNode) then 224 277 FPCSource := Sources.FindById(StrToInt(NewNode.TextContent)); 225 278 end; 279 Instances.Add(NewInstance); 226 280 Child := Child.NextSibling; 227 281 end; … … 238 292 NewNode: TDOMNode; 239 293 NewNode2: TDOMNode; 294 NewNode3: TDOMNode; 240 295 begin 241 296 Doc := TXMLDocument.Create; … … 249 304 for I := 0 to Instances.Count - 1 do 250 305 with TInstance(Instances[I]) do begin 306 NewNode3 := OwnerDocument.CreateElement('Id'); 307 with NewNode3 do begin 251 308 NewNode2 := OwnerDocument.CreateElement('Id'); 252 309 NewNode2.TextContent := IntToStr(Id); 253 AppendChild(NewNode );310 AppendChild(NewNode2); 254 311 NewNode2 := OwnerDocument.CreateElement('Name'); 255 312 NewNode2.TextContent := UTF8Decode(Name); 256 AppendChild(NewNode );313 AppendChild(NewNode2); 257 314 NewNode2 := OwnerDocument.CreateElement('IDEDate'); 258 315 NewNode2.TextContent := DateTimeToStr(IDEDate); 259 AppendChild(NewNode );316 AppendChild(NewNode2); 260 317 NewNode2 := OwnerDocument.CreateElement('IDERevision'); 261 318 NewNode2.TextContent := UTF8Decode(IDERevision); 262 AppendChild(NewNode );319 AppendChild(NewNode2); 263 320 NewNode2 := OwnerDocument.CreateElement('IDESource'); 264 NewNode2.TextContent := IntToStr(IDESource.Id); 265 AppendChild(NewNode); 321 if Assigned(IDESource) then NewNode2.TextContent := IntToStr(IDESource.Id) 322 else NewNode2.TextContent := '0'; 323 AppendChild(NewNode2); 266 324 NewNode2 := OwnerDocument.CreateElement('FPCDate'); 267 325 NewNode2.TextContent := DateTimeToStr(FPCDate); 268 AppendChild(NewNode );326 AppendChild(NewNode2); 269 327 NewNode2 := OwnerDocument.CreateElement('FPCRevision'); 270 328 NewNode2.TextContent := UTF8Decode(FPCRevision); 271 AppendChild(NewNode );329 AppendChild(NewNode2); 272 330 NewNode2 := OwnerDocument.CreateElement('FPCSource'); 273 NewNode2.TextContent := IntToStr(FPCSource.Id); 274 AppendChild(NewNode); 331 if Assigned(IDESource) then NewNode2.TextContent := IntToStr(FPCSource.Id) 332 else NewNode2.TextContent := '0'; 333 AppendChild(NewNode2); 334 end; 335 AppendChild(NewNode3); 275 336 end; 276 337 AppendChild(NewNode); … … 280 341 for I := 0 to Sources.Count - 1 do 281 342 with TSource(Sources[I]) do begin 343 NewNode3 := OwnerDocument.CreateElement('Item'); 344 with NewNode3 do begin 282 345 NewNode2 := OwnerDocument.CreateElement('Id'); 283 346 NewNode2.TextContent := IntToStr(Id); 284 AppendChild(NewNode );347 AppendChild(NewNode2); 285 348 NewNode2 := OwnerDocument.CreateElement('Name'); 286 349 NewNode2.TextContent := UTF8Decode(Name); 287 AppendChild(NewNode );350 AppendChild(NewNode2); 288 351 NewNode2 := OwnerDocument.CreateElement('SubversionURL'); 289 352 NewNode2.TextContent := UTF8Decode(SubversionURL); 290 AppendChild(NewNode );353 AppendChild(NewNode2); 291 354 NewNode2 := OwnerDocument.CreateElement('VersionType'); 292 355 NewNode2.TextContent := UTF8Decode(VersionType); 293 AppendChild(NewNode );356 AppendChild(NewNode2); 294 357 NewNode2 := OwnerDocument.CreateElement('VersionNumber'); 295 358 NewNode2.TextContent := UTF8Decode(VersionNumber); 296 AppendChild(NewNode );359 AppendChild(NewNode2); 297 360 NewNode2 := OwnerDocument.CreateElement('SourceType'); 298 361 NewNode2.TextContent := IntToStr(Byte(SourceType)); 299 AppendChild(NewNode); 362 AppendChild(NewNode2); 363 end; 364 AppendChild(NewNode3); 300 365 end; 301 366 AppendChild(NewNode); -
trunk/UOptions.lfm
r3 r4 1 1 object OptionsForm: TOptionsForm 2 Left = 3383 Height = 4 104 Top = 1 612 Left = 274 3 Height = 424 4 Top = 106 5 5 Width = 573 6 6 Caption = 'Options' 7 ClientHeight = 4 107 ClientHeight = 424 8 8 ClientWidth = 573 9 OnCreate = FormCreate 10 OnDestroy = FormDestroy 11 OnShow = FormShow 9 12 LCLVersion = '0.9.31' 10 object Label1: TLabel11 Left = 912 Height = 1413 Top = 814 Width = 11215 Caption = 'Available FPC variants:'16 ParentColor = False17 end18 object ListView1: TListView19 Left = 720 Height = 17321 Top = 2722 Width = 56123 Anchors = [akTop, akLeft, akRight]24 Columns = <25 item26 Caption = 'Name'27 Width = 7028 end29 item30 Caption = 'Version'31 end32 item33 Caption = 'Revision'34 end35 item36 Caption = 'Date'37 Width = 6038 end39 item40 Caption = 'Source URL'41 Width = 30042 end>43 OwnerData = True44 ReadOnly = True45 RowSelect = True46 TabOrder = 047 ViewStyle = vsReport48 end49 object Label2: TLabel50 Left = 951 Height = 1452 Top = 20853 Width = 11054 Caption = 'Available IDE variants:'55 ParentColor = False56 end57 object ListView2: TListView58 Left = 959 Height = 15060 Top = 22661 Width = 55962 Anchors = [akTop, akLeft, akRight]63 Columns = <64 item65 Caption = 'Name'66 Width = 7067 end68 item69 Caption = 'Version'70 end71 item72 Caption = 'Revision'73 end74 item75 Caption = 'Date'76 Width = 6077 end78 item79 Caption = 'Source URL'80 Width = 30081 end>82 OwnerData = True83 ReadOnly = True84 RowSelect = True85 TabOrder = 186 ViewStyle = vsReport87 end88 13 object ButtonCancel: TButton 89 14 Left = 408 90 15 Height = 25 91 Top = 3 8016 Top = 394 92 17 Width = 75 18 Anchors = [akRight, akBottom] 93 19 Caption = 'Cancel' 94 TabOrder = 2 20 ModalResult = 2 21 OnClick = ButtonCancelClick 22 TabOrder = 0 95 23 end 96 24 object ButtonOk: TButton 97 25 Left = 493 98 26 Height = 25 99 Top = 3 8027 Top = 394 100 28 Width = 75 29 Anchors = [akRight, akBottom] 101 30 Caption = 'Ok' 102 TabOrder = 3 31 ModalResult = 1 32 OnClick = ButtonOkClick 33 TabOrder = 1 103 34 end 104 35 object ButtonUpdateSource: TButton 105 36 Left = 10 106 37 Height = 25 107 Top = 3 8138 Top = 395 108 39 Width = 75 40 Anchors = [akLeft, akBottom] 109 41 Caption = 'Update list' 110 42 OnClick = ButtonUpdateSourceClick 43 TabOrder = 2 44 end 45 object Panel1: TPanel 46 Left = 0 47 Height = 26 48 Top = 0 49 Width = 573 50 Align = alTop 51 BevelOuter = bvNone 52 ClientHeight = 26 53 ClientWidth = 573 54 TabOrder = 3 55 object Edit1: TEdit 56 Left = 56 57 Height = 21 58 Top = 3 59 Width = 512 60 Anchors = [akTop, akLeft, akRight] 61 TabOrder = 0 62 end 63 object Label3: TLabel 64 Left = 7 65 Height = 14 66 Top = 5 67 Width = 32 68 Caption = 'Name:' 69 ParentColor = False 70 end 71 end 72 object Panel2: TPanel 73 Left = 0 74 Height = 178 75 Top = 26 76 Width = 573 77 Align = alTop 78 BevelOuter = bvNone 79 ClientHeight = 178 80 ClientWidth = 573 111 81 TabOrder = 4 82 object ListView1: TListView 83 Left = 7 84 Height = 156 85 Top = 22 86 Width = 561 87 Anchors = [akTop, akLeft, akRight, akBottom] 88 Columns = < 89 item 90 Caption = 'Name' 91 Width = 70 92 end 93 item 94 Caption = 'Type' 95 Width = 80 96 end 97 item 98 Caption = 'Version' 99 Width = 60 100 end 101 item 102 Caption = 'Revision' 103 end 104 item 105 Caption = 'Date' 106 Width = 60 107 end 108 item 109 Caption = 'Source URL' 110 Width = 300 111 end> 112 OwnerData = True 113 ReadOnly = True 114 RowSelect = True 115 TabOrder = 0 116 ViewStyle = vsReport 117 OnData = ListView1Data 118 end 119 object Label1: TLabel 120 Left = 9 121 Height = 14 122 Top = 8 123 Width = 69 124 Caption = 'FPC selection:' 125 ParentColor = False 126 end 127 end 128 object Panel3: TPanel 129 Left = 0 130 Height = 186 131 Top = 204 132 Width = 573 133 Align = alTop 134 Anchors = [akTop, akLeft, akRight, akBottom] 135 BevelOuter = bvNone 136 ClientHeight = 186 137 ClientWidth = 573 138 TabOrder = 5 139 object Label2: TLabel 140 Left = 11 141 Height = 14 142 Top = 12 143 Width = 67 144 Caption = 'IDE selection:' 145 ParentColor = False 146 end 147 object ListView2: TListView 148 Left = 9 149 Height = 158 150 Top = 28 151 Width = 559 152 Anchors = [akTop, akLeft, akRight, akBottom] 153 Columns = < 154 item 155 Caption = 'Name' 156 Width = 70 157 end 158 item 159 Caption = 'Type' 160 Width = 80 161 end 162 item 163 Caption = 'Version' 164 Width = 60 165 end 166 item 167 Caption = 'Revision' 168 end 169 item 170 Caption = 'Date' 171 Width = 60 172 end 173 item 174 Caption = 'Source URL' 175 Width = 300 176 end> 177 OwnerData = True 178 ReadOnly = True 179 RowSelect = True 180 TabOrder = 0 181 ViewStyle = vsReport 182 OnData = ListView2Data 183 end 112 184 end 113 185 end -
trunk/UOptions.pas
r3 r4 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, DOM, XMLWrite, XMLRead, HTTPSend;9 ComCtrls, ExtCtrls, DOM, XMLWrite, XMLRead, HTTPSend, USource, UInstance; 10 10 11 11 type … … 17 17 ButtonCancel: TButton; 18 18 ButtonOk: TButton; 19 Edit1: TEdit; 19 20 Label1: TLabel; 20 21 Label2: TLabel; 22 Label3: TLabel; 21 23 ListView1: TListView; 22 24 ListView2: TListView; 25 Panel1: TPanel; 26 Panel2: TPanel; 27 Panel3: TPanel; 28 procedure ButtonCancelClick(Sender: TObject); 29 procedure ButtonOkClick(Sender: TObject); 23 30 procedure ButtonUpdateSourceClick(Sender: TObject); 31 procedure FormCreate(Sender: TObject); 32 procedure FormDestroy(Sender: TObject); 33 procedure FormShow(Sender: TObject); 34 procedure ListView1Data(Sender: TObject; Item: TListItem); 35 procedure ListView2Data(Sender: TObject; Item: TListItem); 24 36 private 25 37 procedure ReloadList; 26 38 public 27 { public declarations } 28 end; 39 Instance: TInstance; 40 FPCSources: TSourceList; 41 IDESources: TSourceList; 42 end; 29 43 30 44 var … … 54 68 end; 55 69 70 procedure TOptionsForm.ButtonOkClick(Sender: TObject); 71 begin 72 Instance.Name := Edit1.Text; 73 if Assigned(ListView1.Selected) then 74 Instance.FPCSource := TSource(ListView1.Selected.Data) 75 else Instance.FPCSource := nil; 76 if Assigned(ListView2.Selected) then 77 Instance.IDESource := TSource(ListView2.Selected.Data) 78 else Instance.IDESource := nil; 79 end; 80 81 procedure TOptionsForm.ButtonCancelClick(Sender: TObject); 82 begin 83 Instance.Free; 84 end; 85 86 procedure TOptionsForm.FormCreate(Sender: TObject); 87 begin 88 FPCSources := TSourceList.Create; 89 FPCSources.OwnsObjects := False; 90 IDESources := TSourceList.Create; 91 IDESources.OwnsObjects := False; 92 end; 93 94 procedure TOptionsForm.FormDestroy(Sender: TObject); 95 begin 96 FPCSources.Free; 97 IDESources.Free; 98 end; 99 100 procedure TOptionsForm.FormShow(Sender: TObject); 101 begin 102 ReloadList; 103 if not Assigned(Instance) then begin 104 Instance := TInstance.Create; 105 Instance.Id := MainForm.Instances.GetNewId; 106 Instance.Name := 'Instance ' + IntToStr(Instance.Id); 107 end; 108 // ListView1.Items[; 109 Edit1.Text := Instance.Name; 110 end; 111 112 procedure TOptionsForm.ListView1Data(Sender: TObject; Item: TListItem); 113 begin 114 if Item.Index < FPCSources.Count then 115 with TSource(FPCSources[Item.Index]) do begin 116 Item.Caption := Name; 117 Item.Data := FPCSources[Item.Index]; 118 Item.SubItems.Add(VersionType); 119 Item.SubItems.Add(VersionNumber); 120 Item.SubItems.Add(''); 121 Item.SubItems.Add(''); 122 Item.SubItems.Add(SubversionURL); 123 end; 124 end; 125 126 procedure TOptionsForm.ListView2Data(Sender: TObject; Item: TListItem); 127 begin 128 if Item.Index < IDESources.Count then 129 with TSource(IDESources[Item.Index]) do begin 130 Item.Caption := Name; 131 Item.Data := IDESources[Item.Index]; 132 Item.SubItems.Add(VersionType); 133 Item.SubItems.Add(VersionNumber); 134 Item.SubItems.Add(''); 135 Item.SubItems.Add(''); 136 Item.SubItems.Add(SubversionURL); 137 end; 138 end; 139 56 140 procedure TOptionsForm.ReloadList; 141 var 142 I: Integer; 57 143 begin 58 ListView1.Items.Count := MainForm.Sources.Count; 144 FPCSources.Clear; 145 for I := 0 to MainForm.Sources.Count - 1 do 146 if TSource(MainForm.Sources[I]).Name = 'FPC' then 147 FPCSources.Add(MainForm.Sources[I]); 148 ListView1.Items.Count := FPCSources.Count; 59 149 ListView1.Refresh; 150 IDESources.Clear; 151 for I := 0 to MainForm.Sources.Count - 1 do 152 if TSource(MainForm.Sources[I]).Name = 'Lazarus' then 153 IDESources.Add(MainForm.Sources[I]); 154 ListView2.Items.Count := IDESources.Count; 155 ListView2.Refresh; 60 156 end; 61 157 -
trunk/USource.pas
r3 r4 6 6 7 7 uses 8 Classes, SysUtils, Contnrs, FileUtil, 8 Classes, SysUtils, Contnrs, FileUtil, Dialogs, 9 9 DOM, XMLWrite, XMLRead, HTTPSend; 10 10 … … 102 102 end else begin 103 103 Add(NewSource); 104 FreeAndNil(NewSource);104 NewSource := nil; 105 105 end; 106 106 finally
Note:
See TracChangeset
for help on using the changeset viewer.