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

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 CheckStatistics(ThisErrCnt);
begin
CheckStatistics(ThisErrCnt);
end;
{ {
if (ptt in FTestTypes) then if (ptt in FTestTypes) then
begin begin