tvplanit: Add option to select category to ical task import form. Update translations (de, en).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8385 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-08-12 13:47:03 +00:00
parent 6c53ea5417
commit b3d76d7f60
19 changed files with 309 additions and 125 deletions

View File

@ -15,7 +15,6 @@ type
TVpImportPreviewICalEventForm = class(TVpImportPreviewForm)
procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer;
var Value: string);
procedure GridPickListSelect(Sender: TObject);
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer;
const Value: string);
private
@ -65,7 +64,7 @@ begin
exit;
item := TVpICalEntry(FItems[ARow - Grid.FixedRows]);
if item <> nil then
item.Skip := not AChecked;
item.Skip := not AChecked;
end;
function TVpImportPreviewICalEventForm.GetCellText(ACol, ARow: Integer): String;
@ -80,8 +79,6 @@ begin
case ACol of
1: Result := GetEventText(event);
2: Result := Grid.Columns[2].PickList[event.PickedCategory];
//if FDatastore <> nil then
// Result := FDatastore.FindBestEventCategory(TVpICalEvent(item).Categories);
end;
end;
end;
@ -114,15 +111,14 @@ begin
RSEndTimeLbl + ' ' + sEndTime;
Result := Result + LineEnding +
RSDescriptionLbl + ' ' + AEvent.Summary + LineEnding +
RSCategoryLbl + ' ';
RSDescriptionLbl + ' ' + AEvent.Summary;
// Categories
if Assigned(FDatastore) then
begin
cat := AEvent.Categories.Text;
if cat = '' then cat := '(none)';
Result := Result + cat;
cat := AEvent.Categories.CommaText;
if cat = '' then cat := RSNoneStr;
Result := Result + LineEnding + RSCategoryLbl + ' ' + cat;
end;
// Recurrence
@ -186,27 +182,11 @@ procedure TVpImportPreviewICalEventForm.GridGetEditText(Sender: TObject; ACol,
var
event: TVpICalEvent;
begin
DebugLn('GetEditText: "' + Value + '"');
event := TVpICalEvent(FItems[Grid.Row - Grid.FixedRows]);
if event <> nil then
Value := Grid.Columns[2].PickList[event.PickedCategory];
end;
procedure TVpImportPreviewICalEventForm.GridPickListSelect(Sender: TObject);
var
item: TVpICalEntry;
cat: String;
col: TGridcolumn;
begin
item := TVpICalEntry(FItems[Grid.Row - Grid.FixedRows]);
if item <> nil then
begin
col := Grid.Columns[2];
//TVpICalEvent(item).PickedCategory := Grid.Columns[2].PickList.IndexOf(ItemIndex);
end;
end;
procedure TVpImportPreviewICalEventForm.GridSetEditText(Sender: TObject; ACol,
ARow: Integer; const Value: string);
var
@ -215,10 +195,8 @@ begin
event := TVpICalEvent(FItems[Grid.Row - Grid.FixedRows]);
if event <> nil then
event.PickedCategory := Grid.Columns[2].PickList.IndexOf(Value);;
// DebugLn('SetEditText: "' + Value + '"');
end;
function TVpImportPreviewICalEventForm.IsChecked(ARow: Integer): Boolean;
var
item: TVpICalEntry;
@ -248,11 +226,13 @@ begin
if (FCalendar <> nil) and (FDataStore <> nil) and (Grid.Columns.Count = 2) then
begin
Grid.Columns[1].Title.Caption := RSEventItems;
with Grid.Columns.Add do
begin
SizePriority := 0;
Width := 160;
Title.Caption := 'Category to be applied';
Title.Caption := RSAssignedCategory;
ButtonStyle := cbsPickList;
L := TStringList.Create;
try