From 852270b0c20cd01588a22300458c12505dc3ef4d Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 24 Jun 2016 22:34:38 +0000 Subject: [PATCH] tvplanit: Fix missing popup translation of task list and contact grid. Fix demo changing view when language is changed. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4832 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/examples/demo/demomain.lfm | 2 +- components/tvplanit/examples/demo/demomain.lrt | 2 +- components/tvplanit/examples/demo/demomain.pas | 9 ++++----- components/tvplanit/languages/demo.de.po | 4 +++- components/tvplanit/languages/demo.po | 2 +- components/tvplanit/source/vpcontactgrid.pas | 7 +++++++ components/tvplanit/source/vptasklist.pas | 7 +++++++ 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/components/tvplanit/examples/demo/demomain.lfm b/components/tvplanit/examples/demo/demomain.lfm index 5e745695c..763792bcc 100644 --- a/components/tvplanit/examples/demo/demomain.lfm +++ b/components/tvplanit/examples/demo/demomain.lfm @@ -335,7 +335,7 @@ object MainForm: TMainForm end end object TabResources: TTabSheet - Caption = 'Maintenance' + Caption = 'Resources' ClientHeight = 504 ClientWidth = 772 TabVisible = False diff --git a/components/tvplanit/examples/demo/demomain.lrt b/components/tvplanit/examples/demo/demomain.lrt index c866c4574..c46d2ba82 100644 --- a/components/tvplanit/examples/demo/demomain.lrt +++ b/components/tvplanit/examples/demo/demomain.lrt @@ -7,7 +7,7 @@ TMAINFORM.TABTASKS.CAPTION=Tasks TMAINFORM.RBALLTASKS.CAPTION=All tasks TMAINFORM.RBHIDECOMPLETEDTASKS.CAPTION=Hide completed tasks TMAINFORM.TABCONTACTS.CAPTION=Contacts -TMAINFORM.TABRESOURCES.CAPTION=Maintenance +TMAINFORM.TABRESOURCES.CAPTION=Resources TMAINFORM.BTNNEWRES.CAPTION=New TMAINFORM.BTNEDITRES.CAPTION=Edit TMAINFORM.BTNDELETERES.CAPTION=Delete diff --git a/components/tvplanit/examples/demo/demomain.pas b/components/tvplanit/examples/demo/demomain.pas index 0afbf026c..7a943b01b 100644 --- a/components/tvplanit/examples/demo/demomain.pas +++ b/components/tvplanit/examples/demo/demomain.pas @@ -558,6 +558,8 @@ begin VpDayView1.LoadLanguage; VpWeekView1.LoadLanguage; VpMonthView1.LoadLanguage; + VpTaskList1.LoadLanguage; + VpContactGrid1.LoadLanguage; // Select language in language combobox. if ALang = '' then ALang := 'en'; @@ -639,7 +641,7 @@ begin VpWeekView1.WeekStartsOn := firstWeekDay; {$ENDIF} - SetActiveView(FActiveView); + SetActiveView(1001); Invalidate; end; @@ -672,7 +674,6 @@ begin VpMonthView1.Align := alClient; VpMonthView1.Show; DaySelectorPanel.Hide; - TitleLbl.Caption := RSEventsPerMonth; ImageList1.GetBitmap(5, Img.Picture.Bitmap); end; @@ -686,7 +687,6 @@ begin VpDayView1.Hide; VpWeekView1.Show; DaySelectorPanel.Hide; - TitleLbl.Caption := RSEventsPerWeek; ImageList1.GetBitmap(4, Img.Picture.Bitmap); end; @@ -704,7 +704,6 @@ begin DaySelectorPanel.Show; DaysTrackbar.Position := FVisibleDays; VpDayView1.NumDays := DaysTrackBar.Position; - TitleLbl.Caption := RSEventsPerDay; ImageList1.GetBitmap(3, Img.Picture.Bitmap); end; @@ -770,7 +769,7 @@ begin 0: ShowResources; 1: ShowSettings; end; - end; + end; end; end. diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index cd452a3d6..d768cb9cd 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -227,8 +227,10 @@ msgid "Events" msgstr "Termine" #: tmainform.tabresources.caption +#, fuzzy +#| msgid "Maintenance" msgctxt "tmainform.tabresources.caption" -msgid "Maintenance" +msgid "Resources" msgstr "Wartung" #: tmainform.tabsettings.caption diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index 1811ea273..351c39fbe 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -217,7 +217,7 @@ msgstr "" #: tmainform.tabresources.caption msgctxt "TMAINFORM.TABRESOURCES.CAPTION" -msgid "Maintenance" +msgid "Resources" msgstr "" #: tmainform.tabsettings.caption diff --git a/components/tvplanit/source/vpcontactgrid.pas b/components/tvplanit/source/vpcontactgrid.pas index 24524b6f0..3b2a71d03 100644 --- a/components/tvplanit/source/vpcontactgrid.pas +++ b/components/tvplanit/source/vpcontactgrid.pas @@ -213,6 +213,7 @@ type public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + procedure LoadLanguage; procedure LinkHandler(Sender: TComponent; NotificationType: TVpNotificationType; const Value: Variant); override; function GetControlType : TVpItemType; override; @@ -478,6 +479,12 @@ begin end; {=====} +procedure TVpContactGrid.LoadLanguage; +begin + FDefaultPopup.Items.Clear; + InitializeDefaultPopup; +end; + procedure TVpContactGrid.LinkHandler(Sender: TComponent; NotificationType: TVpNotificationType; const Value: Variant); begin diff --git a/components/tvplanit/source/vptasklist.pas b/components/tvplanit/source/vptasklist.pas index d2283293c..6b93c1888 100644 --- a/components/tvplanit/source/vptasklist.pas +++ b/components/tvplanit/source/vptasklist.pas @@ -224,6 +224,7 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure DeleteActiveTask(Verify: Boolean); + procedure LoadLanguage; procedure LinkHandler(Sender: TComponent; NotificationType: TVpNotificationType; const Value: Variant); override; @@ -593,6 +594,12 @@ begin end; {=====} +procedure TVpTaskList.LoadLanguage; +begin + FDefaultPopup.Items.Clear; + InitializeDefaultPopup; +end; + procedure TVpTaskList.LinkHandler(Sender: TComponent; NotificationType: TVpNotificationType; const Value: Variant); begin