Changeset 3
- Timestamp:
- Jan 29, 2018, 10:54:40 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 5 5 *.lps 6 6 *.res 7 vCardStudio.exe
-
- Property svn:ignore
-
trunk/Forms/UFormContact.lfm
r2 r3 1 1 object FormContact: TFormContact 2 Left = 5952 Left = 423 3 3 Height = 490 4 Top = 5414 Top = 271 5 5 Width = 762 6 6 Caption = 'Contact' 7 7 ClientHeight = 490 8 8 ClientWidth = 762 9 LCLVersion = '1.8.0.4' 9 DesignTimePPI = 120 10 LCLVersion = '1.8.0.6' 10 11 object PageControlContact: TPageControl 11 12 Left = 8 … … 19 20 object TabSheetGeneral: TTabSheet 20 21 Caption = 'General' 21 ClientHeight = 3 8022 ClientWidth = 73 822 ClientHeight = 391 23 ClientWidth = 736 23 24 object Label1: TLabel 24 25 Left = 13 25 Height = 2 626 Height = 20 26 27 Top = 13 27 Width = 5628 Width = 43 28 29 Caption = 'Name:' 29 30 ParentColor = False … … 31 32 object EditName: TEdit 32 33 Left = 100 33 Height = 3634 Height = 28 34 35 Top = 15 35 36 Width = 212 36 37 TabOrder = 0 38 end 39 object Label2: TLabel 40 Left = 13 41 Height = 20 42 Top = 47 43 Width = 74 44 Caption = 'Cell phone:' 45 ParentColor = False 46 end 47 object EditCellPhone: TEdit 48 Left = 100 49 Height = 28 50 Top = 49 51 Width = 212 52 TabOrder = 1 53 end 54 object EditPhone: TEdit 55 Left = 100 56 Height = 28 57 Top = 83 58 Width = 212 59 TabOrder = 2 60 end 61 object Label3: TLabel 62 Left = 13 63 Height = 20 64 Top = 81 65 Width = 44 66 Caption = 'Phone:' 67 ParentColor = False 68 end 69 object EditEmail: TEdit 70 Left = 479 71 Height = 28 72 Top = 49 73 Width = 212 74 TabOrder = 3 75 end 76 object Label4: TLabel 77 Left = 392 78 Height = 20 79 Top = 47 80 Width = 46 81 Caption = 'E-mail:' 82 ParentColor = False 83 end 84 object EditSurname: TEdit 85 Left = 479 86 Height = 28 87 Top = 15 88 Width = 212 89 TabOrder = 4 90 end 91 object Label5: TLabel 92 Left = 392 93 Height = 20 94 Top = 13 95 Width = 61 96 Caption = 'Surname:' 97 ParentColor = False 98 end 99 object MemoNotes: TMemo 100 Left = 13 101 Height = 225 102 Top = 152 103 Width = 708 104 Anchors = [akTop, akLeft, akRight, akBottom] 105 TabOrder = 5 106 end 107 object Label6: TLabel 108 Left = 12 109 Height = 20 110 Top = 126 111 Width = 42 112 Caption = 'Notes:' 113 ParentColor = False 37 114 end 38 115 end … … 42 119 object TabSheetAll: TTabSheet 43 120 Caption = 'All fields' 121 ClientHeight = 391 122 ClientWidth = 736 123 object ListView1: TListView 124 Left = 8 125 Height = 344 126 Top = 16 127 Width = 721 128 Anchors = [akTop, akLeft, akRight, akBottom] 129 Columns = < 130 item 131 Caption = 'Item' 132 Width = 200 133 end 134 item 135 Caption = 'Value' 136 Width = 200 137 end> 138 ReadOnly = True 139 RowSelect = True 140 TabOrder = 0 141 ViewStyle = vsReport 142 end 44 143 end 45 144 end -
trunk/Forms/UFormContact.pas
r2 r3 16 16 ButtonCancel: TButton; 17 17 ButtonOk: TButton; 18 EditSurname: TEdit; 19 EditEmail: TEdit; 20 EditPhone: TEdit; 18 21 EditName: TEdit; 22 EditCellPhone: TEdit; 19 23 Label1: TLabel; 24 Label2: TLabel; 25 Label3: TLabel; 26 Label4: TLabel; 27 Label5: TLabel; 28 Label6: TLabel; 29 ListView1: TListView; 30 MemoNotes: TMemo; 20 31 PageControlContact: TPageControl; 21 32 TabSheetGeneral: TTabSheet; … … 41 52 begin 42 53 EditName.Text := Contact.FirstName; 54 EditSurname.Text := Contact.LastName; 55 EditCellPhone.Text := Contact.TelCell; 56 EditPhone.Text := Contact.TelHome; 57 EditEmail.Text := Contact.EmailHome; 58 MemoNotes.Lines.Text := Contact.Note; 43 59 end; 44 60 … … 46 62 begin 47 63 Contact.FirstName := EditName.Text; 64 Contact.LastName := EditSurname.Text; 65 Contact.TelCell := EditCellPhone.Text; 66 Contact.TelHome := EditPhone.Text; 67 Contact.EmailHome := EditEmail.Text; 68 Contact.Note := MemoNotes.Lines.Text; 48 69 end; 49 70 -
trunk/Forms/UFormContacts.lfm
r2 r3 7 7 ClientHeight = 605 8 8 ClientWidth = 807 9 DesignTimePPI = 120 9 10 OnClose = FormClose 11 OnCreate = FormCreate 10 12 OnShow = FormShow 11 LCLVersion = '1.8.0. 4'13 LCLVersion = '1.8.0.6' 12 14 object ListView1: TListView 13 15 Left = 0 … … 18 20 Columns = < 19 21 item 20 Caption = 'Name' 21 Width = 787 22 Caption = 'First name' 23 Width = 100 24 end 25 item 26 Caption = 'Middle name' 27 Width = 100 28 end 29 item 30 Caption = 'Last Name' 31 Width = 100 22 32 end> 23 33 OwnerData = True -
trunk/Forms/UFormContacts.pas
r2 r3 31 31 procedure ARemoveExecute(Sender: TObject); 32 32 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 33 procedure FormCreate(Sender: TObject); 33 34 procedure FormShow(Sender: TObject); 34 35 procedure ListView1Data(Sender: TObject; Item: TListItem); … … 37 38 Selected: Boolean); 38 39 private 40 FContacts: TContacts; 41 procedure SetContacts(AValue: TContacts); 39 42 40 43 public 41 Contacts: TContacts;44 property Contacts: TContacts read FContacts write SetContacts; 42 45 procedure ReloadList; 43 46 procedure UpdateInterface; … … 55 58 UFormContact, UCore; 56 59 60 resourcestring 61 SRemoveContacts = 'Remove contacts'; 62 SRemoveContactsQuery = 'Do you want to remove selected contacts?'; 63 57 64 { TFormContacts } 58 65 … … 61 68 if Assigned(Contacts) and (Item.Index < Contacts.Count) then 62 69 with TContact(Contacts[Item.Index]) do begin 63 Item.Caption := FullName; 70 Item.Caption := FirstName; 71 Item.SubItems.Add(MiddleName); 72 Item.SubItems.Add(LastName); 64 73 Item.Data := Contacts[Item.Index]; 65 74 end; … … 77 86 end; 78 87 88 procedure TFormContacts.SetContacts(AValue: TContacts); 89 begin 90 if FContacts = AValue then Exit; 91 FContacts := AValue; 92 ReloadList; 93 UpdateInterface; 94 end; 95 79 96 procedure TFormContacts.FormShow(Sender: TObject); 80 97 begin … … 87 104 var 88 105 FormContact: TFormContact; 106 Contact: TContact; 89 107 begin 90 108 FormContact := TFormContact.Create(nil); 109 try 91 110 if FormContact.ShowModal = mrOK then begin 92 FormContact.SaveData(TContact(ListView1.Selected.Data)); 111 Contact := TContact.Create; 112 FormContact.SaveData(Contact); 113 Contacts.Add(Contact); 114 Core.DataFile.Modified := True; 93 115 ReloadList; 94 116 UpdateInterface; 95 117 end; 96 FormContact.Free; 118 finally 119 FormContact.Free; 120 end; 97 121 end; 98 122 … … 102 126 begin 103 127 FormContact := TFormContact.Create(nil); 104 FormContact.LoadData(TContact(ListView1.Selected.Data)); 105 if FormContact.ShowModal = mrOK then begin 106 FormContact.SaveData(TContact(ListView1.Selected.Data)); 107 ReloadList; 108 UpdateInterface; 128 try 129 FormContact.LoadData(TContact(ListView1.Selected.Data)); 130 if FormContact.ShowModal = mrOK then begin 131 FormContact.SaveData(TContact(ListView1.Selected.Data)); 132 Core.DataFile.Modified := True; 133 ReloadList; 134 UpdateInterface; 135 end; 136 finally 137 FormContact.Free; 109 138 end; 110 FormContact.Free;111 139 end; 112 140 … … 115 143 I: Integer; 116 144 begin 117 for I := ListView1.Items.Count - 1 downto 0 do 118 if ListView1.Items[I].Selected then begin 119 Contacts.Delete(I); 120 end; 121 UpdateInterface; 145 if Assigned(ListView1.Selected) then 146 if MessageDlg(SRemoveContacts, SRemoveContactsQuery, 147 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 148 for I := ListView1.Items.Count - 1 downto 0 do 149 if ListView1.Items[I].Selected then begin 150 Contacts.Delete(I); 151 end; 152 Core.DataFile.Modified := True; 153 ReloadList; 154 UpdateInterface; 155 end; 122 156 end; 123 157 … … 126 160 begin 127 161 Core.PersistentForm1.Save(Self); 162 end; 163 164 procedure TFormContacts.FormCreate(Sender: TObject); 165 begin 166 FContacts := nil; 128 167 end; 129 168 … … 138 177 procedure TFormContacts.UpdateInterface; 139 178 begin 140 AModify.Enabled := Assigned(ListView1.Selected); 141 ARemove.Enabled := Assigned(ListView1.Selected); 179 AAdd.Enabled := Assigned(Contacts); 180 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 181 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 142 182 end; 143 183 -
trunk/Install/win
-
Property svn:ignore
set to
*.exe
-
Property svn:ignore
set to
-
trunk/Install/win/build.bat
r1 r3 2 2 set LAZDIR=C:\lazarus 3 3 ) 4 SET APPNAME= FileMenuProject4 SET APPNAME=vCardStudio 5 5 %LAZDIR%\lazbuild.exe --lazarusdir=%LAZDIR% --build-mode="Release" --cpu=i386 --operating-system=Win32 ..\..\%APPNAME%.lpi 6 6 copy ..\..\%APPNAME%.exe ..\..\lib\i386-win32-Release … … 8 8 copy ..\..\%APPNAME%.exe ..\..\lib\x86_64-win64-Release 9 9 10 "c:\Program Files (x86)\Inno Setup 5\ISCC.exe" " %APPNAME%.iss"10 "c:\Program Files (x86)\Inno Setup 5\ISCC.exe" "vCard Studio.iss" 11 11 -
trunk/Languages/vCardStudio.po
r2 r3 61 61 msgstr "" 62 62 63 #: tformcontact.label2.caption 64 msgid "Cell phone:" 65 msgstr "" 66 67 #: tformcontact.label3.caption 68 msgid "Phone:" 69 msgstr "" 70 71 #: tformcontact.label4.caption 72 msgid "E-mail:" 73 msgstr "" 74 75 #: tformcontact.label5.caption 76 msgid "Surname:" 77 msgstr "" 78 79 #: tformcontact.label6.caption 80 msgid "Notes:" 81 msgstr "" 82 83 #: tformcontact.listview1.columns[0].caption 84 msgid "Item" 85 msgstr "" 86 87 #: tformcontact.listview1.columns[1].caption 88 msgid "Value" 89 msgstr "" 90 63 91 #: tformcontact.tabsheetall.caption 64 92 msgid "All fields" … … 90 118 91 119 #: tformcontacts.listview1.columns[0].caption 92 msgid "Name" 120 msgid "First name" 121 msgstr "" 122 123 #: tformcontacts.listview1.columns[1].caption 124 msgid "Middle name" 125 msgstr "" 126 127 #: tformcontacts.listview1.columns[2].caption 128 msgid "Last Name" 93 129 msgstr "" 94 130 … … 157 193 msgstr "" 158 194 195 #: ucontact.sunknowncommand 196 msgid "Unknown command: %s" 197 msgstr "" 198 159 199 #: ucontact.svcardfile 160 200 msgctxt "ucontact.svcardfile" … … 191 231 msgstr "" 192 232 233 #: uformcontacts.sremovecontacts 234 msgid "Remove contacts" 235 msgstr "" 236 237 #: uformcontacts.sremovecontactsquery 238 msgid "Do you want to remove selected contacts?" 239 msgstr "" 240 193 241 #: uformmain.smodified 194 242 msgid "Modified" -
trunk/UContact.pas
r1 r3 57 57 function GetNext(var Text: string; Separator: string): string; 58 58 public 59 Records: TContacts;59 Contacts: TContacts; 60 60 function GetFileName: string; override; 61 61 function GetFileExt: string; override; … … 73 73 resourcestring 74 74 SVCardFile = 'vCard file'; 75 SUnknownCommand = 'Unknown command: %s'; 75 76 76 77 { TContactsFile } … … 110 111 try 111 112 Output := TStringList.Create; 112 for I := 0 to Records.Count - 1 do113 with TContact( Records[I]), Output do begin113 for I := 0 to Contacts.Count - 1 do 114 with TContact(Contacts[I]), Output do begin 114 115 Add('BEGIN:VCARD'); 115 116 if Version <> '' then Add('VERSION:' + Version); … … 160 161 Charset: string; 161 162 Encoding: string; 162 begin 163 inherited; 164 Records.Clear; 163 CommandItems: TStringList; 164 begin 165 inherited; 166 Contacts.Clear; 165 167 Lines := TStringList.Create; 166 168 Lines.LoadFromFile(FileName); 167 169 try 170 CommandItems := TStringList.Create; 171 CommandItems.Delimiter := ';'; 168 172 I := 0; 169 173 while I < Lines.Count do begin … … 173 177 end else 174 178 if Line = 'END:VCARD' then begin 175 Records.Add(NewRecord);179 Contacts.Add(NewRecord); 176 180 NewRecord := nil; 177 181 end else 178 182 if Pos(':', Line) > 0 then begin 179 183 CommandPart := GetNext(Line, ':'); 180 Command := GetNext(CommandPart, ';'); 181 while CommandPart <> '' do begin 182 CommandParam := GetNext(CommandPart, ';'); 183 if CommandParam = 'CHARSET' then begin 184 GetNext(CommandParam, '='); 185 Charset := CommandParam; 186 end else 187 if CommandParam = 'ENCODING' then begin 188 GetNext(CommandParam, '='); 189 Encoding := CommandParam; 190 end else if Assigned(FOnError) then FOnError('Unknown command param: ' + CommandParam); 184 CommandItems.DelimitedText := CommandPart; 185 if CommandItems.IndexOfName('CHARSET') >= 0 then begin 186 Charset := CommandItems.Values['CHARSET']; 187 CommandItems.Delete(CommandItems.IndexOfName('CHARSET')); 188 end 189 else if CommandItems.IndexOfName('ENCODING') >= 0 then begin 190 Encoding := CommandItems.Values['ENCODING']; 191 CommandItems.Delete(CommandItems.IndexOfName('ENCODING')); 191 192 end; 193 Command := CommandItems.DelimitedText; 194 192 195 if Command = 'FN' then NewRecord.FullName := Line 193 196 else if Command = 'N' then begin … … 212 215 else if Command = 'X-NICKNAME' then NewRecord.NickName := Line 213 216 else if Command = 'EMAIL;HOME' then NewRecord.EmailHome := Line 214 else if Command = 'EMAIL ;INTERNET' then NewRecord.EmailInternet := Line217 else if Command = 'EMAIL:INTERNET' then NewRecord.EmailInternet := Line 215 218 else if Command = 'NOTE' then NewRecord.Note := Line 216 219 else if Command = 'ORG' then NewRecord.Organization := Line … … 231 234 Inc(I); 232 235 end; 236 CommandItems.Free; 233 237 finally 234 238 Lines.Free; … … 239 243 begin 240 244 inherited; 241 Records := TContacts.Create;245 Contacts := TContacts.Create; 242 246 end; 243 247 244 248 destructor TContactsFile.Destroy; 245 249 begin 246 Records.Free;250 Contacts.Free; 247 251 inherited; 248 252 end; -
trunk/UCore.lfm
r2 r3 3 3 OnDestroy = DataModuleDestroy 4 4 OldCreateOrder = False 5 Height = 606 6 HorizontalOffset = 484 7 VerticalOffset = 342 8 Width = 816 5 Height = 758 6 HorizontalOffset = 605 7 VerticalOffset = 428 8 Width = 1020 9 PPI = 120 9 10 object ImageList1: TImageList 10 left = 16011 top = 2 3111 left = 200 12 top = 289 12 13 Bitmap = { 13 14 4C690B0000001000000010000000000000000000000000000000000000000000 … … 368 369 object ActionList1: TActionList 369 370 Images = ImageList1 370 left = 340371 top = 2 33371 left = 425 372 top = 291 372 373 object AExit: TAction 373 374 Caption = 'Exit' … … 432 433 MaxCount = 10 433 434 OnChange = LastOpenedList1Change 434 left = 509435 top = 2 31435 left = 636 436 top = 289 436 437 end 437 438 object OpenDialog1: TOpenDialog 438 left = 520439 top = 322439 left = 650 440 top = 403 440 441 end 441 442 object SaveDialog1: TSaveDialog 442 left = 375443 top = 329443 left = 469 444 top = 411 444 445 end 445 446 object ApplicationInfo1: TApplicationInfo … … 458 459 RegistryRoot = rrKeyCurrentUser 459 460 License = 'CC0' 460 left = 191461 top = 329461 left = 239 462 top = 411 462 463 end 463 464 object PersistentForm1: TPersistentForm 464 465 MinVisiblePart = 50 465 466 EntireVisible = False 466 left = 520467 top = 72467 left = 650 468 top = 90 468 469 end 469 470 object CoolTranslator1: TCoolTranslator 470 471 POFilesFolder = 'Languages' 471 left = 2 39472 top = 72472 left = 299 473 top = 90 473 474 end 474 475 object ScaleDPI1: TScaleDPI 475 476 AutoDetect = False 476 left = 376477 top = 72477 left = 470 478 top = 90 478 479 end 479 480 end -
trunk/UCore.pas
r1 r3 251 251 FormMain.UpdateInterface; 252 252 if Assigned(DataFile) then 253 FormContacts.Contacts := TContactsFile(DataFile). Records253 FormContacts.Contacts := TContactsFile(DataFile).Contacts 254 254 else FormContacts.Contacts := nil; 255 FormContacts.ReloadList;256 255 end; 257 256 … … 295 294 procedure TCore.UpdateInterface; 296 295 begin 297 AFileSave.Enabled := Assigned(DataFile) ;296 AFileSave.Enabled := Assigned(DataFile) and DataFile.Modified; 298 297 AFileSaveAs.Enabled := Assigned(DataFile); 299 298 AFileClose.Enabled := Assigned(DataFile); -
trunk/UDataFile.pas
r1 r3 18 18 procedure SetFileName(AValue: string); 19 19 procedure SetModified(AValue: Boolean); 20 procedure DoOnModify; 20 21 public 21 22 function GetFileExt: string; virtual; … … 48 49 if FModified = AValue then Exit; 49 50 FModified := AValue; 51 DoOnModify; 52 end; 53 54 procedure TDataFile.DoOnModify; 55 begin 56 if Assigned(FOnModify) then FOnModify(Self); 50 57 end; 51 58 -
trunk/vCardStudio.lpi
r2 r3 144 144 <IsPartOfProject Value="True"/> 145 145 <ComponentName Value="FormContact"/> 146 <HasResources Value="True"/> 146 147 <ResourceBaseClass Value="Form"/> 147 148 </Unit8>
Note:
See TracChangeset
for help on using the changeset viewer.