Changeset 16 for trunk


Ignore:
Timestamp:
Feb 28, 2018, 9:44:51 AM (7 years ago)
Author:
chronos
Message:
  • Added: New Tools action Find duplicates.
Location:
trunk
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r15 r16  
    3636      AnchorSideTop.Control = CoolBar1
    3737      Left = 24
    38       Height = 22
     38      Height = 28
    3939      Top = 5
    40       Width = 105
     40      Width = 132
    4141      Align = alNone
    4242      AutoSize = True
     
    5656      end
    5757      object ToolButton2: TToolButton
    58         Left = 24
     58        Left = 30
    5959        Top = 0
    6060        Action = Core.AFileOpen
     
    6363      end
    6464      object ToolButton3: TToolButton
    65         Left = 59
     65        Left = 74
    6666        Top = 0
    6767        Action = Core.AFileSave
    6868      end
    6969      object ToolButton4: TToolButton
    70         Left = 82
     70        Left = 103
    7171        Top = 0
    7272        Action = Core.AFileClose
     
    7777      AnchorSideTop.Control = CoolBar1
    7878      Left = 188
    79       Height = 22
     79      Height = 28
    8080      Top = 5
    81       Width = 24
     81      Width = 59
    8282      Align = alNone
    8383      AutoSize = True
     
    9292      Transparent = True
    9393      object ToolButton5: TToolButton
     94        Left = 30
     95        Top = 0
     96        Action = Core.ASettings
     97      end
     98      object ToolButton6: TToolButton
    9499        Left = 1
    95100        Top = 0
    96         Action = Core.ASettings
     101        Action = Core.AFindDuplicate
    97102      end
    98103    end
     
    159164        Action = Core.ASettings
    160165      end
     166      object MenuItem4: TMenuItem
     167        Action = Core.AFindDuplicate
     168      end
    161169    end
    162170    object MenuItemHelp: TMenuItem
  • trunk/Forms/UFormMain.pas

    r15 r16  
    1818    MenuItem1: TMenuItem;
    1919    MenuItem3: TMenuItem;
     20    MenuItem4: TMenuItem;
    2021    MenuItemToolbar: TMenuItem;
    2122    MenuItemView: TMenuItem;
     
    4344    ToolButton4: TToolButton;
    4445    ToolButton5: TToolButton;
     46    ToolButton6: TToolButton;
    4547    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4648    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
     
    4951    procedure MenuItemToolbarClick(Sender: TObject);
    5052  private
     53    procedure SetToolbarHints;
    5154    procedure UpdateFormTitle;
    5255  public
     
    8386
    8487procedure TFormMain.FormCreate(Sender: TObject);
    85 var
    86   I: Integer;
    8788begin
    88   for I := 0 to ToolBarFile.ButtonCount - 1 do
    89     ToolBarFile.Buttons[I].Hint := ToolBarFile.Buttons[I].Caption;
    9089end;
    9190
    9291procedure TFormMain.FormShow(Sender: TObject);
    9392begin
     93  SetToolbarHints;
    9494  Core.Initialize;
    9595  Core.ThemeManager1.UseTheme(Self);
     
    103103begin
    104104  UpdateInterface;
     105end;
     106
     107procedure TFormMain.SetToolbarHints;
     108var
     109  I: Integer;
     110  J: Integer;
     111  Control: TControl;
     112begin
     113 for J := 0 to CoolBar1.ControlCount - 1 do begin
     114    Control := CoolBar1.Controls[J];
     115    if Control is TToolBar then begin
     116      for I := 0 to TToolBar(Control).ButtonCount - 1 do begin
     117        TToolBar(Control).Buttons[I].ShowHint := True;
     118        TToolBar(Control).Buttons[I].Hint := TToolBar(Control).Buttons[I].Caption;
     119      end;
     120    end;
     121  end;
    105122end;
    106123
  • trunk/Forms/UFormSettings.lfm

    r15 r16  
    1010  Constraints.MinWidth = 400
    1111  DesignTimePPI = 120
     12  OnClose = FormClose
    1213  OnCreate = FormCreate
    1314  OnShow = FormShow
  • trunk/Forms/UFormSettings.pas

    r15 r16  
    2828    procedure CheckBoxAutomaticDPIChange(Sender: TObject);
    2929    procedure CheckBoxStartOnLogonChange(Sender: TObject);
     30    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3031    procedure FormCreate(Sender: TObject);
    3132    procedure FormShow(Sender: TObject);
     
    5354procedure TFormSettings.FormShow(Sender: TObject);
    5455begin
     56  Core.PersistentForm1.Load(Self);
     57
    5558  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
    5659  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
     
    7881begin
    7982  UpdateInterface;
     83end;
     84
     85procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction
     86  );
     87begin
     88  Core.PersistentForm1.Save(Self);
    8089end;
    8190
  • trunk/Languages/vCardStudio.cs.po

    r15 r16  
    5050msgstr "Uložit jako..."
    5151
     52#: tcore.afindduplicate.caption
     53msgctxt "tcore.afindduplicate.caption"
     54msgid "Find duplicities"
     55msgstr "Najít duplikáty"
     56
    5257#: tcore.ahomepage.caption
    5358msgctxt "tcore.ahomepage.caption"
     
    228233
    229234#: tformcontacts.caption
     235msgctxt "tformcontacts.caption"
    230236msgid "Contacts"
    231237msgstr "Kontakty"
     
    249255msgstr "Příjimení"
    250256
     257#: tformfindduplicity.caption
     258msgctxt "tformfindduplicity.caption"
     259msgid "Find duplicities"
     260msgstr "Najít duplikáty"
     261
     262#: tformfindduplicity.label1.caption
     263msgid "Contact field:"
     264msgstr "Pole kontaktu:"
     265
     266#: tformfindduplicity.listview1.columns[0].caption
     267msgid "Field"
     268msgstr "Pole"
     269
     270#: tformfindduplicity.listview1.columns[1].caption
     271msgctxt "tformfindduplicity.listview1.columns[1].caption"
     272msgid "Contacts"
     273msgstr "Kontakty"
     274
     275#: tformfindduplicity.listview1.columns[2].caption
     276msgid "Count"
     277msgstr "Počet"
     278
    251279#: tformmain.caption
    252280msgid "vCard Studio"
  • trunk/Languages/vCardStudio.po

    r15 r16  
    4040msgstr ""
    4141
     42#: tcore.afindduplicate.caption
     43msgctxt "tcore.afindduplicate.caption"
     44msgid "Find duplicities"
     45msgstr ""
     46
    4247#: tcore.ahomepage.caption
    4348msgctxt "tcore.ahomepage.caption"
     
    218223
    219224#: tformcontacts.caption
     225msgctxt "tformcontacts.caption"
    220226msgid "Contacts"
    221227msgstr ""
     
    239245msgstr ""
    240246
     247#: tformfindduplicity.caption
     248msgctxt "tformfindduplicity.caption"
     249msgid "Find duplicities"
     250msgstr ""
     251
     252#: tformfindduplicity.label1.caption
     253msgid "Contact field:"
     254msgstr ""
     255
     256#: tformfindduplicity.listview1.columns[0].caption
     257msgid "Field"
     258msgstr ""
     259
     260#: tformfindduplicity.listview1.columns[1].caption
     261msgctxt "tformfindduplicity.listview1.columns[1].caption"
     262msgid "Contacts"
     263msgstr ""
     264
     265#: tformfindduplicity.listview1.columns[2].caption
     266msgid "Count"
     267msgstr ""
     268
    241269#: tformmain.caption
    242270msgid "vCard Studio"
  • trunk/UContact.pas

    r15 r16  
    3535    function AddNew(Name: string; Index: TContactFieldIndex; DataType:
    3636      TDataType): TContactField;
     37    procedure LoadToStrings(AItems: TStrings);
    3738  end;
    3839
     
    8889    ContactsFile: TContactsFile;
    8990    function Search(FullName: string): TContact;
     91    function ToString: ansistring; override;
    9092  end;
    9193
     
    132134end;
    133135
     136function TContacts.ToString: ansistring;
     137var
     138  I: Integer;
     139begin
     140  Result := '';
     141  for I := 0 to Count - 1 do begin
     142    if I > 0 then Result := Result + ', ';
     143    Result := Result + TContact(Items[I]).FullName;
     144  end;
     145end;
     146
    134147{ TContactFields }
    135148
     
    142155  Result.DataType := DataType;
    143156  Add(Result);
     157end;
     158
     159procedure TContactFields.LoadToStrings(AItems: TStrings);
     160var
     161  I: Integer;
     162begin
     163  while AItems.Count < Count do AItems.Add('');
     164  while AItems.Count > Count do AItems.Delete(AItems.Count - 1);
     165  for I := 0 to Count - 1 do
     166    AItems[I] := TContactField(Items[I]).Name;
    144167end;
    145168
  • trunk/UCore.lfm

    r15 r16  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 703
    6   HorizontalOffset = 270
    7   VerticalOffset = 174
    8   Width = 1078
     5  Height = 441
     6  HorizontalOffset = 384
     7  VerticalOffset = 299
     8  Width = 605
    99  PPI = 120
    1010  object ImageList1: TImageList
    11     left = 250
    12     top = 361
     11    left = 96
     12    top = 168
    1313    Bitmap = {
    14       4C690B0000001000000010000000000000000000000000000000000000000000
     14      4C690C0000001000000010000000000000000000000000000000000000000000
    1515      0000000000000000000000000000000000000000000000000000000000000000
    1616      0000000000000000000000000000000000000000000000000000000000000000
     
    364364      B2FFDCDCDCFF0000000000000000000000000000000000000000000000000000
    365365      0000000000000000000000000000000000000000000000000000000000000000
     366      0000000000000000000000000000000000000000000000000000000000000000
     367      0000000000000000000000000000000000000000000000000000000000000000
     368      0000000000000000000000000000000000000000000000000000000000000000
     369      0000000000000000000000000000000000000000000000000000000000000000
     370      000000000000000000000000000000000000000000FF000000FF000000FF0000
     371      00FF000000FF000000FF00000000000000000000000000000000000000000000
     372      000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
     373      FFFFFFFFFFFF000000FF000000FF000000000000000000000000000000000000
     374      000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
     375      FFFFFFFFFFFF000000FFFFFFFFFF000000FF0000000000000000000000000000
     376      000000000000000000000000000000000000000000FFFFFFFFFF000000FF0000
     377      00FFFFFFFFFF000000FF840000FF840000FF840000FF840000FF840000FF8400
     378      00FF00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
     379      FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400
     380      00FF840000FF000000000000000000000000000000FFFFFFFFFF000000FF0000
     381      00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400
     382      00FFFFFFFFFF840000FF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
     383      FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FFFFFFFFFF8400
     384      00FF840000FF840000FF840000FF00000000000000FFFFFFFFFF000000FF0000
     385      00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     386      FFFFFFFFFFFFFFFFFFFF840000FF00000000000000FFFFFFFFFFFFFFFFFFFFFF
     387      FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FF000000FF0000
     388      00FF000000FFFFFFFFFF840000FF00000000000000FF000000FF000000FF0000
     389      00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     390      FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000
     391      00000000000000000000840000FFFFFFFFFF000000FF000000FF000000FF0000
     392      00FF000000FFFFFFFFFF840000FF000000000000000000000000000000000000
     393      00000000000000000000840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     394      FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000
     395      00000000000000000000840000FF840000FF840000FF840000FF840000FF8400
     396      00FF840000FF840000FF840000FF000000000000000000000000000000000000
     397      0000000000000000000000000000000000000000000000000000000000000000
    366398      0000000000000000000000000000
    367399    }
     
    369401  object ActionList1: TActionList
    370402    Images = ImageList1
    371     left = 531
    372     top = 364
     403    left = 320
     404    top = 168
    373405    object AExit: TAction
    374406      Caption = 'Exit'
     
    434466      OnExecute = AFileMergeExecute
    435467    end
     468    object AFindDuplicate: TAction
     469      Caption = 'Find duplicities'
     470      ImageIndex = 11
     471      OnExecute = AFindDuplicateExecute
     472    end
    436473  end
    437474  object LastOpenedList1: TLastOpenedList
    438475    MaxCount = 10
    439476    OnChange = LastOpenedList1Change
    440     left = 795
    441     top = 361
     477    left = 320
     478    top = 240
    442479  end
    443480  object OpenDialog1: TOpenDialog
    444     left = 813
    445     top = 504
     481    left = 320
     482    top = 304
    446483  end
    447484  object SaveDialog1: TSaveDialog
    448     left = 586
    449     top = 514
     485    left = 96
     486    top = 304
    450487  end
    451488  object ApplicationInfo1: TApplicationInfo
     
    464501    RegistryRoot = rrKeyCurrentUser
    465502    License = 'CC0'
    466     left = 299
    467     top = 514
     503    left = 96
     504    top = 240
    468505  end
    469506  object PersistentForm1: TPersistentForm
    470507    MinVisiblePart = 50
    471508    EntireVisible = False
    472     left = 813
    473     top = 113
     509    left = 320
     510    top = 104
    474511  end
    475512  object CoolTranslator1: TCoolTranslator
    476513    POFilesFolder = 'Languages'
    477     left = 374
    478     top = 113
     514    left = 96
     515    top = 40
    479516  end
    480517  object ScaleDPI1: TScaleDPI
    481518    AutoDetect = False
    482     left = 588
    483     top = 113
     519    left = 320
     520    top = 40
    484521  end
    485522  object ThemeManager1: TThemeManager
    486     left = 167
    487     top = 250
     523    left = 96
     524    top = 104
    488525  end
    489526end
  • trunk/UCore.pas

    r15 r16  
    2626  TCore = class(TDataModule)
    2727    AAbout: TAction;
     28    AFindDuplicate: TAction;
    2829    AFileMerge: TAction;
    2930    ASettings: TAction;
     
    5556    procedure AFileSaveAsExecute(Sender: TObject);
    5657    procedure AFileCloseExecute(Sender: TObject);
     58    procedure AFindDuplicateExecute(Sender: TObject);
    5759    procedure AHomePageExecute(Sender: TObject);
    5860    procedure ASettingsExecute(Sender: TObject);
     
    9193
    9294uses
    93   UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts;
     95  UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity;
    9496
    9597resourcestring
     
    168170  FileClose;
    169171  UpdateFile;
     172end;
     173
     174procedure TCore.AFindDuplicateExecute(Sender: TObject);
     175begin
     176  FormFindDuplicity := TFormFindDuplicity.Create(nil);
     177  with FormFindDuplicity do begin
     178    Contacts := TContactsFile(DataFile).Contacts;
     179    ShowModal;
     180    Free;
     181  end;
    170182end;
    171183
  • trunk/vCardStudio.lpi

    r15 r16  
    101101      </Item4>
    102102    </RequiredPackages>
    103     <Units Count="9">
     103    <Units Count="10">
    104104      <Unit0>
    105105        <Filename Value="vCardStudio.lpr"/>
     
    156156        <ResourceBaseClass Value="Form"/>
    157157      </Unit8>
     158      <Unit9>
     159        <Filename Value="Forms\UFormFindDuplicity.pas"/>
     160        <IsPartOfProject Value="True"/>
     161        <ComponentName Value="FormFindDuplicity"/>
     162        <HasResources Value="True"/>
     163        <ResourceBaseClass Value="Form"/>
     164      </Unit9>
    158165    </Units>
    159166  </ProjectOptions>
  • trunk/vCardStudio.lpr

    r2 r16  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, Common, CoolTranslator, UDataFile,
    11   TemplateGenerics, SysUtils, UFormContacts, UFormContact
     11  TemplateGenerics, SysUtils, UFormContacts, UFormContact, UFormFindDuplicity
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.