git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.jcl@16 c37d764d-f447-7644-a108-883140d013fb
134 lines
5.9 KiB
ObjectPascal
134 lines
5.9 KiB
ObjectPascal
{**************************************************************************************************}
|
|
{ }
|
|
{ Project JEDI Code Library (JCL) }
|
|
{ }
|
|
{ The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); }
|
|
{ you may not use this file except in compliance with the License. You may obtain a copy of the }
|
|
{ License at http://www.mozilla.org/MPL/ }
|
|
{ }
|
|
{ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF }
|
|
{ ANY KIND, either express or implied. See the License for the specific language governing rights }
|
|
{ and limitations under the License. }
|
|
{ }
|
|
{ The Original Code is JclOtaUnitVersioningSheet.pas. }
|
|
{ }
|
|
{ The Initial Developer of the Original Code is Florent Ouchet }
|
|
{ <outchy att users dott sourceforge dott net> }
|
|
{ Portions created by Florent Ouchet are Copyright (C) of Florent Ouchet. All rights reserved. }
|
|
{ }
|
|
{ Contributors: }
|
|
{ }
|
|
{**************************************************************************************************}
|
|
{ }
|
|
{ Last modified: $Date:: 2008-09-23 23:08:21 +0200 (mar., 23 sept. 2008) $ }
|
|
{ Revision: $Rev:: 2494 $ }
|
|
{ Author: $Author:: outchy $ }
|
|
{ }
|
|
{**************************************************************************************************}
|
|
|
|
unit JclOtaUnitVersioningSheet;
|
|
|
|
{$I jcl.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
|
JclUnitVersioning,
|
|
Dialogs, ComCtrls, StdCtrls;
|
|
|
|
type
|
|
TJclOtaUnitVersioningFrame = class(TFrame)
|
|
MemoUnitVersioning: TMemo;
|
|
ButtonCopyToClipboard: TButton;
|
|
ButtonSaveAsText: TButton;
|
|
SaveDialogText: TSaveDialog;
|
|
procedure ButtonCopyToClipboardClick(Sender: TObject);
|
|
procedure ButtonSaveAsTextClick(Sender: TObject);
|
|
private
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
end;
|
|
|
|
{$IFDEF UNITVERSIONING}
|
|
const
|
|
UnitVersioning: TUnitVersionInfo = (
|
|
RCSfile: '$URL: https://jcl.svn.sourceforge.net/svnroot/jcl/tags/JCL-1.104-Build3248/jcl/experts/common/JclOtaUnitVersioningSheet.pas $';
|
|
Revision: '$Revision: 2494 $';
|
|
Date: '$Date: 2008-09-23 23:08:21 +0200 (mar., 23 sept. 2008) $';
|
|
LogPath: 'JCL\experts\common'
|
|
);
|
|
{$ENDIF UNITVERSIONING}
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses
|
|
ActnList, Menus,
|
|
ToolsApi,
|
|
JclBase, JclFileUtils, JclUnitVersioningProviders,
|
|
JclOtaConsts, JclOtaResources, JclOtaUtils;
|
|
|
|
procedure TJclOtaUnitVersioningFrame.ButtonCopyToClipboardClick(
|
|
Sender: TObject);
|
|
begin
|
|
MemoUnitVersioning.SelectAll;
|
|
MemoUnitVersioning.CopyToClipboard;
|
|
end;
|
|
|
|
procedure TJclOtaUnitVersioningFrame.ButtonSaveAsTextClick(Sender: TObject);
|
|
begin
|
|
if SaveDialogText.Execute then
|
|
MemoUnitVersioning.Lines.SaveToFile(SaveDialogText.FileName);
|
|
end;
|
|
|
|
constructor TJclOtaUnitVersioningFrame.Create(AOwner: TComponent);
|
|
var
|
|
UnitVersioning: TUnitVersioning;
|
|
UnitVersioningModule: TUnitVersioningModule;
|
|
UnitVersion: TUnitVersion;
|
|
I, J: Integer;
|
|
LongFileName: string;
|
|
begin
|
|
inherited Create(AOwner);
|
|
ButtonCopyToClipboard.Caption := RsCopyToClipboard;
|
|
ButtonSaveAsText.Caption := RsSaveAsText;
|
|
|
|
UnitVersioning := GetUnitVersioning;
|
|
UnitVersioning.RegisterProvider(TJclDefaultUnitVersioningProvider);
|
|
for I := 0 to Pred(UnitVersioning.ModuleCount) do
|
|
UnitVersioning.LoadModuleUnitVersioningInfo(UnitVersioning.Modules[I].Instance);
|
|
MemoUnitVersioning.Lines.BeginUpdate;
|
|
try
|
|
MemoUnitVersioning.Lines.Clear;
|
|
MemoUnitVersioning.Lines.Add(Format('JCL %d.%d.%d.%d', [JclVersionMajor, JclVersionMinor, JclVersionRelease, JclVersionBuild]));
|
|
for I := 0 to Pred(UnitVersioning.ModuleCount) do
|
|
begin
|
|
UnitVersioningModule := UnitVersioning.Modules[I];
|
|
MemoUnitVersioning.Lines.Add(Format('%s [%d units]', [GetModulePath(UnitVersioningModule.Instance), UnitVersioningModule.Count]));
|
|
for J := 0 to Pred(UnitVersioningModule.Count) do
|
|
begin
|
|
UnitVersion := UnitVersioningModule.Items[J];
|
|
LongFileName := UnitVersion.LogPath;
|
|
if LongFileName <> '' then
|
|
LongFileName := PathAddSeparator(LongFileName);
|
|
LongFileName := LongFileName + UnitVersion.RCSfile;
|
|
MemoUnitVersioning.Lines.Add(Format('%s %s %s', [LongFileName, UnitVersion.Revision, UnitVersion.Date]));
|
|
end;
|
|
end;
|
|
finally
|
|
MemoUnitVersioning.Lines.EndUpdate;
|
|
end;
|
|
end;
|
|
|
|
{$IFDEF UNITVERSIONING}
|
|
initialization
|
|
RegisterUnitVersion(HInstance, UnitVersioning);
|
|
|
|
finalization
|
|
UnregisterUnitVersion(HInstance);
|
|
{$ENDIF UNITVERSIONING}
|
|
|
|
end.
|