PoChecker:

- IDE integration (open PoFile in IDE). Patch by Giuliano Colla, slightly modified by me.
- Regenerated languagefiles.

git-svn-id: trunk@46354 -
This commit is contained in:
bart 2014-09-29 20:34:41 +00:00
parent 53a0681e2a
commit 9ee2dd7f12
16 changed files with 154 additions and 4 deletions

View File

@ -79,5 +79,6 @@ object GraphStatForm: TGraphStatForm
TabOrder = 1
ViewStyle = vsIcon
OnMouseMove = ListViewMouseMove
OnMouseUp = ListViewMouseUp
end
end

View File

@ -6,6 +6,7 @@ interface
uses
Classes, SysUtils, Types, FileUtil, Forms, Controls, Graphics, Dialogs,
{$ifndef POCHECKERSTANDALONE} LazIDEIntf, {$endif}
ExtCtrls, PoFamilies, PoCheckerConsts, LCLProc, StdCtrls, ComCtrls;
@ -29,6 +30,8 @@ type
procedure FormShow(Sender: TObject);
procedure ListViewMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure ListViewMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ private declarations }
FPoFamilyStats: TPoFamilyStats;
@ -106,6 +109,37 @@ begin
end;
procedure TGraphStatForm.ListViewMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
{$ifndef POCHECKERSTANDALONE}
var
anItem: TListItem;
anIndex: Integer;
AStat: TStat;
PageIndex,WindowIndex: Integer;
OpenFlags: TOpenFlags;
mr: TModalResult;
{$endif}
begin
{$ifndef POCHECKERSTANDALONE}
anItem := Listview.GetItemAt(X, Y);
if Assigned(anItem) then begin
anIndex := anItem.Index;
AStat := FPoFamilyStats.Items[anIndex];
PageIndex:= -1;
WindowIndex:= -1;
OpenFlags:= [ofOnlyIfExists,ofAddToRecent,ofRegularFile,ofConvertMacros];
mr := LazarusIde.DoOpenEditorFile(AStat.Name,PageIndex,WindowIndex,OpenFlags);
if mr = mrOk then begin
if MessageDlg('PoChecker',Format(sOpenFile,[AStat.PoName]),
mtConfirmation,mbOKCancel,0) = mrOk then begin
ModalResult:= mrOpenEditorFile; //To let caller know what we want to do
end;
end
else ShowMessage(Format(SOpenFail,[AStat.Name]));
end;
{$endif}
end;
procedure TGraphStatForm.FormCreate(Sender: TObject);
begin

View File

@ -178,6 +178,14 @@ msgstr "Nalezeno %d varování"
msgid "&Open a po-file"
msgstr "&Otevřít PO soubor"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Originál"

View File

@ -68,8 +68,7 @@ msgstr "[Zeile %d] %s"
#: pocheckerconsts.sduplicateoriginals
msgid "The (untranslated) value \"%s\" is used for more than 1 entry:"
msgstr ""
"Der (nicht übersetzte) Wert \"%s\" wird für mehr als 1 Eintrag verwendet:"
msgstr "Der (nicht übersetzte) Wert \"%s\" wird für mehr als 1 Eintrag verwendet:"
#: pocheckerconsts.serroroncleanup
msgid ""
@ -176,6 +175,14 @@ msgstr "%d Warnungen gefunden."
msgid "&Open a po-file"
msgstr "p&o-Datei öffnen"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Original"
@ -233,10 +240,17 @@ msgid "Show statistics graph"
msgstr "Zeige Statistik-Graphik"
#: pocheckerconsts.sstathint
#, fuzzy
#| msgid ""
#| "%3.1f%% Translated\n"
#| "%3.1f%% UnTranslated\n"
#| "%3.1f%% Fuzzy\n"
#| "%3d Translated (%3.1f%%)\n"
#| "%3d UnTranslated (%3.1f%%)\n"
#| "%3d Fuzzy (%3.1f%%)\n"
#| "%3d Translated (%3.1f%%)\n"
#| "%3d UnTranslated (%3.1f%%)\n"
#| "%3d Fuzzy (%3.1f%%)\n"
msgid ""
"%3d Translated (%3.1f%%)\n"
"%3d UnTranslated (%3.1f%%)\n"
@ -275,3 +289,4 @@ msgstr "Alle abwählen"
#: pocheckerconsts.suntranslated
msgid "Untranslated"
msgstr "Nicht übersetzt"

View File

@ -175,6 +175,14 @@ msgstr "Encontradas %d advertencias."
msgid "&Open a po-file"
msgstr "Abrir un fichero p&o"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Original"

View File

@ -175,6 +175,14 @@ msgstr "%d figyelmeztetés."
msgid "&Open a po-file"
msgstr "PO fájl megnyitása"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Eredeti"

View File

