- Timestamp:
- Feb 15, 2022, 3:46:22 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r108 r115 184 184 Action = Core.ATest 185 185 end 186 object MenuItem11: TMenuItem 187 Action = Core.AViewSource 188 end 186 189 end 187 190 object MenuItemHelp: TMenuItem -
trunk/Forms/UFormMain.pas
r107 r115 18 18 MenuItem1: TMenuItem; 19 19 MenuItem10: TMenuItem; 20 MenuItem11: TMenuItem; 20 21 MenuItem3: TMenuItem; 21 22 MenuItem4: TMenuItem; -
trunk/Languages/vCardStudio.cs.po
r113 r115 42 42 43 43 #: tcore.afilesave.caption 44 msgctxt "tcore.afilesave.caption" 44 45 msgid "Save" 45 46 msgstr "Uložit" … … 85 86 msgstr "Testování" 86 87 88 #: tcore.aviewsource.caption 89 msgid "View source" 90 msgstr "Zobrazit zdroj" 91 87 92 #: tcore.opendialog1.title 88 93 msgctxt "tcore.opendialog1.title" … … 566 571 567 572 #: tformcontacts.acopy.caption 573 msgctxt "tformcontacts.acopy.caption" 568 574 msgid "Copy" 569 575 msgstr "Kopírovat" 570 576 571 577 #: tformcontacts.acut.caption 578 msgctxt "tformcontacts.acut.caption" 572 579 msgid "Cut" 573 580 msgstr "Vyříznout" … … 584 591 585 592 #: tformcontacts.apaste.caption 593 msgctxt "tformcontacts.apaste.caption" 586 594 msgid "Paste" 587 595 msgstr "Vložit" … … 949 957 msgid "DPI:" 950 958 msgstr "DPI:" 959 960 #: tformsource.acopy.caption 961 msgctxt "tformsource.acopy.caption" 962 msgid "Copy" 963 msgstr "Kopírovat" 964 965 #: tformsource.acut.caption 966 msgctxt "tformsource.acut.caption" 967 msgid "Cut" 968 msgstr "Vyříznout" 969 970 #: tformsource.apaste.caption 971 msgctxt "tformsource.apaste.caption" 972 msgid "Paste" 973 msgstr "Vložit" 974 975 #: tformsource.aselectall.caption 976 msgctxt "tformsource.aselectall.caption" 977 msgid "Select all" 978 msgstr "Vybrat vše" 979 980 #: tformsource.buttoncancel.caption 981 msgctxt "tformsource.buttoncancel.caption" 982 msgid "Cancel" 983 msgstr "Zrušit" 984 985 #: tformsource.buttonok.caption 986 msgctxt "tformsource.buttonok.caption" 987 msgid "Save" 988 msgstr "Uložit" 989 990 #: tformsource.caption 991 msgid "Source" 992 msgstr "Zdroj" 951 993 952 994 #: tformtest.arun.caption … … 1478 1520 msgid "Decode error" 1479 1521 msgstr "Chyba dekódování" 1480 -
trunk/Languages/vCardStudio.pot
r110 r115 32 32 33 33 #: tcore.afilesave.caption 34 msgctxt "tcore.afilesave.caption" 34 35 msgid "Save" 35 36 msgstr "" … … 75 76 msgstr "" 76 77 78 #: tcore.aviewsource.caption 79 msgid "View source" 80 msgstr "" 81 77 82 #: tcore.opendialog1.title 78 83 msgctxt "tcore.opendialog1.title" … … 556 561 557 562 #: tformcontacts.acopy.caption 563 msgctxt "tformcontacts.acopy.caption" 558 564 msgid "Copy" 559 565 msgstr "" 560 566 561 567 #: tformcontacts.acut.caption 568 msgctxt "tformcontacts.acut.caption" 562 569 msgid "Cut" 563 570 msgstr "" … … 573 580 574 581 #: tformcontacts.apaste.caption 582 msgctxt "tformcontacts.apaste.caption" 575 583 msgid "Paste" 576 584 msgstr "" … … 924 932 msgstr "" 925 933 934 #: tformsource.acopy.caption 935 msgctxt "tformsource.acopy.caption" 936 msgid "Copy" 937 msgstr "" 938 939 #: tformsource.acut.caption 940 msgctxt "tformsource.acut.caption" 941 msgid "Cut" 942 msgstr "" 943 944 #: tformsource.apaste.caption 945 msgctxt "tformsource.apaste.caption" 946 msgid "Paste" 947 msgstr "" 948 949 #: tformsource.aselectall.caption 950 msgctxt "tformsource.aselectall.caption" 951 msgid "Select all" 952 msgstr "" 953 954 #: tformsource.buttoncancel.caption 955 msgctxt "tformsource.buttoncancel.caption" 956 msgid "Cancel" 957 msgstr "" 958 959 #: tformsource.buttonok.caption 960 msgctxt "tformsource.buttonok.caption" 961 msgid "Save" 962 msgstr "" 963 964 #: tformsource.caption 965 msgid "Source" 966 msgstr "" 967 926 968 #: tformtest.arun.caption 927 969 msgctxt "tformtest.arun.caption" -
trunk/Packages/Common/UTheme.pas
r69 r115 41 41 property Theme: TTheme read FTheme write SetTheme; 42 42 end; 43 44 const 45 ThemeNameSystem = 'System'; 46 ThemeNameLight = 'Light'; 47 ThemeNameDark = 'Dark'; 43 48 44 49 procedure Register; … … 105 110 inherited; 106 111 Themes := TThemes.Create; 107 with Themes.AddNew( 'System') do begin112 with Themes.AddNew(ThemeNameSystem) do begin 108 113 ColorWindow := clWindow; 109 114 ColorWindowText := clWindowText; … … 113 118 end; 114 119 Theme := TTheme(Themes.First); 115 with Themes.AddNew( 'Dark') do begin120 with Themes.AddNew(ThemeNameDark) do begin 116 121 ColorWindow := RGBToColor($20, $20, $20); 117 122 ColorWindowText := clWhite; … … 120 125 ColorControlSelected := RGBToColor(96, 125, 155); 121 126 end; 122 with Themes.AddNew( 'Light') do begin127 with Themes.AddNew(ThemeNameLight) do begin 123 128 ColorWindow := clWhite; 124 129 ColorWindowText := clBlack; … … 175 180 procedure TThemeManager.UseTheme(Form: TForm); 176 181 begin 177 if not Used and (FTheme.Name = 'System') then Exit;182 if not Used and (FTheme.Name = ThemeNameSystem) then Exit; 178 183 ApplyTheme(Form); 179 184 Used := True; -
trunk/UContact.pas
r112 r115 158 158 FOnModify: TNotifyEvent; 159 159 class var FFields: TContactFields; 160 procedure DoOnModify; 161 procedure DetectMaxLineLength(Text: string); 160 162 function GetField(Index: TContactFieldIndex): string; 163 function GetString: string; 161 164 procedure SetField(Index: TContactFieldIndex; AValue: string); 162 165 procedure SetModified(AValue: Boolean); 163 procedure DoOnModify; 164 procedure DetectMaxLineLength(Text: string); 166 procedure SetString(AValue: string); 165 167 public 166 168 Properties: TContactProperties; … … 182 184 property Fields[Index: TContactFieldIndex]: string read GetField write SetField; 183 185 property Modified: Boolean read FModified write SetModified; 186 property AsString: string read GetString write SetString; 187 published 184 188 property OnModify: TNotifyEvent read FOnModify write FOnModify; 185 189 end; … … 209 213 FOnError: TErrorEvent; 210 214 procedure Error(Text: string; Line: Integer); 215 function GetString: string; 211 216 function NewItem(Key, Value: string): string; 217 procedure SetString(AValue: string); 212 218 public 213 219 Contacts: TContacts; … … 221 227 constructor Create; override; 222 228 destructor Destroy; override; 229 property AsString: string read GetString write SetString; 223 230 published 224 231 property OnError: TErrorEvent read FOnError write FOnError; … … 1358 1365 end; 1359 1366 1367 function TContact.GetString: string; 1368 var 1369 Lines: TStringList; 1370 begin 1371 Lines := TStringList.Create; 1372 try 1373 SaveToStrings(Lines); 1374 Result := Lines.Text; 1375 finally 1376 Lines.Free; 1377 end; 1378 end; 1379 1360 1380 procedure TContact.SetField(Index: TContactFieldIndex; AValue: string); 1361 1381 var … … 1419 1439 end; 1420 1440 1441 procedure TContact.SetString(AValue: string); 1442 var 1443 Lines: TStringList; 1444 StartLine: Integer; 1445 begin 1446 Lines := TStringList.Create; 1447 try 1448 Lines.Text := AValue; 1449 StartLine := 0; 1450 LoadFromStrings(Lines, StartLine); 1451 finally 1452 Lines.Free; 1453 end; 1454 end; 1455 1421 1456 function TContact.HasField(FieldIndex: TContactFieldIndex): Boolean; 1422 1457 var … … 1515 1550 CutLength: Integer; 1516 1551 begin 1517 with Output do begin 1518 Add(VCardBegin); 1519 for I := 0 to Properties.Count - 1 do 1520 with Properties[I] do begin 1521 NameText := Name; 1522 if Attributes.Count > 0 then 1523 NameText := NameText + ';' + Attributes.DelimitedText; 1524 if Encoding <> '' then begin 1525 Value2 := GetEncodedValue; 1526 NameText := NameText + ';ENCODING=' + Encoding; 1527 end else Value2 := Value; 1528 if Pos(LineEnding, Value2) > 0 then begin 1529 Add(NameText + ':' + GetNext(Value2, LineEnding)); 1530 while Pos(LineEnding, Value2) > 0 do begin 1531 Add(' ' + GetNext(Value2, LineEnding)); 1532 end; 1552 with Output do begin 1553 Add(VCardBegin); 1554 for I := 0 to Properties.Count - 1 do 1555 with Properties[I] do begin 1556 NameText := Name; 1557 if Attributes.Count > 0 then 1558 NameText := NameText + ';' + Attributes.DelimitedText; 1559 if Encoding <> '' then begin 1560 Value2 := GetEncodedValue; 1561 NameText := NameText + ';ENCODING=' + Encoding; 1562 end else Value2 := Value; 1563 if Pos(LineEnding, Value2) > 0 then begin 1564 Add(NameText + ':' + GetNext(Value2, LineEnding)); 1565 while Pos(LineEnding, Value2) > 0 do begin 1533 1566 Add(' ' + GetNext(Value2, LineEnding)); 1534 Add(''); 1535 end else begin 1536 OutText := NameText + ':' + Value2; 1537 LineIndex := 0; 1538 LinePrefix := ''; 1539 while True do begin 1540 if UTF8Length(OutText) > ContactsFile.MaxLineLength then begin 1541 CutLength := ContactsFile.MaxLineLength; 1542 if Encoding = VCardQuotedPrintable then begin 1543 Dec(CutLength); // There will be softline break at the end 1544 // Do not cut encoded items at the end of line 1545 if ((CutLength - 1) >= 1) and (OutText[CutLength - 1] = QuotedPrintableEscapeCharacter) then 1546 Dec(CutLength, 2) 1547 else if OutText[CutLength] = QuotedPrintableEscapeCharacter then 1548 Dec(CutLength, 1); 1549 end; 1550 1551 CutText := UTF8Copy(OutText, 1, CutLength); 1552 System.Delete(OutText, 1, Length(CutText)); 1553 if Encoding = VCardQuotedPrintable then 1554 CutText := CutText + QuotedPrintableEscapeCharacter; // Add soft line break 1555 Add(LinePrefix + CutText); 1556 if Encoding <> VCardQuotedPrintable then 1557 LinePrefix := ' '; 1558 Inc(LineIndex); 1559 Continue; 1560 end else begin 1561 Add(LinePrefix + OutText); 1562 Break; 1567 end; 1568 Add(' ' + GetNext(Value2, LineEnding)); 1569 Add(''); 1570 end else begin 1571 OutText := NameText + ':' + Value2; 1572 LineIndex := 0; 1573 LinePrefix := ''; 1574 while True do begin 1575 if UTF8Length(OutText) > ContactsFile.MaxLineLength then begin 1576 CutLength := ContactsFile.MaxLineLength; 1577 if Encoding = VCardQuotedPrintable then begin 1578 Dec(CutLength); // There will be softline break at the end 1579 // Do not cut encoded items at the end of line 1580 if ((CutLength - 1) >= 1) and (OutText[CutLength - 1] = QuotedPrintableEscapeCharacter) then 1581 Dec(CutLength, 2) 1582 else if OutText[CutLength] = QuotedPrintableEscapeCharacter then 1583 Dec(CutLength, 1); 1563 1584 end; 1585 1586 CutText := UTF8Copy(OutText, 1, CutLength); 1587 System.Delete(OutText, 1, Length(CutText)); 1588 if Encoding = VCardQuotedPrintable then 1589 CutText := CutText + QuotedPrintableEscapeCharacter; // Add soft line break 1590 Add(LinePrefix + CutText); 1591 if Encoding <> VCardQuotedPrintable then 1592 LinePrefix := ' '; 1593 Inc(LineIndex); 1594 Continue; 1595 end else begin 1596 Add(LinePrefix + OutText); 1597 Break; 1564 1598 end; 1565 1599 end; 1566 1600 end; 1567 Add(VCardEnd); 1568 end; 1601 end; 1602 Add(VCardEnd); 1603 end; 1569 1604 end; 1570 1605 … … 1695 1730 end; 1696 1731 1732 function TContactsFile.GetString: string; 1733 var 1734 I: Integer; 1735 begin 1736 Result := ''; 1737 for I := 0 to Contacts.Count - 1 do 1738 Result := Result + Contacts[I].AsString; 1739 end; 1740 1697 1741 function TContactsFile.GetFileName: string; 1698 1742 begin … … 1748 1792 end; 1749 1793 1794 procedure TContactsFile.SetString(AValue: string); 1795 var 1796 Lines: TStringList; 1797 begin 1798 Lines := TStringList.Create; 1799 try 1800 Lines.Text := AValue; 1801 LoadFromStrings(Lines); 1802 Modified := True; 1803 finally 1804 Lines.Free; 1805 end; 1806 end; 1807 1750 1808 procedure TContactsFile.SaveToFile(FileName: string); 1751 1809 var -
trunk/UCore.lfm
r113 r115 3 3 OnDestroy = DataModuleDestroy 4 4 OldCreateOrder = False 5 Height = 5 296 HorizontalOffset = 6 697 VerticalOffset = 6 078 Width = 7 269 PPI = 1 445 Height = 551 6 HorizontalOffset = 697 7 VerticalOffset = 632 8 Width = 756 9 PPI = 150 10 10 object ImageList1: TImageList 11 Left = 1 1512 Top = 20 011 Left = 120 12 Top = 208 13 13 Bitmap = { 14 14 4C7A120000001000000010000000801200000000000078DADD9A095855D5DAC7 … … 165 165 object ActionList1: TActionList 166 166 Images = ImageList1 167 Left = 384168 Top = 20 0167 Left = 400 168 Top = 208 169 169 object AExit: TAction 170 170 Caption = 'Exit' … … 224 224 ImageIndex = 8 225 225 OnExecute = ASettingsExecute 226 ShortCut = 121 226 227 end 227 228 object AFileCombine: TAction … … 238 239 Caption = 'Generate contacts' 239 240 OnExecute = AGenerateExecute 241 ShortCut = 116 240 242 end 241 243 object AFileSplit: TAction … … 253 255 Caption = 'Test' 254 256 OnExecute = ATestExecute 257 ShortCut = 115 258 end 259 object AViewSource: TAction 260 Caption = 'View source' 261 OnExecute = AViewSourceExecute 262 ShortCut = 114 255 263 end 256 264 end … … 258 266 MaxCount = 10 259 267 OnChange = LastOpenedList1Change 260 Left = 384261 Top = 288268 Left = 400 269 Top = 300 262 270 end 263 271 object OpenDialog1: TOpenDialog 264 272 Title = 'Open existing file' 265 Left = 384266 Top = 3 65273 Left = 400 274 Top = 380 267 275 end 268 276 object SaveDialog1: TSaveDialog 269 277 Title = 'Save file as' 270 Left = 1 15271 Top = 3 65278 Left = 120 279 Top = 380 272 280 end 273 281 object ApplicationInfo1: TApplicationInfo … … 8482 8490 0000000000000000000000000000000000000000000000000000 8483 8491 } 8484 Left = 1 158485 Top = 2888492 Left = 120 8493 Top = 300 8486 8494 end 8487 8495 object PersistentForm1: TPersistentForm 8488 8496 MinVisiblePart = 50 8489 8497 EntireVisible = False 8490 Left = 3848491 Top = 1 258498 Left = 400 8499 Top = 130 8492 8500 end 8493 8501 object Translator: TTranslator 8494 8502 POFilesFolder = 'Languages' 8495 Left = 1 158496 Top = 488503 Left = 120 8504 Top = 50 8497 8505 end 8498 8506 object ScaleDPI1: TScaleDPI 8499 8507 AutoDetect = False 8500 Left = 3848501 Top = 488508 Left = 400 8509 Top = 50 8502 8510 end 8503 8511 object ThemeManager1: TThemeManager 8504 Left = 1 158505 Top = 1 258512 Left = 120 8513 Top = 130 8506 8514 end 8507 8515 object AboutDialog1: TAboutDialog … … 8509 8517 ThemeManager = ThemeManager1 8510 8518 ApplicationInfo = ApplicationInfo1 8511 Left = 5768512 Top = 488519 Left = 600 8520 Top = 50 8513 8521 end 8514 8522 object SelectDirectoryDialog1: TSelectDirectoryDialog 8515 8523 Title = 'Select directory' 8516 Left = 5788517 Top = 3 768524 Left = 602 8525 Top = 392 8518 8526 end 8519 8527 end -
trunk/UCore.lrj
r113 r115 16 16 {"hash":218394958,"name":"tcore.afind.caption","sourcebytes":[70,105,110,100,46,46,46],"value":"Find..."}, 17 17 {"hash":371876,"name":"tcore.atest.caption","sourcebytes":[84,101,115,116],"value":"Test"}, 18 {"hash":131740677,"name":"tcore.aviewsource.caption","sourcebytes":[86,105,101,119,32,115,111,117,114,99,101],"value":"View source"}, 18 19 {"hash":218146437,"name":"tcore.opendialog1.title","sourcebytes":[79,112,101,110,32,101,120,105,115,116,105,110,103,32,102,105,108,101],"value":"Open existing file"}, 19 20 {"hash":159035875,"name":"tcore.savedialog1.title","sourcebytes":[83,97,118,101,32,102,105,108,101,32,97,115],"value":"Save file as"}, -
trunk/UCore.pas
r103 r115 17 17 AAbout: TAction; 18 18 AboutDialog1: TAboutDialog; 19 AViewSource: TAction; 19 20 ATest: TAction; 20 21 AFind: TAction; … … 59 60 procedure ASettingsExecute(Sender: TObject); 60 61 procedure ATestExecute(Sender: TObject); 62 procedure AViewSourceExecute(Sender: TObject); 61 63 procedure DataModuleCreate(Sender: TObject); 62 64 procedure DataModuleDestroy(Sender: TObject); … … 106 108 uses 107 109 UFormMain, UFormSettings, UContact, UFormContacts, UFormFindDuplicity, 108 UFormGenerate, UFormError, UFormFind, UFormTest ;110 UFormGenerate, UFormError, UFormFind, UFormTest, UFormSource; 109 111 110 112 resourcestring … … 274 276 try 275 277 ShowModal; 278 finally 279 Free; 280 end; 281 end; 282 283 procedure TCore.AViewSourceExecute(Sender: TObject); 284 begin 285 with TFormSource.Create(nil) do 286 try 287 Source := TContactsFile(DataFile).AsString; 288 if ShowModal = mrOk then begin 289 TContactsFile(DataFile).AsString := Source; 290 UpdateFile; 291 end; 276 292 finally 277 293 Free; -
trunk/vCardStudio.lpi
r112 r115 95 95 </Modes> 96 96 </RunParams> 97 <RequiredPackages Count=" 2">97 <RequiredPackages Count="3"> 98 98 <Item1> 99 <PackageName Value="SynEdit"/> 100 </Item1> 101 <Item2> 99 102 <PackageName Value="Common"/> 100 103 <DefaultFilename Value="Packages\Common\Common.lpk" Prefer="True"/> 101 </Item 1>102 <Item 2>104 </Item2> 105 <Item3> 103 106 <PackageName Value="LCL"/> 104 </Item 2>107 </Item3> 105 108 </RequiredPackages> 106 <Units Count="2 1">109 <Units Count="23"> 107 110 <Unit0> 108 111 <Filename Value="vCardStudio.lpr"/> … … 234 237 <ResourceBaseClass Value="Form"/> 235 238 </Unit20> 239 <Unit21> 240 <Filename Value="Forms\UFormSource.pas"/> 241 <IsPartOfProject Value="True"/> 242 <ComponentName Value="FormSource"/> 243 <HasResources Value="True"/> 244 <ResourceBaseClass Value="Form"/> 245 </Unit21> 246 <Unit22> 247 <Filename Value="UVCardHighlighter.pas"/> 248 <IsPartOfProject Value="True"/> 249 </Unit22> 236 250 </Units> 237 251 </ProjectOptions> -
trunk/vCardStudio.lpr
r110 r115 8 8 {$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UCore, Common, SysUtils, UFormImage, UContactImage, 11 UFormNameDetails; 10 Forms, UFormMain, UCore, Common, SysUtils; 12 11 13 12 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.