Changeset 133


Ignore:
Timestamp:
Apr 10, 2022, 1:39:35 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Show number of removed duplicates.
  • Fixed: Set document as modified only if data are really changed.
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r128 r133  
    6464    Top = 8
    6565    Width = 970
    66     ActivePage = TabSheetOthers
     66    ActivePage = TabSheetGeneral
    6767    Anchors = [akTop, akLeft, akRight, akBottom]
    6868    ParentFont = False
    69     TabIndex = 5
     69    TabIndex = 0
    7070    TabOrder = 4
    7171    object TabSheetGeneral: TTabSheet
  • trunk/Forms/UFormContact.pas

    r131 r133  
    502502procedure TFormContact.TabSheetGeneralShow(Sender: TObject);
    503503begin
    504   EditFullName.Text := Contact.Fields[cfFullName];
     504  UpdateEditNoOnChange(EditFullName, Contact.Fields[cfFullName]);
    505505  EditNickName.Text := Contact.Fields[cfNickName];
    506506  EditEmail.Text := Contact.Fields[cfEmail];
  • trunk/Forms/UFormContacts.pas

    r129 r133  
    471471      FormContact.OnGetNext := GetNextContact;
    472472      if FormContact.ShowModal = mrOK then begin
     473        if not TContact(ListView1.Selected.Data).CompareTo(Contact) then
     474          Core.DataFile.Modified := True;
    473475        TContact(ListView1.Selected.Data).Assign(Contact);
    474         Core.DataFile.Modified := True;
    475476        ReloadList;
    476477        UpdateInterface;
  • trunk/Forms/UFormProperties.lfm

    r95 r133  
    11object FormProperties: TFormProperties
    22  Left = 400
    3   Height = 946
     3  Height = 908
    44  Top = 212
    5   Width = 1260
     5  Width = 1210
    66  Caption = 'Contacts'
    7   ClientHeight = 946
    8   ClientWidth = 1260
    9   DesignTimePPI = 150
     7  ClientHeight = 908
     8  ClientWidth = 1210
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1414  object ListView1: TListView
    1515    Left = 0
    16     Height = 844
     16    Height = 810
    1717    Top = 0
    18     Width = 1260
     18    Width = 1210
    1919    Align = alClient
    2020    Columns = <   
    2121      item
    2222        Caption = 'Name'
    23         Width = 312
     23        Width = 300
    2424      end   
    2525      item
    2626        Caption = 'Attributes'
    27         Width = 156
     27        Width = 150
    2828      end   
    2929      item
    3030        Caption = 'Values'
    31         Width = 777
     31        Width = 746
    3232      end>
    3333    MultiSelect = True
     
    4545  object ToolBar1: TToolBar
    4646    Left = 0
    47     Height = 41
    48     Top = 877
    49     Width = 1260
     47    Height = 39
     48    Top = 842
     49    Width = 1210
    5050    Align = alBottom
    5151    Images = Core.ImageList1
     
    6060    end
    6161    object ToolButton2: TToolButton
    62       Left = 37
     62      Left = 36
    6363      Top = 2
    6464      Action = AModify
    6565    end
    6666    object ToolButton3: TToolButton
    67       Left = 109
     67      Left = 106
    6868      Top = 2
    6969      Action = ARemove
    7070    end
    7171    object ToolButton4: TToolButton
    72       Left = 73
     72      Left = 71
    7373      Top = 2
    7474      Action = AClone
    7575    end
    7676    object ToolButton5: TToolButton
    77       Left = 145
    78       Height = 34
     77      Left = 141
     78      Height = 33
    7979      Top = 2
    8080      Style = tbsSeparator
    8181    end
    8282    object ToolButton6: TToolButton
    83       Left = 153
     83      Left = 149
    8484      Top = 2
    8585      Action = ALoadValueFromFile
    8686    end
    8787    object ToolButton7: TToolButton
    88       Left = 189
     88      Left = 184
    8989      Top = 2
    9090      Action = ASaveValueToFile
     
    9393  object ListViewFilter1: TListViewFilter
    9494    Left = 0
    95     Height = 33
    96     Top = 844
    97     Width = 1260
     95    Height = 32
     96    Top = 810
     97    Width = 1210
    9898    OnChange = ListViewFilter1Change
    9999    Align = alBottom
     
    101101  object StatusBar1: TStatusBar
    102102    Left = 0
    103     Height = 28
    104     Top = 918
    105     Width = 1260
     103    Height = 27
     104    Top = 881
     105    Width = 1210
    106106    Panels = <   
    107107      item
    108         Width = 52
     108        Width = 50
    109109      end>
    110110    SimplePanel = False
     
    112112  object PopupMenuField: TPopupMenu
    113113    Images = Core.ImageList1
    114     Left = 453
    115     Top = 274
     114    Left = 435
     115    Top = 263
    116116    object MenuItem1: TMenuItem
    117117      Action = AAdd
     
    141141  object ActionList1: TActionList
    142142    Images = Core.ImageList1
    143     Left = 763
    144     Top = 268
     143    Left = 732
     144    Top = 257
    145145    object AAdd: TAction
    146146      Caption = 'Add'
     
    189189    Column = 0
    190190    Order = soNone
    191     Left = 550
    192     Top = 446
     191    Left = 528
     192    Top = 428
    193193  end
    194194  object SaveDialog1: TSaveDialog
    195     Left = 792
    196     Top = 467
     195    Left = 760
     196    Top = 448
    197197  end
    198198  object OpenDialog1: TOpenDialog
    199     Left = 792
    200     Top = 542
     199    Left = 760
     200    Top = 520
    201201  end
    202202end
  • trunk/Forms/UFormProperties.pas

    r129 r133  
    226226        Properties.Add(ContactProperty);
    227227        ContactProperty := nil;
    228         Core.DataFile.Modified := True;
    229228        ReloadList;
    230229        UpdateInterface;
     
    253252        Properties.Add(ContactProperty);
    254253        ContactProperty := nil;
    255         Core.DataFile.Modified := True;
    256254        ReloadList;
    257255        UpdateInterface;
     
    294292      if FormProperty.ShowModal = mrOK then begin
    295293        TContactProperty(ListView1.Selected.Data).Assign(ContactProperty);
    296         Core.DataFile.Modified := True;
    297294        ReloadList;
    298295        UpdateInterface;
     
    317314        Properties.Delete(Properties.IndexOf(ListView1.Items[I].Data));
    318315      end;
    319     Core.DataFile.Modified := True;
    320316    ReloadList;
    321317    UpdateInterface;
  • trunk/Languages/vCardStudio.cs.po

    r130 r133  
    11141114msgstr "Řádek %d: %s"
    11151115
     1116#: ucore.sremovedduplicates
     1117#, object-pascal-format
     1118msgid "Removed %d duplicates."
     1119msgstr "Odstraněno %d duplikátů."
     1120
    11161121#: udatafile.sallfiles
    11171122msgctxt "udatafile.sallfiles"
     
    11211126#: udatafile.sdatafilename
    11221127msgctxt "udatafile.sdatafilename"
    1123 msgid "File"
    1124 msgstr "Soubor"
     1128msgid "Data file"
     1129msgstr "Datový soubor"
    11251130
    11261131#: uformcontact.scontact
     
    12391244msgid "vCard file"
    12401245msgstr "Soubor vCard"
    1241 
  • trunk/Languages/vCardStudio.pot

    r130 r133  
    10871087msgstr ""
    10881088
     1089#: ucore.sremovedduplicates
     1090#, object-pascal-format
     1091msgid "Removed %d duplicates."
     1092msgstr ""
     1093
    10891094#: udatafile.sallfiles
    10901095msgctxt "udatafile.sallfiles"
     
    10941099#: udatafile.sdatafilename
    10951100msgctxt "udatafile.sdatafilename"
    1096 msgid "File"
     1101msgid "Data file"
    10971102msgstr ""
    10981103
  • trunk/Languages/vCardStudio.sv.po

    r130 r133  
    11241124msgstr "Linje %d: %s"
    11251125
     1126#: ucore.sremovedduplicates
     1127#, object-pascal-format
     1128msgid "Removed %d duplicates."
     1129msgstr ""
     1130
    11261131#: udatafile.sallfiles
    11271132msgctxt "udatafile.sallfiles"
     
    11301135
    11311136#: udatafile.sdatafilename
     1137#, fuzzy
     1138#| msgid "File"
    11321139msgctxt "udatafile.sdatafilename"
    1133 msgid "File"
     1140msgid "Data file"
    11341141msgstr "Fil"
    11351142
  • trunk/Packages/VCard/UVCard.pas

    r132 r133  
    209209    procedure Merge(Contact: TContact; FieldIndex: TContactFieldIndex);
    210210    function ToString: ansistring; override;
    211     procedure RemoveExactDuplicates;
     211    function RemoveExactDuplicates: Integer;
    212212    procedure Sort;
    213213  end;
     
    12421242end;
    12431243
    1244 procedure TContacts.RemoveExactDuplicates;
     1244function TContacts.RemoveExactDuplicates: Integer;
    12451245var
    12461246  I: Integer;
    12471247  J: Integer;
    12481248begin
     1249  Result := 0;
    12491250  for I := 0 to Count - 1 do
    12501251    for J := Count - 1 downto I + 1 do
    12511252      if Items[I].CompareTo(Items[J]) then begin
    12521253        Remove(Items[J]);
     1254        Inc(Result);
    12531255      end;
    12541256end;
  • trunk/UCore.pas

    r130 r133  
    127127  SCombinedContacts = 'Combined %d contact files.';
    128128  SLine = 'Line %d: %s';
     129  SRemovedDuplicates = 'Removed %d duplicates.';
    129130
    130131{ TCore }
     
    298299
    299300procedure TCore.ARemoveExactDuplicatesExecute(Sender: TObject);
    300 begin
    301   TVCardFile(DataFile).VCard.Contacts.RemoveExactDuplicates;
    302   UpdateFile;
     301var
     302  RemovedCount: Integer;
     303begin
     304  RemovedCount := TVCardFile(DataFile).VCard.Contacts.RemoveExactDuplicates;
     305  ShowMessage(Format(SRemovedDuplicates, [RemovedCount]));
     306  if RemovedCount > 0 then begin
     307    DataFile.Modified := True;
     308    UpdateFile;
     309  end;
    303310end;
    304311
  • trunk/UDataFile.pas

    r128 r133  
    3636
    3737resourcestring
    38   SDataFileName = 'File';
     38  SDataFileName = 'Data file';
    3939  SAllFiles = 'All files';
    4040
Note: See TracChangeset for help on using the changeset viewer.