@ -173,6 +173,14 @@ msgstr "Riscontrati %d avvertimenti."
msgid "&Open a po-file"
msgstr "&Aprire un file po"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Originale"

View File

@ -175,6 +175,14 @@ msgstr "%d 個の警告が見つかりました。"
msgid "&Open a po-file"
msgstr "po ファイルを開く(&O)"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "原文"

View File

@ -177,6 +177,14 @@ msgstr "Rasta perspėjimų: %d."
msgid "&Open a po-file"
msgstr "At&verti PO failą"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Originalas"

View File

@ -153,6 +153,14 @@ msgstr ""
msgid "&Open a po-file"
msgstr ""
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr ""

View File

@ -175,6 +175,14 @@ msgstr "Encontrados %d avisos."
msgid "&Open a po-file"
msgstr "&Abrir um arquivo PO"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Original"

View File

@ -174,6 +174,14 @@ msgstr "Найдено предупреждений: %d"
msgid "&Open a po-file"
msgstr "&Открыть файл PO"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Исходная строка"
@ -240,6 +248,12 @@ msgstr "Показать графическую сводку"
#| "%3.1f%% Translated\n"
#| "%3.1f%% UnTranslated\n"
#| "%3.1f%% Fuzzy\n"
#| "%3d Translated (%3.1f%%)\n"
#| "%3d UnTranslated (%3.1f%%)\n"
#| "%3d Fuzzy (%3.1f%%)\n"
#| "%3d Translated (%3.1f%%)\n"
#| "%3d UnTranslated (%3.1f%%)\n"
#| "%3d Fuzzy (%3.1f%%)\n"
msgid ""
"%3d Translated (%3.1f%%)\n"
"%3d UnTranslated (%3.1f%%)\n"

View File

@ -174,6 +174,14 @@ msgstr "Виявлено %d попереджень."
msgid "&Open a po-file"
msgstr "&Відкрити po-файл"
#: pocheckerconsts.sopenfail
msgid "Unable to open file %s"
msgstr ""
#: pocheckerconsts.sopenfile
msgid "Open file %s in Ide Editor?"
msgstr ""
#: pocheckerconsts.soriginal
msgid "Original"
msgstr "Оригінал"

View File

@ -4,6 +4,8 @@ unit pocheckerconsts;
interface
Uses Controls;
resourcestring
//Main form
rsPoChecker = 'PO File Checker';
@ -41,6 +43,8 @@ resourcestring
sStatHint = '%3d Translated (%3.1f%%)' + LineEnding +
'%3d UnTranslated (%3.1f%%)' + LineEnding +
'%3d Fuzzy (%3.1f%%)';
sOpenFile = 'Open file %s in Ide Editor?';
SOpenFail = 'Unable to open file %s';
//PoFamiles
sOriginal = 'Original';
@ -78,6 +82,10 @@ resourcestring
sPercTranslated = '%s: %4.1f%% translated strings.';
sPercUntranslated = '%s: %4.1f%% untranslated strings.';
sPercFuzzy = '%s: %4.1f%% fuzzy strings.';
const
mrOpenEditorFile = mrNone+100;
implementation
end.

View File

@ -378,6 +378,7 @@ var
ErrorCount, WarningCount: integer;
SL: TStrings;
ResultDlg: TResultDlgForm;
mr: TModalResult;
begin
TestTypes := GetTestTypesFromListBox;
if (TestTypes = []) then
@ -389,6 +390,7 @@ begin
NoErrLabel.Visible := False;
Application.ProcessMessages;
SL := TStringList.Create;
mr := mrNone;
try
StatusPanel.Enabled := True;
if (not (ptoFindAllChildren in TestOptions)) and Assigned(PoFamily.Child) and
@ -410,7 +412,7 @@ begin
ResultDlg.PoFamilyStats := PoFamily.PoFamilyStats
else
ResultDlg.PoFamilyStats := nil;
ResultDlg.ShowModal;
mr := ResultDlg.ShowModal;
finally
ResultDlg.Free;
end;
@ -421,6 +423,7 @@ begin
SL.Free;
ClearAndDisableStatusPanel;
end;
if mr = mrOpenEditorFile then WindowState:= wsMinimized;
end;

View File

@ -93,11 +93,14 @@ begin
end;
procedure TResultDlgForm.GraphStatBtnClick(Sender: TObject);
var
mr: TModalResult;
begin
GraphStatForm := TGraphStatForm.Create(nil);
GraphStatForm.PoFamilyStats := Self.PoFamilyStats;
GraphStatForm.ShowModal;
mr := GraphStatForm.ShowModal;
FreeAndNil(GraphStatForm);
if mr = mrOpenEditorFile then ModalResult := mr; // To inform pocheckermain
end;
procedure TResultDlgForm.SaveBtnClick(Sender: TObject);