Changeset 6


Ignore:
Timestamp:
Feb 4, 2011, 9:45:01 AM (14 years ago)
Author:
chronos
Message:
  • Modified: Source selection separated to single form.
  • Added: Starting compiler and IDE with updated paths in configuration files.
Location:
trunk
Files:
5 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UInstanceOptions.lfm

    r5 r6  
    11object InstanceOptionsForm: TInstanceOptionsForm
    2   Left = 274
    3   Height = 424
    4   Top = 106
    5   Width = 573
     2  Left = 307
     3  Height = 225
     4  Top = 132
     5  Width = 454
    66  Caption = 'Options'
    7   ClientHeight = 424
    8   ClientWidth = 573
     7  ClientHeight = 225
     8  ClientWidth = 454
    99  OnCreate = FormCreate
    1010  OnDestroy = FormDestroy
     
    1212  LCLVersion = '0.9.31'
    1313  object ButtonCancel: TButton
    14     Left = 408
     14    Left = 289
    1515    Height = 25
    16     Top = 394
     16    Top = 195
    1717    Width = 75
    1818    Anchors = [akRight, akBottom]
     
    2323  end
    2424  object ButtonOk: TButton
    25     Left = 493
     25    Left = 374
    2626    Height = 25
    27     Top = 394
     27    Top = 195
    2828    Width = 75
    2929    Anchors = [akRight, akBottom]
     
    3333    TabOrder = 1
    3434  end
    35   object ButtonUpdateSource: TButton
    36     Left = 10
    37     Height = 25
    38     Top = 395
    39     Width = 75
    40     Anchors = [akLeft, akBottom]
    41     Caption = 'Update list'
    42     OnClick = ButtonUpdateSourceClick
     35  object Label2: TLabel
     36    Left = 8
     37    Height = 14
     38    Top = 72
     39    Width = 67
     40    Caption = 'IDE selection:'
     41    ParentColor = False
     42  end
     43  object Label1: TLabel
     44    Left = 8
     45    Height = 14
     46    Top = 40
     47    Width = 69
     48    Caption = 'FPC selection:'
     49    ParentColor = False
     50  end
     51  object Edit1: TEdit
     52    Left = 128
     53    Height = 21
     54    Top = 8
     55    Width = 320
     56    Anchors = [akTop, akLeft, akRight]
    4357    TabOrder = 2
    4458  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
     59  object Label3: TLabel
     60    Left = 8
     61    Height = 14
     62    Top = 8
     63    Width = 32
     64    Caption = 'Name:'
     65    ParentColor = False
     66  end
     67  object Edit2: TEdit
     68    Left = 128
     69    Height = 21
     70    Top = 39
     71    Width = 233
     72    Anchors = [akTop, akLeft, akRight]
     73    ReadOnly = True
    5474    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
    7175  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
     76  object Button1: TButton
     77    Left = 374
     78    Height = 25
     79    Top = 39
     80    Width = 75
     81    Anchors = [akTop, akRight]
     82    Caption = 'Select'
     83    OnClick = Button1Click
    8184    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
    12785  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
     86  object Edit3: TEdit
     87    Left = 128
     88    Height = 21
     89    Top = 72
     90    Width = 233
     91    Anchors = [akTop, akLeft, akRight]
     92    ReadOnly = True
    13893    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
     94  end
     95  object Button2: TButton
     96    Left = 374
     97    Height = 25
     98    Top = 70
     99    Width = 75
     100    Anchors = [akTop, akRight]
     101    Caption = 'Select'
     102    OnClick = Button2Click
     103    TabOrder = 6
    184104  end
    185105end
  • trunk/Forms/UInstanceOptions.pas

    r5 r6  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, ExtCtrls, DOM, XMLWrite, XMLRead, HTTPSend, USource, UInstance;
     9  ComCtrls, ExtCtrls, DOM, XMLWrite, XMLRead, HTTPSend, USource, UInstance,
     10  USourceSelection;
    1011
    1112type
     
    1415
    1516  TInstanceOptionsForm = class(TForm)
    16     ButtonUpdateSource: TButton;
     17    Button1: TButton;
     18    Button2: TButton;
    1719    ButtonCancel: TButton;
    1820    ButtonOk: TButton;
    1921    Edit1: TEdit;
     22    Edit2: TEdit;
     23    Edit3: TEdit;
    2024    Label1: TLabel;
    2125    Label2: TLabel;
    2226    Label3: TLabel;
    23     ListView1: TListView;
    24     ListView2: TListView;
    25     Panel1: TPanel;
    26     Panel2: TPanel;
    27     Panel3: TPanel;
     27    procedure Button1Click(Sender: TObject);
     28    procedure Button2Click(Sender: TObject);
    2829    procedure ButtonCancelClick(Sender: TObject);
    2930    procedure ButtonOkClick(Sender: TObject);
    30     procedure ButtonUpdateSourceClick(Sender: TObject);
    3131    procedure FormCreate(Sender: TObject);
    3232    procedure FormDestroy(Sender: TObject);
    3333    procedure FormShow(Sender: TObject);
    34     procedure ListView1Data(Sender: TObject; Item: TListItem);
    35     procedure ListView2Data(Sender: TObject; Item: TListItem);
    3634  private
    37     procedure ReloadList;
     35    IsNew: Boolean;
    3836  public
    3937    Instance: TInstance;
    40     FPCSources: TSourceList;
    41     IDESources: TSourceList;
     38    FPCSource: TSource;
     39    IDESource: TSource;
    4240  end;
    4341
     
    5452{ TInstanceOptionsForm }
    5553
    56 procedure TInstanceOptionsForm.ButtonUpdateSourceClick(Sender: TObject);
    57 var
    58   fs: TFileStream;
    59 begin
    60   fs := TFileStream.Create(ExtractFileName(MainForm.SourceURL), fmOpenWrite or fmCreate);
    61   try
    62     HttpGetBinary(MainForm.SourceURL, fs);
    63   finally
    64     fs.Free;
    65   end;
    66   MainForm.Sources.UpdateFormFile(ExtractFileName(MainForm.SourceURL));
    67   ReloadList;
    68 end;
    69 
    7054procedure TInstanceOptionsForm.ButtonOkClick(Sender: TObject);
    7155begin
    7256  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;
     57  Instance.FPCSource := FPCSource;
     58  Instance.IDESource := IDESource;
    7959end;
    8060
    8161procedure TInstanceOptionsForm.ButtonCancelClick(Sender: TObject);
    8262begin
    83   Instance.Free;
     63  if IsNew then Instance.Free;
     64end;
     65
     66procedure TInstanceOptionsForm.Button1Click(Sender: TObject);
     67begin
     68  SourceSelectionForm.ProjectType := 'Compiler';
     69  if SourceSelectionForm.ShowModal = mrOk then begin
     70    if Assigned(SourceSelectionForm.ListView1.Selected) then
     71      FPCSource := TSource(SourceSelectionForm.ListView1.Selected.Data)
     72      else FPCSource := nil;
     73    if Assigned(FPCSource) then
     74      Edit2.Text := FPCSource.GetName
     75      else Edit2.Text := '';
     76  end;
     77end;
     78
     79procedure TInstanceOptionsForm.Button2Click(Sender: TObject);
     80begin
     81  SourceSelectionForm.ProjectType := 'IDE';
     82  if SourceSelectionForm.ShowModal = mrOk then begin
     83    if Assigned(SourceSelectionForm.ListView1.Selected) then
     84      IDESource := TSource(SourceSelectionForm.ListView1.Selected.Data)
     85      else IDESource := nil;
     86    if Assigned(IDESource) then
     87      Edit3.Text := IDESource.GetName
     88      else Edit3.Text := '';
     89  end;
    8490end;
    8591
    8692procedure TInstanceOptionsForm.FormCreate(Sender: TObject);
    8793begin
    88   FPCSources := TSourceList.Create;
    89   FPCSources.OwnsObjects := False;
    90   IDESources := TSourceList.Create;
    91   IDESources.OwnsObjects := False;
    9294end;
    9395
    9496procedure TInstanceOptionsForm.FormDestroy(Sender: TObject);
    9597begin
    96   FPCSources.Free;
    97   IDESources.Free;
    9898end;
    9999
    100100procedure TInstanceOptionsForm.FormShow(Sender: TObject);
    101101begin
    102   ReloadList;
    103102  if not Assigned(Instance) then begin
    104103    Instance := TInstance.Create;
    105104    Instance.Id := MainForm.Instances.GetNewId;
    106105    Instance.Name := 'Instance ' + IntToStr(Instance.Id);
    107   end;
    108   //    ListView1.Items[;
     106    IsNew := True;
     107  end else IsNew := False;
     108
    109109  Edit1.Text := Instance.Name;
    110 end;
    111 
    112 procedure TInstanceOptionsForm.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 := ProjectName;
    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 TInstanceOptionsForm.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 := ProjectName;
    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 
    140 procedure TInstanceOptionsForm.ReloadList;
    141 var
    142   I: Integer;
    143 begin
    144   FPCSources.Clear;
    145   for I := 0 to MainForm.Sources.Count - 1 do
    146     if TSource(MainForm.Sources[I]).ProjectType = 'Compiler' then
    147       FPCSources.Add(MainForm.Sources[I]);
    148   if ListView1.Items.Count <> FPCSources.Count then
    149     ListView1.Items.Count := FPCSources.Count;
    150   ListView1.Items[-1]; // workaround
    151   ListView1.Refresh;
    152   IDESources.Clear;
    153   for I := 0 to MainForm.Sources.Count - 1 do
    154     if TSource(MainForm.Sources[I]).ProjectType = 'IDE' then
    155       IDESources.Add(MainForm.Sources[I]);
    156   if ListView2.Items.Count <> IDESources.Count then
    157     ListView2.Items.Count := IDESources.Count;
    158   ListView2.Items[-1]; // workaround
    159   ListView2.Refresh;
     110  if Assigned(Instance.FPCSource) then
     111    Edit2.Text := Instance.FPCSource.GetName
     112    else Edit2.Text := '';
     113  if Assigned(Instance.IDESource) then
     114    Edit3.Text := Instance.IDESource.GetName
     115    else Edit3.Text := '';
    160116end;
    161117
  • trunk/Forms/UMainForm.lfm

    r5 r6  
    2323      end   
    2424      item
    25         Caption = 'FPC version'
    26         Width = 150
     25        Caption = 'Compiler'
     26        Width = 200
    2727      end   
    2828      item
    29         Caption = 'IDE version'
    30         Width = 150
     29        Caption = 'IDE'
     30        Width = 200
    3131      end   
    3232      item
  • trunk/Forms/UMainForm.pas

    r5 r6  
    6767  public
    6868    Platform: string;
     69    TemplateDir: string;
    6970    BinUtilsDir: string;
    7071    InstanceDir: string;
     72    SubversionDir: string;
    7173    SourceDir: string;
    7274    SourceURL: string;
     
    9092  Instances := TInstanceList.Create;
    9193  Sources := TSourceList.Create;
    92   Platform := 'i386-win32';
    9394  BinUtilsDir := 'BinUtils';
    9495  InstanceDir := 'Instance';
     96  TemplateDir := 'Template';
    9597  SourceDir := 'Source';
    9698  SourceURL := 'http://tv.zdechov.net/fpc/SourceList.xml';
     99  {$IFDEF Windows}
     100  Platform := 'i386-win32';
     101  SubversionDir := 'C:\Program Files\Subversion\bin';
     102  {$ENDIF}
     103  {$IFDEF Linux}
     104  Platform := 'i386-linux';
     105  SubversionDir := '';
     106  {$ENDIF}
    97107  LoadInstanceList;
    98108end;
     
    154164    if ListView1.Selected.Index < Instances.Count then
    155165    with TInstance(Instances[ListView1.Selected.Index]) do begin
     166      ForceDirectoriesUTF8(GetPath);
    156167      if Assigned(FPCSource) then begin
    157168        FPCSource.Download;
     
    203214    Item.Data := Instances[Item.Index];
    204215    if Assigned(FPCSource) then
    205       Item.SubItems.Add(FPCSource.ProjectName + ' ' + FPCSource.VersionNumber)
     216      Item.SubItems.Add(FPCSource.GetName)
    206217      else Item.SubItems.Add('');
    207218    if Assigned(IDESource) then
    208       Item.SubItems.Add(IDESource.ProjectName + ' ' + IDESource.VersionNumber)
     219      Item.SubItems.Add(IDESource.GetName)
    209220      else Item.SubItems.Add('');
    210221    Item.SubItems.Add(BooleanText[Downloaded]);
  • trunk/Forms/UMainOptions.lfm

    r5 r6  
    4343    Anchors = [akTop, akLeft, akRight]
    4444    TabOrder = 2
    45     Text = 'Edit1'
    4645  end
    4746  object Label2: TLabel
     
    6059    Anchors = [akTop, akLeft, akRight]
    6160    TabOrder = 3
    62     Text = 'Edit1'
    6361  end
    6462  object Label3: TLabel
     
    7775    Anchors = [akTop, akLeft, akRight]
    7876    TabOrder = 4
    79     Text = 'Edit1'
     77  end
     78  object Label4: TLabel
     79    Left = 9
     80    Height = 14
     81    Top = 128
     82    Width = 98
     83    Caption = 'Subversion location:'
     84    ParentColor = False
     85  end
     86  object Edit4: TEdit
     87    Left = 9
     88    Height = 21
     89    Top = 144
     90    Width = 621
     91    Anchors = [akTop, akLeft, akRight]
     92    TabOrder = 5
    8093  end
    8194end
  • trunk/Forms/UMainOptions.pas

    r5 r6  
    1818    Edit2: TEdit;
    1919    Edit3: TEdit;
     20    Edit4: TEdit;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
    2223    Label3: TLabel;
     24    Label4: TLabel;
    2325    procedure Button2Click(Sender: TObject);
    2426    procedure FormShow(Sender: TObject);
     
    4648  Edit2.Text := MainForm.Platform;
    4749  Edit3.Text := MainForm.SourceURL;
     50  Edit4.Text := MainForm.SubversionDir;
    4851end;
    4952
     
    5356  MainForm.Platform := Edit2.Text;
    5457  MainForm.SourceURL := Edit3.Text;
     58  MainForm.SubversionDir := Edit4.Text;
    5559end;
    5660
  • trunk/Forms/UOperationProgress.lfm

    r5 r6  
    77  ClientHeight = 440
    88  ClientWidth = 562
     9  OnClose = FormClose
    910  OnShow = FormShow
    1011  LCLVersion = '0.9.31'
     
    3738    Caption = 'Close'
    3839    ModalResult = 6
     40    OnClick = ButtonCloseClick
    3941    TabOrder = 2
    4042  end
  • trunk/Forms/UOperationProgress.pas

    r5 r6  
    2020    Timer1: TTimer;
    2121    procedure ButtonAbortClick(Sender: TObject);
     22    procedure ButtonCloseClick(Sender: TObject);
     23    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2224    procedure FormShow(Sender: TObject);
    2325    procedure Timer1Timer(Sender: TObject);
     
    4446  if Assigned(Process) then
    4547    Process.Terminate(0);
     48end;
     49
     50procedure TOperationProgressForm.ButtonCloseClick(Sender: TObject);
     51begin
     52
     53end;
     54
     55procedure TOperationProgressForm.FormClose(Sender: TObject;
     56  var CloseAction: TCloseAction);
     57begin
     58  Memo1.Clear;
    4659end;
    4760
  • trunk/FreePascalManager.lpi

    r5 r6  
    3838      </Item2>
    3939    </RequiredPackages>
    40     <Units Count="25">
     40    <Units Count="32">
    4141      <Unit0>
    4242        <Filename Value="FreePascalManager.lpr"/>
     
    4646        <TopLine Value="1"/>
    4747        <CursorPos X="1" Y="15"/>
    48         <UsageCount Value="75"/>
     48        <UsageCount Value="114"/>
    4949      </Unit0>
    5050      <Unit1>
     
    5656        <EditorIndex Value="0"/>
    5757        <WindowIndex Value="0"/>
    58         <TopLine Value="109"/>
    59         <CursorPos X="11" Y="114"/>
    60         <UsageCount Value="75"/>
     58        <TopLine Value="1"/>
     59        <CursorPos X="3" Y="16"/>
     60        <UsageCount Value="114"/>
    6161        <Loaded Value="True"/>
    6262        <LoadedDesigner Value="True"/>
     
    7070        <EditorIndex Value="2"/>
    7171        <WindowIndex Value="0"/>
    72         <TopLine Value="7"/>
    73         <CursorPos X="38" Y="103"/>
    74         <UsageCount Value="75"/>
     72        <TopLine Value="48"/>
     73        <CursorPos X="27" Y="55"/>
     74        <UsageCount Value="114"/>
    7575        <Loaded Value="True"/>
    7676        <LoadedDesigner Value="True"/>
     
    8080        <IsPartOfProject Value="True"/>
    8181        <UnitName Value="UInstance"/>
    82         <IsVisibleTab Value="True"/>
    83         <EditorIndex Value="3"/>
    84         <WindowIndex Value="0"/>
    85         <TopLine Value="61"/>
    86         <CursorPos X="38" Y="79"/>
    87         <UsageCount Value="75"/>
     82        <EditorIndex Value="5"/>
     83        <WindowIndex Value="0"/>
     84        <TopLine Value="8"/>
     85        <CursorPos X="20" Y="21"/>
     86        <UsageCount Value="114"/>
    8887        <Loaded Value="True"/>
    8988      </Unit3>
     
    9291        <IsPartOfProject Value="True"/>
    9392        <UnitName Value="USource"/>
    94         <EditorIndex Value="8"/>
    95         <WindowIndex Value="0"/>
    96         <TopLine Value="49"/>
    97         <CursorPos X="14" Y="50"/>
    98         <UsageCount Value="75"/>
     93        <IsVisibleTab Value="True"/>
     94        <EditorIndex Value="11"/>
     95        <WindowIndex Value="0"/>
     96        <TopLine Value="6"/>
     97        <CursorPos X="8" Y="19"/>
     98        <UsageCount Value="114"/>
    9999        <Loaded Value="True"/>
    100100      </Unit4>
    101101      <Unit5>
    102102        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\rtl\objpas\classes\classesh.inc"/>
    103         <WindowIndex Value="0"/>
    104         <TopLine Value="600"/>
    105         <CursorPos X="15" Y="613"/>
    106         <UsageCount Value="10"/>
     103        <EditorIndex Value="6"/>
     104        <WindowIndex Value="0"/>
     105        <TopLine Value="616"/>
     106        <CursorPos X="40" Y="638"/>
     107        <UsageCount Value="11"/>
     108        <Loaded Value="True"/>
    107109      </Unit5>
    108110      <Unit6>
     
    112114        <TopLine Value="34"/>
    113115        <CursorPos X="20" Y="47"/>
    114         <UsageCount Value="11"/>
     116        <UsageCount Value="7"/>
    115117      </Unit6>
    116118      <Unit7>
     
    120122        <TopLine Value="253"/>
    121123        <CursorPos X="14" Y="266"/>
    122         <UsageCount Value="28"/>
     124        <UsageCount Value="24"/>
    123125      </Unit7>
    124126      <Unit8>
     
    128130        <TopLine Value="749"/>
    129131        <CursorPos X="3" Y="753"/>
    130         <UsageCount Value="26"/>
     132        <UsageCount Value="22"/>
    131133      </Unit8>
    132134      <Unit9>
     
    135137        <TopLine Value="58"/>
    136138        <CursorPos X="72" Y="81"/>
    137         <UsageCount Value="17"/>
     139        <UsageCount Value="13"/>
    138140        <DefaultSyntaxHighlighter Value="XML"/>
    139141      </Unit9>
     
    143145        <TopLine Value="1"/>
    144146        <CursorPos X="46" Y="49"/>
    145         <UsageCount Value="15"/>
     147        <UsageCount Value="11"/>
    146148        <DefaultSyntaxHighlighter Value="XML"/>
    147149      </Unit10>
     
    152154        <TopLine Value="67"/>
    153155        <CursorPos X="17" Y="80"/>
    154         <UsageCount Value="26"/>
     156        <UsageCount Value="22"/>
    155157      </Unit11>
    156158      <Unit12>
    157159        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\include\customform.inc"/>
    158160        <WindowIndex Value="0"/>
    159         <TopLine Value="865"/>
    160         <CursorPos X="1" Y="878"/>
    161         <UsageCount Value="9"/>
     161        <TopLine Value="2639"/>
     162        <CursorPos X="1" Y="2660"/>
     163        <UsageCount Value="10"/>
    162164      </Unit12>
    163165      <Unit13>
     
    167169        <TopLine Value="594"/>
    168170        <CursorPos X="14" Y="607"/>
    169         <UsageCount Value="9"/>
     171        <UsageCount Value="5"/>
    170172      </Unit13>
    171173      <Unit14>
     
    175177        <ResourceBaseClass Value="Form"/>
    176178        <UnitName Value="UOperationProgress"/>
    177         <EditorIndex Value="5"/>
    178         <WindowIndex Value="0"/>
    179         <TopLine Value="62"/>
    180         <CursorPos X="1" Y="82"/>
    181         <UsageCount Value="31"/>
     179        <EditorIndex Value="8"/>
     180        <WindowIndex Value="0"/>
     181        <TopLine Value="43"/>
     182        <CursorPos X="3" Y="58"/>
     183        <UsageCount Value="70"/>
    182184        <Loaded Value="True"/>
    183185        <LoadedDesigner Value="True"/>
     
    186188        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\packages\fcl-process\src\process.pp"/>
    187189        <UnitName Value="process"/>
    188         <EditorIndex Value="6"/>
    189190        <WindowIndex Value="0"/>
    190191        <TopLine Value="110"/>
    191         <CursorPos X="14" Y="123"/>
    192         <UsageCount Value="14"/>
    193         <Loaded Value="True"/>
     192        <CursorPos X="33" Y="123"/>
     193        <UsageCount Value="31"/>
    194194      </Unit15>
    195195      <Unit16>
     
    199199        <TopLine Value="18"/>
    200200        <CursorPos X="16" Y="39"/>
    201         <UsageCount Value="10"/>
     201        <UsageCount Value="6"/>
    202202      </Unit16>
    203203      <Unit17>
     
    206206        <TopLine Value="248"/>
    207207        <CursorPos X="3" Y="269"/>
    208         <UsageCount Value="10"/>
     208        <UsageCount Value="6"/>
    209209      </Unit17>
    210210      <Unit18>
    211211        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\rtl\objpas\classes\stringl.inc"/>
    212         <WindowIndex Value="0"/>
    213         <TopLine Value="566"/>
    214         <CursorPos X="8" Y="570"/>
    215         <UsageCount Value="10"/>
     212        <EditorIndex Value="7"/>
     213        <WindowIndex Value="0"/>
     214        <TopLine Value="443"/>
     215        <CursorPos X="3" Y="441"/>
     216        <UsageCount Value="11"/>
     217        <Loaded Value="True"/>
    216218      </Unit18>
    217219      <Unit19>
     
    221223        <TopLine Value="906"/>
    222224        <CursorPos X="16" Y="919"/>
    223         <UsageCount Value="10"/>
     225        <UsageCount Value="6"/>
    224226      </Unit19>
    225227      <Unit20>
     
    229231        <TopLine Value="38"/>
    230232        <CursorPos X="3" Y="51"/>
    231         <UsageCount Value="9"/>
     233        <UsageCount Value="5"/>
    232234      </Unit20>
    233235      <Unit21>
    234236        <Filename Value="ReadMe.txt"/>
    235237        <IsPartOfProject Value="True"/>
    236         <EditorIndex Value="7"/>
     238        <EditorIndex Value="10"/>
    237239        <WindowIndex Value="0"/>
    238240        <TopLine Value="1"/>
    239         <CursorPos X="17" Y="6"/>
    240         <UsageCount Value="29"/>
     241        <CursorPos X="15" Y="12"/>
     242        <UsageCount Value="68"/>
    241243        <Loaded Value="True"/>
    242244        <DefaultSyntaxHighlighter Value="None"/>
     
    245247        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\interfaces\win32\win32wscontrols.pp"/>
    246248        <UnitName Value="Win32WSControls"/>
     249        <EditorIndex Value="9"/>
    247250        <WindowIndex Value="0"/>
    248251        <TopLine Value="254"/>
    249         <CursorPos X="48" Y="260"/>
    250         <UsageCount Value="13"/>
     252        <CursorPos X="10" Y="265"/>
     253        <UsageCount Value="11"/>
     254        <Loaded Value="True"/>
    251255      </Unit22>
    252256      <Unit23>
    253257        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\rtl\win32\system.pp"/>
    254258        <UnitName Value="System"/>
    255         <EditorIndex Value="4"/>
    256259        <WindowIndex Value="0"/>
    257260        <TopLine Value="785"/>
    258261        <CursorPos X="22" Y="993"/>
    259         <UsageCount Value="11"/>
    260         <Loaded Value="True"/>
     262        <UsageCount Value="30"/>
    261263      </Unit23>
    262264      <Unit24>
     
    268270        <EditorIndex Value="1"/>
    269271        <WindowIndex Value="0"/>
    270         <TopLine Value="30"/>
    271         <CursorPos X="36" Y="48"/>
    272         <UsageCount Value="22"/>
     272        <TopLine Value="22"/>
     273        <CursorPos X="17" Y="57"/>
     274        <UsageCount Value="61"/>
    273275        <Loaded Value="True"/>
    274276        <LoadedDesigner Value="True"/>
    275277      </Unit24>
     278      <Unit25>
     279        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\customtimer.pas"/>
     280        <UnitName Value="CustomTimer"/>
     281        <WindowIndex Value="0"/>
     282        <TopLine Value="144"/>
     283        <CursorPos X="1" Y="157"/>
     284        <UsageCount Value="10"/>
     285      </Unit25>
     286      <Unit26>
     287        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\interfaces\win32\win32callback.inc"/>
     288        <WindowIndex Value="0"/>
     289        <TopLine Value="2676"/>
     290        <CursorPos X="1" Y="2689"/>
     291        <UsageCount Value="11"/>
     292      </Unit26>
     293      <Unit27>
     294        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\interfaces\win32\win32object.inc"/>
     295        <WindowIndex Value="0"/>
     296        <TopLine Value="376"/>
     297        <CursorPos X="1" Y="389"/>
     298        <UsageCount Value="10"/>
     299      </Unit27>
     300      <Unit28>
     301        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\rtl\objpas\sysutils\sysstrh.inc"/>
     302        <WindowIndex Value="0"/>
     303        <TopLine Value="211"/>
     304        <CursorPos X="78" Y="224"/>
     305        <UsageCount Value="10"/>
     306      </Unit28>
     307      <Unit29>
     308        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\interfaces\win32\win32wscustomlistview.inc"/>
     309        <WindowIndex Value="0"/>
     310        <TopLine Value="106"/>
     311        <CursorPos X="42" Y="125"/>
     312        <UsageCount Value="10"/>
     313      </Unit29>
     314      <Unit30>
     315        <Filename Value="Forms\USourceSelection.pas"/>
     316        <IsPartOfProject Value="True"/>
     317        <ComponentName Value="SourceSelectionForm"/>
     318        <ResourceBaseClass Value="Form"/>
     319        <UnitName Value="USourceSelection"/>
     320        <EditorIndex Value="4"/>
     321        <WindowIndex Value="0"/>
     322        <TopLine Value="18"/>
     323        <CursorPos X="34" Y="69"/>
     324        <UsageCount Value="21"/>
     325        <Loaded Value="True"/>
     326        <LoadedDesigner Value="True"/>
     327      </Unit30>
     328      <Unit31>
     329        <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\include\listitem.inc"/>
     330        <EditorIndex Value="3"/>
     331        <WindowIndex Value="0"/>
     332        <TopLine Value="760"/>
     333        <CursorPos X="1" Y="773"/>
     334        <UsageCount Value="10"/>
     335        <Loaded Value="True"/>
     336      </Unit31>
    276337    </Units>
    277338    <JumpHistory Count="30" HistoryIndex="29">
    278339      <Position1>
    279         <Filename Value="Forms\UMainOptions.pas"/>
    280         <Caret Line="52" Column="34" TopLine="30"/>
     340        <Filename Value="Forms\USourceSelection.pas"/>
     341        <Caret Line="62" Column="18" TopLine="49"/>
    281342      </Position1>
    282343      <Position2>
    283         <Filename Value="Forms\UMainOptions.pas"/>
    284         <Caret Line="51" Column="34" TopLine="29"/>
     344        <Filename Value="Forms\UInstanceOptions.pas"/>
     345        <Caret Line="9" Column="47" TopLine="4"/>
    285346      </Position2>
    286347      <Position3>
    287         <Filename Value="Forms\UMainForm.pas"/>
    288         <Caret Line="96" Column="3" TopLine="87"/>
     348        <Filename Value="Forms\UInstanceOptions.pas"/>
     349        <Caret Line="74" Column="72" TopLine="61"/>
    289350      </Position3>
    290351      <Position4>
    291         <Filename Value="Forms\UMainForm.pas"/>
    292         <Caret Line="102" Column="11" TopLine="89"/>
     352        <Filename Value="Forms\UInstanceOptions.pas"/>
     353        <Caret Line="73" Column="16" TopLine="60"/>
    293354      </Position4>
    294355      <Position5>
    295         <Filename Value="Forms\UMainForm.pas"/>
    296         <Caret Line="103" Column="14" TopLine="90"/>
     356        <Filename Value="Forms\USourceSelection.pas"/>
     357        <Caret Line="21" Column="29" TopLine="1"/>
    297358      </Position5>
    298359      <Position6>
    299         <Filename Value="Forms\UMainForm.pas"/>
    300         <Caret Line="104" Column="27" TopLine="91"/>
     360        <Filename Value="Forms\USourceSelection.pas"/>
     361        <Caret Line="20" Column="15" TopLine="7"/>
    301362      </Position6>
    302363      <Position7>
    303         <Filename Value="Forms\UMainForm.pas"/>
    304         <Caret Line="122" Column="13" TopLine="109"/>
     364        <Filename Value="Forms\UInstanceOptions.pas"/>
     365        <Caret Line="81" Column="1" TopLine="68"/>
    305366      </Position7>
    306367      <Position8>
    307         <Filename Value="Forms\UMainForm.pas"/>
    308         <Caret Line="123" Column="16" TopLine="110"/>
     368        <Filename Value="Forms\UInstanceOptions.pas"/>
     369        <Caret Line="85" Column="1" TopLine="72"/>
    309370      </Position8>
    310371      <Position9>
    311         <Filename Value="Forms\UMainForm.pas"/>
    312         <Caret Line="130" Column="7" TopLine="117"/>
     372        <Filename Value="Forms\UInstanceOptions.pas"/>
     373        <Caret Line="59" Column="54" TopLine="52"/>
    313374      </Position9>
    314375      <Position10>
    315         <Filename Value="Forms\UMainForm.pas"/>
    316         <Caret Line="444" Column="41" TopLine="420"/>
     376        <Filename Value="Forms\UInstanceOptions.pas"/>
     377        <Caret Line="73" Column="1" TopLine="65"/>
    317378      </Position10>
    318379      <Position11>
    319         <Filename Value="Forms\UMainForm.pas"/>
    320         <Caret Line="114" Column="11" TopLine="109"/>
     380        <Filename Value="Forms\UInstanceOptions.pas"/>
     381        <Caret Line="110" Column="1" TopLine="85"/>
    321382      </Position11>
    322383      <Position12>
    323         <Filename Value="UInstance.pas"/>
    324         <Caret Line="67" Column="23" TopLine="65"/>
     384        <Filename Value="Forms\UInstanceOptions.pas"/>
     385        <Caret Line="90" Column="1" TopLine="65"/>
    325386      </Position12>
    326387      <Position13>
    327         <Filename Value="Forms\UOperationProgress.pas"/>
    328         <Caret Line="29" Column="25" TopLine="9"/>
     388        <Filename Value="Forms\UInstanceOptions.pas"/>
     389        <Caret Line="74" Column="49" TopLine="62"/>
    329390      </Position13>
    330391      <Position14>
    331         <Filename Value="Forms\UOperationProgress.pas"/>
    332         <Caret Line="73" Column="8" TopLine="60"/>
     392        <Filename Value="Forms\UInstanceOptions.pas"/>
     393        <Caret Line="88" Column="26" TopLine="75"/>
    333394      </Position14>
    334395      <Position15>
    335         <Filename Value="Forms\UOperationProgress.pas"/>
    336         <Caret Line="74" Column="35" TopLine="61"/>
     396        <Filename Value="Forms\UInstanceOptions.pas"/>
     397        <Caret Line="115" Column="33" TopLine="95"/>
    337398      </Position15>
    338399      <Position16>
    339400        <Filename Value="UInstance.pas"/>
    340         <Caret Line="67" Column="23" TopLine="65"/>
     401        <Caret Line="21" Column="20" TopLine="8"/>
    341402      </Position16>
    342403      <Position17>
    343         <Filename Value="UInstance.pas"/>
    344         <Caret Line="69" Column="28" TopLine="54"/>
     404        <Filename Value="USource.pas"/>
     405        <Caret Line="32" Column="27" TopLine="8"/>
    345406      </Position17>
    346407      <Position18>
    347         <Filename Value="Forms\UOperationProgress.pas"/>
    348         <Caret Line="77" Column="23" TopLine="63"/>
     408        <Filename Value="Forms\UInstanceOptions.pas"/>
     409        <Caret Line="86" Column="42" TopLine="73"/>
    349410      </Position18>
    350411      <Position19>
    351         <Filename Value="UInstance.pas"/>
    352         <Caret Line="69" Column="28" TopLine="54"/>
     412        <Filename Value="Forms\UInstanceOptions.pas"/>
     413        <Caret Line="73" Column="43" TopLine="60"/>
    353414      </Position19>
    354415      <Position20>
    355         <Filename Value="UInstance.pas"/>
    356         <Caret Line="76" Column="25" TopLine="62"/>
     416        <Filename Value="Forms\UInstanceOptions.pas"/>
     417        <Caret Line="86" Column="43" TopLine="73"/>
    357418      </Position20>
    358419      <Position21>
    359         <Filename Value="UInstance.pas"/>
    360         <Caret Line="69" Column="43" TopLine="61"/>
     420        <Filename Value="USource.pas"/>
     421        <Caret Line="32" Column="17" TopLine="19"/>
    361422      </Position21>
    362423      <Position22>
    363         <Filename Value="UInstance.pas"/>
    364         <Caret Line="68" Column="31" TopLine="61"/>
     424        <Filename Value="Forms\UMainForm.pas"/>
     425        <Caret Line="219" Column="37" TopLine="201"/>
    365426      </Position22>
    366427      <Position23>
    367         <Filename Value="UInstance.pas"/>
    368         <Caret Line="72" Column="3" TopLine="61"/>
     428        <Filename Value="Forms\UInstanceOptions.pas"/>
     429        <Caret Line="112" Column="41" TopLine="92"/>
    369430      </Position23>
    370431      <Position24>
    371         <Filename Value="UInstance.pas"/>
    372         <Caret Line="76" Column="28" TopLine="61"/>
     432        <Filename Value="Forms\UInstanceOptions.pas"/>
     433        <Caret Line="86" Column="21" TopLine="65"/>
    373434      </Position24>
    374435      <Position25>
    375         <Filename Value="Forms\UOperationProgress.pas"/>
    376         <Caret Line="76" Column="1" TopLine="62"/>
     436        <Filename Value="Forms\UInstanceOptions.pas"/>
     437        <Caret Line="62" Column="17" TopLine="51"/>
    377438      </Position25>
    378439      <Position26>
    379         <Filename Value="UInstance.pas"/>
    380         <Caret Line="68" Column="28" TopLine="61"/>
     440        <Filename Value="Forms\USourceSelection.pas"/>
     441        <Caret Line="86" Column="5" TopLine="79"/>
    381442      </Position26>
    382443      <Position27>
    383         <Filename Value="Forms\UOperationProgress.pas"/>
    384         <Caret Line="76" Column="1" TopLine="62"/>
     444        <Filename Value="Forms\USourceSelection.pas"/>
     445        <Caret Line="29" Column="19" TopLine="16"/>
    385446      </Position27>
    386447      <Position28>
    387         <Filename Value="Forms\UOperationProgress.pas"/>
    388         <Caret Line="77" Column="1" TopLine="62"/>
     448        <Filename Value="USource.pas"/>
     449        <Caret Line="29" Column="53" TopLine="21"/>
    389450      </Position28>
    390451      <Position29>
    391         <Filename Value="Forms\UOperationProgress.pas"/>
    392         <Caret Line="79" Column="34" TopLine="62"/>
     452        <Filename Value="USource.pas"/>
     453        <Caret Line="55" Column="40" TopLine="157"/>
    393454      </Position29>
    394455      <Position30>
    395         <Filename Value="UInstance.pas"/>
    396         <Caret Line="69" Column="46" TopLine="61"/>
     456        <Filename Value="USource.pas"/>
     457        <Caret Line="19" Column="10" TopLine="7"/>
    397458      </Position30>
    398459    </JumpHistory>
     
    416477        <StackChecks Value="True"/>
    417478      </Checks>
    418       <VerifyObjMethodCallValidity Value="True"/>
    419479    </CodeGeneration>
    420480    <Linking>
     
    439499      <Item1>
    440500        <Source Value="UInstance.pas"/>
    441         <Line Value="75"/>
     501        <Line Value="94"/>
    442502      </Item1>
    443503    </BreakPoints>
  • trunk/FreePascalManager.lpr

    r5 r6  
    1010  Forms, UMainForm,
    1111UInstanceOptions, UInstance, USource, synapse, UOperationProgress,
    12   UMainOptions
     12  UMainOptions, USourceSelection
    1313  { you can add units after this };
    1414
     
    2121  Application.CreateForm(TOperationProgressForm, OperationProgressForm);
    2222  Application.CreateForm(TMainOptionsForm, MainOptionsForm);
     23  Application.CreateForm(TSourceSelectionForm, SourceSelectionForm);
    2324  Application.Run;
    2425end.
  • trunk/ReadMe.txt

    r5 r6  
    55* Manage multiple FPC and IDE instances
    66* Download, update, build FPC and IDE
    7 * Cross-platform
     7* Supported platforms Windows and Linux
     8* Can be placed to removable drive (configuration stored in XML file)
     9
     10=Download=
     11
     12Subversion repository:
     13http://svn.zdechov.net/svn/FreePascalManager/trunk
     14
     15=Author=
     16
     17Email: robie@centrum.cz (Chronos)
    818
    919
    10 
  • trunk/UInstance.pas

    r5 r6  
    77uses
    88  Classes, SysUtils, USource, Contnrs, Process, Forms, Controls,
    9   FileUtil;
     9  FileUtil, Dialogs;
    1010
    1111type
     
    1414  TInstance = class
    1515  private
     16    function GetCompiled: Boolean;
    1617    function GetDownloaded: Boolean;
    1718  public
    1819    Id: Integer;
    1920    Name: string;
    20     Compiled: Boolean;
    2121    IDESource: TSource;
    2222    IDERevision: string;
     
    2727    procedure Build;
    2828    procedure Start;
     29    procedure UpdateLazarusConfig;
     30    procedure UpdateFPCConfig;
    2931    function GetPath: string;
    3032    property Downloaded: Boolean read GetDownloaded;
     33    property Compiled: Boolean read GetCompiled;
    3134  end;
    3235
     
    5659{ TInstance }
    5760
     61function TInstance.GetCompiled: Boolean;
     62begin
     63  Result := FileExistsUTF8(GetPath + DirectorySeparator + FPCSource.ProjectShortName +
     64    DirectorySeparator + 'bin' + DirectorySeparator +
     65    MainForm.Platform + DirectorySeparator + FPCSource.GetExecutableFile);
     66  if Assigned(IDESource) then Result := Result and
     67    FileExistsUTF8(GetPath + DirectorySeparator + IDESource.ProjectShortName +
     68    DirectorySeparator + IDESource.GetExecutableFile);
     69end;
     70
    5871function TInstance.GetDownloaded: Boolean;
    5972begin
     
    6578procedure TInstance.Build;
    6679begin
    67   OperationProgressForm.Environment := 'path=' + //GetEnvironmentVariable('PATH') + ';' +
    68     MainForm.GetBinUtilsDir;
     80  (*OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir;
    6981  OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName;
    70   OperationProgressForm.CommandLine :=
    71     '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" clean all PP="' +
    72     MainForm.GetBinUtilsDir + '"';
     82  OperationProgressForm.CommandLine := 'make all PP="' +
     83    MainForm.GetBinUtilsDir + DirectorySeparator + 'fpc"';
    7384  OperationProgressForm.ShowModal;
    7485
     86  OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir;
    7587  OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName;
    76   OperationProgressForm.CommandLine :=
    77     '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" install PREFIX="' +
     88  OperationProgressForm.CommandLine := 'make install PREFIX="' +
    7889    GetPath + DirectorySeparator + FPCSource.ProjectShortName + '"' +
    79     ' PP="' + MainForm.GetBinUtilsDir + '"';
     90    ' PP="' + MainForm.GetBinUtilsDir + DirectorySeparator + 'fpc"';
    8091  OperationProgressForm.ShowModal;
     92  *)
    8193
    8294  if Assigned(IDESource) then begin
     95    OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir;
    8396    OperationProgressForm.Path := GetPath + DirectorySeparator + IDESource.ProjectShortName;
    8497    OperationProgressForm.CommandLine :=
    85       '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" bigideclean bigide OPT="-Xg"';
     98      'make bigideclean bigide OPT="-Xg"';
    8699    OperationProgressForm.ShowModal;
    87100  end;
     
    94107  if Assigned(IDESource) then
    95108  try
     109    UpdateFPCConfig;
     110    UpdateLazarusConfig;
    96111    Process := TProcess.Create(nil);
    97112    Process.CurrentDirectory := GetPath + DirectorySeparator + IDESource.ProjectShortName;
    98     Process.CommandLine := IDESource.GetExecutableFile;
     113    Process.CommandLine := GetPath + DirectorySeparator + IDESource.ProjectShortName +
     114      DirectorySeparator + IDESource.GetExecutableFile + ' --primary-config-path=' +
     115      GetPath + DirectorySeparator + IDESource.ProjectShortName +
     116      DirectorySeparator + 'config';
    99117    Process.Execute;
    100118  finally
    101119    Process.Free;
     120  end;
     121end;
     122
     123procedure TInstance.UpdateLazarusConfig;
     124var
     125  Config: TStringList;
     126begin
     127  try
     128    Config := TStringList.Create;
     129    Config.LoadFromFile(MainForm.GetBaseDir + DirectorySeparator +
     130      MainForm.TemplateDir + DirectorySeparator + 'environmentoptions.xml');
     131    Config.Text := StringReplace(Config.Text, '%FPCDir%', GetPath + DirectorySeparator + FPCSource.ProjectShortName, [rfReplaceAll]);
     132    Config.Text := StringReplace(Config.Text, '%BaseDir%', MainForm.GetBaseDir, [rfReplaceAll]);
     133    Config.Text := StringReplace(Config.Text, '%LazarusDir%', GetPath + DirectorySeparator + IDESource.ProjectShortName, [rfReplaceAll]);
     134    Config.Text := StringReplace(Config.Text, '%FPCPlatform%', MainForm.Platform, [rfReplaceAll]);
     135    Config.Text := StringReplace(Config.Text, '%Temp%', GetEnvironmentVariableUTF8('Temp'), [rfReplaceAll]);
     136    Config.SaveToFile(GetPath + DirectorySeparator + IDESource.ProjectShortName +
     137      DirectorySeparator + 'config' + DirectorySeparator + 'environmentoptions.xml');
     138  finally
     139    Config.Free;
     140  end;
     141end;
     142
     143procedure TInstance.UpdateFPCConfig;
     144var
     145  Config: TStringList;
     146begin
     147  try
     148    Config := TStringList.Create;
     149    Config.LoadFromFile(MainForm.GetBaseDir + DirectorySeparator +
     150      MainForm.TemplateDir + DirectorySeparator + 'fpc.cfg');
     151    Config.Text := StringReplace(Config.Text, '$(FPCDir)', GetPath +
     152      DirectorySeparator + FPCSource.ProjectShortName, [rfReplaceAll]);
     153    Config.SaveToFile(GetPath + DirectorySeparator + FPCSource.ProjectShortName +
     154      DirectorySeparator + 'bin' + DirectorySeparator +
     155      MainForm.Platform + DirectorySeparator + 'fpc.cfg');
     156  finally
     157    Config.Free;
    102158  end;
    103159end;
  • trunk/USource.pas

    r5 r6  
    1515
    1616  TSource = class
     17  private
     18    function GetDownloaded: Boolean;
     19  public
    1720    Id: Integer;
    1821    ProjectName: string;
     
    2427    SourceType: TSourceType;
    2528    ExecutableFile: string;
     29    property Downloaded: Boolean read GetDownloaded;
    2630    procedure Assign(Source: TSource);
    2731    procedure Download;
     
    3034    function GetExecutableFile: string;
    3135    function GetPath: string;
     36    function GetName: string;
    3237  end;
    3338
     
    4550
    4651{ TSource }
     52
     53function TSource.GetDownloaded: Boolean;
     54begin
     55  Result := DirectoryExistsUTF8(GetPath);
     56end;
    4757
    4858procedure TSource.Assign(Source: TSource);
     
    94104  Result := ExtractFileDir(Application.ExeName) + DirectorySeparator +
    95105    MainForm.SourceDir + DirectorySeparator + IntToStr(Id);
     106end;
     107
     108function TSource.GetName: string;
     109begin
     110  Result := ProjectShortName + ' ' + VersionNumber +
     111    ' (' + VersionType + ')';
    96112end;
    97113
Note: See TracChangeset for help on using the changeset viewer.