Changeset 4


Ignore:
Timestamp:
Sep 1, 2014, 7:10:03 PM (10 years ago)
Author:
chronos
Message:
  • Added: Concept of project and open project as directory.
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.lfm

    r3 r4  
    11object FormBrowse: TFormBrowse
    2   Left = 351
     2  Left = 554
    33  Height = 526
    4   Top = 147
     4  Top = 269
    55  Width = 722
    66  Caption = 'Browse'
    77  ClientHeight = 526
    88  ClientWidth = 722
    9   LCLVersion = '1.1'
     9  LCLVersion = '1.3'
    1010  object TreeView1: TTreeView
    1111    Left = 0
     
    1414    Width = 241
    1515    Align = alLeft
     16    DefaultItemHeight = 24
    1617    TabOrder = 0
    1718  end
     
    4344      item
    4445        Caption = 'Status'
    45         Width = 256
     46        Width = 259
    4647      end>
    4748    ReadOnly = True
  • trunk/Forms/UFormMain.lfm

    r3 r4  
    55  Width = 667
    66  Caption = 'VCSCommander'
    7   ClientHeight = 472
     7  ClientHeight = 471
    88  ClientWidth = 667
    99  Menu = MainMenu1
    10   LCLVersion = '1.1'
     10  LCLVersion = '1.3'
    1111  object ToolBarMain: TToolBar
    1212    Left = 0
     
    1515    Width = 667
    1616    Caption = 'ToolBarMain'
    17     Images = ImageList1
    1817    ParentShowHint = False
    1918    ShowHint = True
     
    2221  object StatusBar1: TStatusBar
    2322    Left = 0
    24     Height = 21
    25     Top = 451
     23    Height = 26
     24    Top = 445
    2625    Width = 667
    2726    Panels = <>
    2827  end
    2928  object MainMenu1: TMainMenu
    30     Images = ImageList1
    3129    left = 232
    3230    top = 88
    3331    object MenuItemFile: TMenuItem
    3432      Caption = 'File'
     33      object MenuItem8: TMenuItem
     34        Action = Core.AProjectOpen
     35      end
     36      object MenuItem10: TMenuItem
     37        Action = Core.AProjectClose
     38      end
     39      object MenuItem9: TMenuItem
     40        Caption = '-'
     41      end
    3542      object MenuItemQuit: TMenuItem
    36         Action = AQuit
     43        Action = Core.AQuit
    3744      end
    3845    end
     
    4047      Caption = 'View'
    4148      object MenuItem7: TMenuItem
    42         Action = AViewFavorites
     49        Caption = 'Favorites'
    4350      end
    4451    end
     
    4653      Caption = 'General'
    4754      object MenuItem2: TMenuItem
    48         Action = ASettings
     55        Action = Core.ASettings
    4956      end
    5057    end
    5158    object MenuItem3: TMenuItem
    52       Caption = 'Help'
     59      Action = Core.AHelp
    5360      object MenuItem5: TMenuItem
    54         Action = AHelp
     61        Caption = 'Help'
    5562      end
    5663      object MenuItem4: TMenuItem
    57         Action = AAbout
     64        Action = Core.AAbout
    5865      end
    5966    end
    6067  end
    61   object ActionList1: TActionList
    62     Images = ImageList1
    63     left = 232
    64     top = 144
    65     object AQuit: TAction
    66       Caption = 'Quit'
    67       Hint = 'Quit'
    68       OnExecute = AQuitExecute
    69     end
    70     object ASettings: TAction
    71       Caption = 'Settings'
    72     end
    73     object AAbout: TAction
    74       Caption = 'About'
    75     end
    76     object AHelp: TAction
    77       Caption = 'Help'
    78     end
    79     object AViewFavorites: TAction
    80       Caption = 'Favorites'
    81     end
    82   end
    83   object ImageList1: TImageList
    84     left = 232
    85     top = 200
    86   end
    8768end
  • trunk/Forms/UFormMain.pas

    r3 r4  
    1414
    1515  TFormMain = class(TForm)
    16     AViewFavorites: TAction;
    17     AHelp: TAction;
    18     ASettings: TAction;
    19     AAbout: TAction;
    20     AQuit: TAction;
    21     ActionList1: TActionList;
    22     ImageList1: TImageList;
    2316    MainMenu1: TMainMenu;
    2417    MenuItem1: TMenuItem;
     18    MenuItem10: TMenuItem;
    2519    MenuItem2: TMenuItem;
    2620    MenuItem3: TMenuItem;
     
    2923    MenuItem6: TMenuItem;
    3024    MenuItem7: TMenuItem;
     25    MenuItem8: TMenuItem;
     26    MenuItem9: TMenuItem;
    3127    MenuItemQuit: TMenuItem;
    3228    MenuItemFile: TMenuItem;
    3329    StatusBar1: TStatusBar;
    3430    ToolBarMain: TToolBar;
    35     procedure AQuitExecute(Sender: TObject);
    3631  private
    3732    { private declarations }
    3833  public
    39     { public declarations }
     34    procedure UpdateInterface;
    4035  end;
    4136
     
    4742{$R *.lfm}
    4843
     44uses
     45  UCore;
     46
    4947{ TFormMain }
    5048
    51 procedure TFormMain.AQuitExecute(Sender: TObject);
     49procedure TFormMain.UpdateInterface;
     50const
     51  AppName = 'VCSCommander';
    5252begin
    53   Close;
     53  if Assigned(Core.Project) then
     54    Caption := Core.Project.Directory + ' - ' + AppName
     55    else Caption := AppName
    5456end;
    5557
  • trunk/UCore.lfm

    r3 r4  
    11object Core: TCore
     2  OnCreate = DataModuleCreate
     3  OnDestroy = DataModuleDestroy
    24  OldCreateOrder = False
    35  Height = 346
     
    57  VerticalOffset = 265
    68  Width = 447
     9  object ActionList1: TActionList
     10    left = 260
     11    top = 172
     12    object AQuit: TAction
     13      Caption = 'Quit'
     14      Hint = 'Quit'
     15      OnExecute = AQuitExecute
     16    end
     17    object ASettings: TAction
     18      Caption = 'Settings'
     19    end
     20    object AAbout: TAction
     21      Caption = 'About'
     22    end
     23    object AHelp: TAction
     24      Caption = 'Help'
     25    end
     26    object AViewFavorites: TAction
     27      Caption = 'Favorites'
     28    end
     29    object AProjectOpen: TAction
     30      Caption = 'Open...'
     31      OnExecute = AProjectOpenExecute
     32      ShortCut = 16463
     33    end
     34    object AProjectClose: TAction
     35      Caption = 'Close'
     36      OnExecute = AProjectCloseExecute
     37    end
     38  end
     39  object ImageList1: TImageList
     40    left = 260
     41    top = 228
     42  end
     43  object OpenDialog1: TOpenDialog
     44    left = 396
     45    top = 113
     46  end
    747end
  • trunk/UCore.pas

    r1 r4  
    11unit UCore;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
    66
    77uses
    8   Classes, SysUtils, FileUtil;
     8  Classes, SysUtils, FileUtil, ActnList, Controls, UVCS, UProject, Forms,
     9  Dialogs;
    910
    1011type
     12
     13  { TCore }
     14
    1115  TCore = class(TDataModule)
     16    AAbout: TAction;
     17    AProjectClose: TAction;
     18    ActionList1: TActionList;
     19    AHelp: TAction;
     20    AProjectOpen: TAction;
     21    AQuit: TAction;
     22    ASettings: TAction;
     23    AViewFavorites: TAction;
     24    ImageList1: TImageList;
     25    OpenDialog1: TOpenDialog;
     26    procedure AProjectCloseExecute(Sender: TObject);
     27    procedure AProjectOpenExecute(Sender: TObject);
     28    procedure AQuitExecute(Sender: TObject);
     29    procedure DataModuleCreate(Sender: TObject);
     30    procedure DataModuleDestroy(Sender: TObject);
    1231  private
    13     { private declarations }
     32    procedure UpdateInterface;
    1433  public
    15     { public declarations }
     34    Project: TProject;
    1635  end;
    1736
     
    2342{$R *.lfm}
    2443
     44uses
     45  UFormMain;
     46
     47{ TCore }
     48
     49procedure TCore.AQuitExecute(Sender: TObject);
     50begin
     51  Application.Terminate;
     52end;
     53
     54procedure TCore.DataModuleCreate(Sender: TObject);
     55begin
     56  UpdateInterface;
     57end;
     58
     59procedure TCore.DataModuleDestroy(Sender: TObject);
     60begin
     61  Project.Free;
     62end;
     63
     64procedure TCore.UpdateInterface;
     65begin
     66  AProjectClose.Enabled := Assigned(Project);
     67  FormMain.UpdateInterface;
     68end;
     69
     70procedure TCore.AProjectOpenExecute(Sender: TObject);
     71var
     72  Dir: string;
     73  OldDir: string;
     74begin
     75  if Assigned(Project) then OldDir := Project.Directory
     76    else OldDir := '';
     77  if SelectDirectory('Open project', OldDir, Dir) then begin
     78    AProjectClose.Execute;
     79    Project := TProject.Create;
     80    Project.Directory := Dir;
     81    UpdateInterface;
     82  end;
     83end;
     84
     85procedure TCore.AProjectCloseExecute(Sender: TObject);
     86begin
     87  FreeAndNil(Project);
     88  UpdateInterface;
     89end;
     90
    2591end.
    2692
  • trunk/Units/USubversion.pas

    r3 r4  
    1212  { TSubversion }
    1313
    14   TSubversion = class(TVCS)
    15     procedure Checkout;
    16     procedure Update;
    17     procedure CleanUp;
    18     procedure Commit;
    19     procedure Move;
    20     procedure Merge;
     14  TSubversion = class(TWorkingCopy)
     15    procedure Checkout; override;
     16    procedure Update; override;
     17    procedure CleanUp; override;
     18    procedure Commit; override;
     19    procedure Move; override;
     20    procedure Merge; override;
    2121  end;
    2222
  • trunk/Units/UVCS.pas

    r2 r4  
    99
    1010type
     11
     12  { TWorkingCopy }
     13
    1114  TWorkingCopy = class
    12     Path: string;
     15  private
     16    FPath: string;
     17    procedure SetPath(AValue: string);
     18  public
     19    procedure Checkout; virtual;
     20    procedure Update; virtual;
     21    procedure CleanUp; virtual;
     22    procedure Commit; virtual;
     23    procedure Move; virtual;
     24    procedure Merge; virtual;
     25    procedure Refresh; virtual;
     26    property Path: string read FPath write SetPath;
    1327  end;
    1428
     
    1731  end;
    1832
     33
    1934implementation
     35
     36
     37{ TWorkingCopy }
     38
     39procedure TWorkingCopy.SetPath(AValue: string);
     40begin
     41  if FPath=AValue then Exit;
     42  FPath := AValue;
     43  Refresh;
     44end;
     45
     46procedure TWorkingCopy.Checkout;
     47begin
     48
     49end;
     50
     51procedure TWorkingCopy.Update;
     52begin
     53
     54end;
     55
     56procedure TWorkingCopy.CleanUp;
     57begin
     58
     59end;
     60
     61procedure TWorkingCopy.Commit;
     62begin
     63
     64end;
     65
     66procedure TWorkingCopy.Move;
     67begin
     68
     69end;
     70
     71procedure TWorkingCopy.Merge;
     72begin
     73
     74end;
     75
     76procedure TWorkingCopy.Refresh;
     77begin
     78
     79end;
    2080
    2181end.
  • trunk/VCSCommander.lpi

    r3 r4  
    1 <?xml version="1.0"?>
     1<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    33  <ProjectOptions>
     
    5454            </Options>
    5555          </Linking>
    56           <Other>
    57             <CompilerMessages>
    58               <MsgFileName Value=""/>
    59             </CompilerMessages>
    60             <CompilerPath Value="$(CompPath)"/>
    61           </Other>
    6256        </CompilerOptions>
    6357      </Item2>
     
    7165      <local>
    7266        <FormatVersion Value="1"/>
    73         <LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
    7467      </local>
    7568    </RunParams>
     
    7972      </Item1>
    8073    </RequiredPackages>
    81     <Units Count="8">
     74    <Units Count="9">
    8275      <Unit0>
    8376        <Filename Value="VCSCommander.lpr"/>
    8477        <IsPartOfProject Value="True"/>
    85         <UnitName Value="VCSCommander"/>
    8678      </Unit0>
    8779      <Unit1>
     
    118110        <IsPartOfProject Value="True"/>
    119111        <ComponentName Value="FormFavorites"/>
     112        <HasResources Value="True"/>
    120113        <ResourceBaseClass Value="Form"/>
    121114        <UnitName Value="UFormFavorites"/>
     
    125118        <IsPartOfProject Value="True"/>
    126119        <ComponentName Value="FormSettings"/>
     120        <HasResources Value="True"/>
    127121        <ResourceBaseClass Value="Form"/>
    128122        <UnitName Value="UFormSettings"/>
     
    133127        <UnitName Value="USubversion"/>
    134128      </Unit7>
     129      <Unit8>
     130        <Filename Value="Units/UProject.pas"/>
     131        <IsPartOfProject Value="True"/>
     132        <UnitName Value="UProject"/>
     133      </Unit8>
    135134    </Units>
    136135  </ProjectOptions>
     
    160159        <StackChecks Value="True"/>
    161160      </Checks>
    162       <VerifyObjMethodCallValidity Value="True"/>
    163161    </CodeGeneration>
    164162    <Linking>
     
    172170      </Options>
    173171    </Linking>
    174     <Other>
    175       <CompilerMessages>
    176         <MsgFileName Value=""/>
    177       </CompilerMessages>
    178       <CompilerPath Value="$(CompPath)"/>
    179     </Other>
    180172  </CompilerOptions>
    181173  <Debugging>
  • trunk/VCSCommander.lpr

    r3 r4  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, UFormBrowse, UVCS, UFormFavorites, UFormSettings,
    11   USubversion
     11  USubversion, UProject
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.