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,39 +541,27 @@ begin
PoFamilyList.RunTests(ErrorCount, WarningCount, TotalTranslatedCount, TotalUntranslatedCount, TotalFuzzyCount, SL);
//debugln('RunSelectedTests: ', Format(sTotalErrors, [ErrorCount]));
//debugln(' ', Format(sTotalWarnings, [WarningCount]));
if (ErrorCount > 0) or (WarningCount > 0) or
(pttCheckStatistics in TestTypes) then
begin
TotalPercTranslated := 100 * TotalTranslatedCount / (TotalTranslatedCount + TotalUntranslatedCount + TotalFuzzyCount);
SL.Add(Format(sTotalErrors, [ErrorCount]));
SL.Add(Format(sTotalWarnings, [WarningCount]));
SL.Add(Format(sTotalUntranslatedStrings, [IntToStr(TotalUntranslatedCount)]));
SL.Add(Format(sTotalFuzzyStrings, [IntToStr(TotalFuzzyCount)]));
SL.Add('');
SL.Add(Format(sTotalTranslatedStrings, [IntToStr(TotalTranslatedCount), TotalPercTranslated]));
ResultDlg := TResultDlgForm.Create(nil);
try
ResultDlg.FTotalTranslated := TotalTranslatedCount;
ResultDlg.FTotalUntranslated := TotalUntranslatedCount;
ResultDlg.FTotalFuzzy := TotalFuzzyCount;
ResultDlg.FTotalPercTranslated := TotalPercTranslated;
ResultDlg.Log.Assign(SL);
FreeAndNil(SL); //No need to keep 2 copies of this data
if (pttCheckStatistics in TestTypes) then
begin
ResultDlg.PoFamilyList := PoFamilyList;
ResultDlg.PoFamilyStats := PoFamilyList.PoFamilyStats;
end
else
begin
ResultDlg.PoFamilyList := nil;
ResultDlg.PoFamilyStats := nil;
end;
ResultDlg.Settings := FPoCheckerSettings;
mr := ResultDlg.ShowModal;
finally
ResultDlg.Free;
end;
TotalPercTranslated := 100 * TotalTranslatedCount / (TotalTranslatedCount + TotalUntranslatedCount + TotalFuzzyCount);
SL.Add(Format(sTotalErrors, [ErrorCount]));
SL.Add(Format(sTotalWarnings, [WarningCount]));
SL.Add(Format(sTotalUntranslatedStrings, [IntToStr(TotalUntranslatedCount)]));
SL.Add(Format(sTotalFuzzyStrings, [IntToStr(TotalFuzzyCount)]));
SL.Add('');
SL.Add(Format(sTotalTranslatedStrings, [IntToStr(TotalTranslatedCount), TotalPercTranslated]));
ResultDlg := TResultDlgForm.Create(nil);
try
ResultDlg.FTotalTranslated := TotalTranslatedCount;
ResultDlg.FTotalUntranslated := TotalUntranslatedCount;
ResultDlg.FTotalFuzzy := TotalFuzzyCount;
ResultDlg.FTotalPercTranslated := TotalPercTranslated;
ResultDlg.Log.Assign(SL);
FreeAndNil(SL); //No need to keep 2 copies of this data
ResultDlg.PoFamilyList := PoFamilyList;
ResultDlg.PoFamilyStats := PoFamilyList.PoFamilyStats;
ResultDlg.Settings := FPoCheckerSettings;
mr := ResultDlg.ShowModal;
finally
ResultDlg.Free;
end;
NoErrLabel.Visible := (ErrorCount = 0);
finally

View File

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