PoChecker: display summary form even if statistics showing is disabled (in this case it is simply not added to log). This allows user to always see translation completion status and get access to graphical summary.

git-svn-id: trunk@57546 -
This commit is contained in:
maxim 2018-03-21 22:56:15 +00:00
parent 20834ad1f1
commit 085dd5ef9f
2 changed files with 22 additions and 37 deletions

View File

@ -541,9 +541,6 @@ begin
PoFamilyList.RunTests(ErrorCount, WarningCount, TotalTranslatedCount, TotalUntranslatedCount, TotalFuzzyCount, SL); PoFamilyList.RunTests(ErrorCount, WarningCount, TotalTranslatedCount, TotalUntranslatedCount, TotalFuzzyCount, SL);
//debugln('RunSelectedTests: ', Format(sTotalErrors, [ErrorCount])); //debugln('RunSelectedTests: ', Format(sTotalErrors, [ErrorCount]));
//debugln(' ', Format(sTotalWarnings, [WarningCount])); //debugln(' ', Format(sTotalWarnings, [WarningCount]));
if (ErrorCount > 0) or (WarningCount > 0) or
(pttCheckStatistics in TestTypes) then
begin
TotalPercTranslated := 100 * TotalTranslatedCount / (TotalTranslatedCount + TotalUntranslatedCount + TotalFuzzyCount); TotalPercTranslated := 100 * TotalTranslatedCount / (TotalTranslatedCount + TotalUntranslatedCount + TotalFuzzyCount);
SL.Add(Format(sTotalErrors, [ErrorCount])); SL.Add(Format(sTotalErrors, [ErrorCount]));
SL.Add(Format(sTotalWarnings, [WarningCount])); SL.Add(Format(sTotalWarnings, [WarningCount]));
@ -559,22 +556,13 @@ begin
ResultDlg.FTotalPercTranslated := TotalPercTranslated; ResultDlg.FTotalPercTranslated := TotalPercTranslated;
ResultDlg.Log.Assign(SL); ResultDlg.Log.Assign(SL);
FreeAndNil(SL); //No need to keep 2 copies of this data FreeAndNil(SL); //No need to keep 2 copies of this data
if (pttCheckStatistics in TestTypes) then
begin
ResultDlg.PoFamilyList := PoFamilyList; ResultDlg.PoFamilyList := PoFamilyList;
ResultDlg.PoFamilyStats := PoFamilyList.PoFamilyStats; ResultDlg.PoFamilyStats := PoFamilyList.PoFamilyStats;
end
else
begin
ResultDlg.PoFamilyList := nil;
ResultDlg.PoFamilyStats := nil;
end;
ResultDlg.Settings := FPoCheckerSettings; ResultDlg.Settings := FPoCheckerSettings;
mr := ResultDlg.ShowModal; mr := ResultDlg.ShowModal;
finally finally
ResultDlg.Free; ResultDlg.Free;
end; end;
end;
NoErrLabel.Visible := (ErrorCount = 0); NoErrLabel.Visible := (ErrorCount = 0);
finally finally
if Assigned(SL) then if Assigned(SL) then

View File

@ -938,10 +938,7 @@ begin
TranslatedCount := FChild.NrTranslated; TranslatedCount := FChild.NrTranslated;
UntranslatedCount := FChild.NrUntranslated; UntranslatedCount := FChild.NrUntranslated;
FuzzyCount := FChild.NrFuzzy; FuzzyCount := FChild.NrFuzzy;
if (pttCheckStatistics in FTestTypes) then
begin
CheckStatistics(ThisErrCnt); CheckStatistics(ThisErrCnt);
end;
{ {
if (ptt in FTestTypes) then if (ptt in FTestTypes) then
begin begin