fixed project win32 version info Modified

git-svn-id: trunk@9837 -
This commit is contained in:
mattias 2006-09-08 10:17:15 +00:00
parent bced4033dc
commit 9afbd07ae6
4 changed files with 34 additions and 27 deletions

View File

@ -57,7 +57,7 @@ type
procedure AppendToRCFile;
procedure RewriteRCFile;
function DoTheRealCompile: TModalResult;
function CheckLPRFile: TModalResult;
function UpdateMainSourceFile(const AFilename: string): TModalResult;
function HexToDec(Str: string): Integer;
public
TargetOS: string;
@ -81,7 +81,6 @@ type
ProductVersionString: string;
VersionInfoMessages: TStringList;
VersionInfoCodeBuf: TCodeBuffer;
Languages: TStringList; // for Project Options pull-down
HexLanguages: TStringList; // for Project Options pull-down
@ -249,7 +248,7 @@ begin
VersionInfoMessages.Clear;
VersionInfoMessages.Add('Resource file ' + rcFilename + ' has been compiled successfully!');
{ we got a compiled .res file, check if it's included in the .lpr file }
Result := CheckLPRFile;
Result := UpdateMainSourceFile(MainFilename);
end
else
begin
@ -527,13 +526,18 @@ begin
VersionInfoMessages.Add(rcStringList[n - 1]);
end;
{-----------------------------------------------------------------------------}
{ TVersionInfo CheckLPRFile }
{-----------------------------------------------------------------------------}
function TVersionInfo.CheckLPRFile: TModalResult;
var NewX, NewY, NewTopLine: integer;
{-----------------------------------------------------------------------------
TVersionInfo UpdateMainSourceFile
-----------------------------------------------------------------------------}
function TVersionInfo.UpdateMainSourceFile(const AFilename: string
): TModalResult;
var
NewX, NewY, NewTopLine: integer;
VersionInfoCodeBuf: TCodeBuffer;
begin
Result := mrOk;
Result := mrCancel;
VersionInfoCodeBuf:=CodeToolBoss.LoadFile(AFilename,false,false);
if VersionInfoCodeBuf=nil then exit;
if not CodeToolBoss.FindResourceDirective(VersionInfoCodeBuf,1,1,
VersionInfoCodeBuf,NewX,NewY,
NewTopLine,ExtractFileName(resFilename)) then
@ -543,14 +547,15 @@ begin
begin
VersionInfoMessages.Add('Could not add "{$R '
+ ExtractFileName(resFilename)+'}" to main source!');
Result := mrCancel;
exit;
end
end;
Result:=mrOk;
end;
{-----------------------------------------------------------------------------}
{ TVersionInfo SetTargetOS }
{-----------------------------------------------------------------------------}
{-----------------------------------------------------------------------------
TVersionInfo SetTargetOS
-----------------------------------------------------------------------------}
function TVersionInfo.SetTargetOS(CurrentProjectsTargetOS: string): string;
begin
if CurrentProjectsTargetOS <> '' then

View File

@ -7455,8 +7455,6 @@ begin
try
// handle versioninfo
Project1.VersionInfo.VersionInfoCodeBuf := Project1.MainUnitInfo.Source;
// ShowMessage(IntToStr(Project1.VersionInfo.VersionNr));
Result := Project1.VersionInfo.CompileRCFile(Project1.MainFilename);
for Count := 1 to Project1.VersionInfo.VersionInfoMessages.Count do
MessagesView.AddMsg(Format(Project1.VersionInfo.VersionInfoMessages[Count - 1],

View File

@ -385,6 +385,7 @@ procedure TProjectOptionsDialog.ProjectOptionsClose(Sender: TObject;
var CloseAction: TCloseAction);
var
NewFlags: TProjectFlags;
VersionInfoModified: Boolean;
procedure SetProjectFlag(AFlag: TProjectFlag; AValue: Boolean);
begin
@ -435,18 +436,21 @@ begin
Project.LazDocPaths:=StringListToText(LazDocListBox.Items,';',true);
// VersionInfo
Project.VersionInfo.SetUseVersionInfo(UseVersionInfoCheckBox.Checked, Project.Modified);
Project.VersionInfo.SetAutoIncrementBuild(AutomaticallyIncreaseBuildCheckBox.Checked, Project.Modified);
Project.VersionInfo.SetVersionNr(VersionSpinEdit.Value, Project.Modified);
Project.VersionInfo.SetMajorRevNr(MajorRevisionSpinEdit.Value, Project.Modified);
Project.VersionInfo.SetMinorRevNr(MinorRevisionSpinEdit.Value, Project.Modified);
Project.VersionInfo.SetBuildNr(StrToInt(BuildEdit.Text), Project.Modified);
Project.VersionInfo.SetDescriptionString(DescriptionEdit.Text, Project.Modified);
Project.VersionInfo.SetCopyrightString(CopyrightEdit.Text, Project.Modified);
Project.VersionInfo.SetHexLang(LanguageSelectionComboBox.Items[LanguageSelectionComboBox.ItemIndex], Project.Modified);
Project.VersionInfo.SetHexCharSet(CharacterSetComboBox.Items[CharacterSetComboBox.ItemIndex], Project.Modified);
VersionInfoModified:=false;
Project.VersionInfo.SetUseVersionInfo(UseVersionInfoCheckBox.Checked, VersionInfoModified);
Project.VersionInfo.SetAutoIncrementBuild(AutomaticallyIncreaseBuildCheckBox.Checked, VersionInfoModified);
Project.VersionInfo.SetVersionNr(VersionSpinEdit.Value, VersionInfoModified);
Project.VersionInfo.SetMajorRevNr(MajorRevisionSpinEdit.Value, VersionInfoModified);
Project.VersionInfo.SetMinorRevNr(MinorRevisionSpinEdit.Value, VersionInfoModified);
Project.VersionInfo.SetBuildNr(StrToInt(BuildEdit.Text), VersionInfoModified);
Project.VersionInfo.SetDescriptionString(DescriptionEdit.Text, VersionInfoModified);
Project.VersionInfo.SetCopyrightString(CopyrightEdit.Text, VersionInfoModified);
Project.VersionInfo.SetHexLang(LanguageSelectionComboBox.Items[LanguageSelectionComboBox.ItemIndex], VersionInfoModified);
Project.VersionInfo.SetHexCharSet(CharacterSetComboBox.Items[CharacterSetComboBox.ItemIndex], VersionInfoModified);
// Project.VersionInfo.HexLang := Project.VersionInfo.HexLanguages[Project.VersionInfo.Languages.IndexOf(LanguageSelectionComboBox.Items[LanguageSelectionComboBox.ItemIndex])];
// Project.VersionInfo.HexCharSet := Project.VersionInfo.HexCharSets[Project.VersionInfo.CharSets.IndexOf(CharacterSetComboBox.Items[CharacterSetComboBox.ItemIndex])];
if VersionInfoModified then
Project.Modified:=true;
end;
IDEDialogLayoutList.SaveLayout(Self);

View File

@ -2248,7 +2248,7 @@ var
begin
Result:=mrCancel;
DebugLn('TLazPackageGraph.CompilePackage A ',APackage.IDAsString,' Flags=',PkgCompileFlagsToString(Flags));
//DebugLn('TLazPackageGraph.CompilePackage A ',APackage.IDAsString,' Flags=',PkgCompileFlagsToString(Flags));
if APackage.AutoCreated then begin
DebugLn(['TLazPackageGraph.CompilePackage failed because autocreated: ',APackage.IDAsString]);
@ -2283,7 +2283,7 @@ begin
CompilerFilename,CompilerParams,
SrcFilename);
if Result=mrNo then begin
DebugLn(['TLazPackageGraph.CompilePackage ',APackage.IDAsString,' does not need compilation.']);
//DebugLn(['TLazPackageGraph.CompilePackage ',APackage.IDAsString,' does not need compilation.']);
Result:=mrOk;
exit;
end;