Commit Graph

22294 Commits

Author SHA1 Message Date
Bastien Jacquet
22ef07cdeb FlatTreeView : Fix wrong return values 2014-12-11 01:02:56 +01:00
Bastien Jacquet
d4a99d8488 Remove needless use of handles in FlatBaseModel.do_iter_next 2014-12-05 06:17:50 +01:00
Bastien Jacquet
48eb2842ee Optimize FlatNodeMap update of _hndl2index for add/delete
tests with python2.6 and python3 show that it's much quicker to get
the handles after the inser/deleted index and upgrade those
(because random-access in a hash-table is super fast)

Here is the code use for tests:

import string,random,sys
import timeit

def id_generator(size=6, chars=string.ascii_lowercase):
    return ''.join(random.choice(chars) for _ in range(size))

num_items=80000
handle_sizes=10
num_operation=2000
setup="""
from __main__ import id_generator,string,num_items,handle_sizes,random
_index2hndl=[("",id_generator(handle_sizes)) for e in range (num_items)]
_hndl2index=dict([key[1], index]
                for index, key in enumerate(_index2hndl))
"""

add0='''
h=id_generator(handle_sizes)
insert_pos= random.randrange(len(_hndl2index))
srtkey_hndl=("",h)
_index2hndl.insert(insert_pos, srtkey_hndl)
for hndl, index in _hndl2index.iteritems():
    if index >= insert_pos:
        _hndl2index[hndl] += 1
_hndl2index[h]=insert_pos
'''
add1='''
h=id_generator(handle_sizes)
insert_pos= random.randrange(len(_hndl2index))
srtkey_hndl=("",h)
_index2hndl.insert(insert_pos, srtkey_hndl)
for hndl, index in _hndl2index.items():
    if index >= insert_pos:
        _hndl2index[hndl] += 1
_hndl2index[h]=insert_pos
'''
add2='''
h=id_generator(handle_sizes)
insert_pos= random.randrange(len(_hndl2index))
srtkey_hndl=("",h)
_index2hndl.insert(insert_pos, srtkey_hndl)
for srt_key,hndl in _index2hndl[insert_pos+1:]:
    _hndl2index[hndl] += 1
_hndl2index[h]=insert_pos
'''
del0='''
index= random.randrange(len(_hndl2index))
srt_key,handle=_index2hndl[index]
del _index2hndl[index]
del _hndl2index[handle]
for key, val in _hndl2index.iteritems():
    if val > index:
        _hndl2index[key] -= 1
'''
del1='''
index= random.randrange(len(_hndl2index))
srt_key,handle=_index2hndl[index]
del _index2hndl[index]
del _hndl2index[handle]
for key, val in _hndl2index.items():
    if val > index:
        _hndl2index[key] -= 1
'''
del2='''
index= random.randrange(len(_hndl2index))
srt_key,handle=_index2hndl[index]
del _index2hndl[index]
del _hndl2index[handle]
for srt_key,hndl in _index2hndl[index:]:
    _hndl2index[hndl] -= 1
'''
if sys.version_info[0] < 3:
    cmds=[add0,add1,add2,del0,del1,del2]
else:
    cmds=[add1,add2,del1,del2]
for c in cmds:
    print(c)
    random.seed(1)
    t=timeit.Timer(c, setup=setup).timeit(num_operation)
    print(num_operation,"ops in ", t, "seconds. avg:",t/num_operation,"seconds")
2014-12-05 06:08:50 +01:00
Bastien Jacquet
a52a931b57 Fix doc and harmless typo (real_index instead of real_path) 2014-12-05 06:04:26 +01:00
Bastien Jacquet
813075ae2f Fix handling of keypresses in treeview 2014-12-05 06:04:21 +01:00
Josip
0301ddd1a6 8157: ImageMetadata doesn't show metadata 2014-11-07 19:26:36 +01:00
Craig J. Anderson
da2c8aa644 small feature update to add z,n,e to the date format string.
these are used for dates with ending dates (date ranges)
  Craig A.
2014-11-06 10:40:42 -05:00
Bastien Jacquet
cd540cdb13 8102: Fix problem with fanchart if max_generation = 1 2014-11-05 23:22:48 +01:00
Bastien Jacquet
d716146e9d 8149: Error on opening twice an object from clipboard because of missing import 2014-11-05 21:26:44 +01:00
Bastien Jacquet
e9c441c62f Allow to drag a person by dragging the "Father/Mother/Spouse" label or around Add/edt/share buttons
Signed-off-by: Bastien Jacquet <bastien.jacquet_dev@m4x.org>
2014-11-05 17:52:07 +00:00
Bastien Jacquet
4ad884d54e Add Family drag support from RelationshipView 2014-11-05 17:52:07 +00:00
Bastien Jacquet
e83190dd82 EditPerson new person calls create_id() to have a handler in clipboard (as in EditFamily) 2014-11-05 17:52:07 +00:00
Bastien Jacquet
88c919d034 Allow for dragging a family from EditFamily 2014-11-05 17:52:07 +00:00
Bastien Jacquet
4ade6db556 Add Person drag support from RelationshipView
Signed-off-by: Bastien Jacquet <bastien.jacquet_dev@m4x.org>
2014-11-05 17:52:07 +00:00
Bastien Jacquet
ebb9b53589 Add Support for dragging from the add/choose selector of Place/Source/Media/Note-Entry 2014-11-05 17:52:07 +00:00
Bastien Jacquet
b7ab556393 Add drag support to parents in EditFamily (when set) and move drop capability if parent already set 2014-11-05 17:52:07 +00:00
Bastien Jacquet
1797b66f48 Allow to drag a person from EditPerson (if not a unsaved person) 2014-11-05 17:52:06 +00:00
Bastien Jacquet
4e86fdafc5 Add person drag support from EditChildRef (always possible as child are
always set)
2014-11-05 17:52:06 +00:00
Bastien Jacquet
79d876e350 And drag support to EditPersonRef when person is set 2014-11-05 17:52:06 +00:00
Bastien Jacquet
ea3afbb35c Create prefilled PersonRef when drop of a Person on Association EmbeddedTab (same as ChildTab) 2014-11-05 17:52:06 +00:00
Bastien Jacquet
077be0c07e 8095:Association editor refuses dropped persons 2014-11-05 17:52:06 +00:00
Paul Franklin
5324ca28d4 5150: new Event types are saved as a disordered list 2014-11-04 07:28:22 -08:00
Nick Hall
addcf6f034 7604: Fix error setting gramplet tab label 2014-11-03 21:47:32 +00:00
Zdeněk Hataš
6bf0cfa857 czech translation update 2014-10-30 14:16:02 +01:00
Paul Franklin
0ca906298b 8154: Some text not translatable in context menu fancharts (GUI) 2014-10-29 09:19:05 -07:00
Paul Franklin
4fb677283e 8152: Error converting database after upgrade to Gramps 4.1.1 2014-10-28 17:01:43 -07:00
Nick Hall
93a26b26d2 8020: Ensure that reference map has string keys 2014-10-28 17:47:34 +00:00
John Ralls
a372922e02 8140: Gramps doesn't work under Turkish locale 2014-10-27 11:22:45 -07:00
Ugur Cetin
c7dfeaf25f update Turkish translation (partial) 2014-10-26 15:24:25 -07:00
leonhaeuser
6e73dba8e2 update German translation 2014-10-26 19:29:09 +01:00
Paul Franklin
bf23a94f5d neaten language list in setup.py 2014-10-24 12:34:48 -07:00
Jérôme Rapinat
f02247b89c Serbian should be ready for Windows OS and LOCALE_NAMES mapping 2014-10-24 20:01:25 +02:00
Jérôme Rapinat
b1a686445f 8122: DB lock not checked when opening database from the recent opened trees 2014-10-24 09:41:10 +02:00
Craig J. Anderson
9e0f8b2f28 Merge branch 'master' of ssh://git.code.sf.net/p/gramps/source 2014-10-23 15:02:51 -04:00
Zdeněk Hataš
e799b9d3d0 czech translation update 2014-10-23 20:55:19 +02:00
Craig J. Anderson
3575964835 fix for https://gramps-project.org/bugs/view.php?id=6355.
Craig A.
2014-10-23 12:57:21 -04:00
Paul Franklin
93744057ad enable Serbian Cyrillic translation 2014-10-22 22:48:04 -07:00
Мирослав Николић
91c85ee0d0 add Serbian Cyrillic translation file 2014-10-22 22:47:01 -07:00
Paul Franklin
6952304b34 rename old Serbian translation file 2014-10-22 22:45:04 -07:00
Jérôme Rapinat
9edd496b8d New locations gramplet [6ff9ed] 2014-10-22 08:21:16 +02:00
Nick Hall
ad0d3d19c1 7902: Update place details gramplet
Add name, type and alternative names.
Locations are now displayed in a separate gramplet.
2014-10-21 19:31:43 +01:00
Nick Hall
6ff9ed00f0 Add new place locations gramplet 2014-10-21 19:31:43 +01:00
Jérôme Rapinat
bb67bdb83c Re-enable Esperento support after a large review (8% to 99%); No support under Windows (see _LOCALE_NAMES in gen/utils/grampslocale.py) 2014-10-21 15:34:38 +02:00
Pier Luigi Cinquantini
7a06f0b8e1 Update and review for the Esperanto translation 2014-10-21 15:11:45 +02:00
Jérôme Rapinat
d4e43ef663 7362 8103: some labels fit better on citations sidebar filter (patch by Nick H.), fix a typo on swedish translation, add the new translated string on most translation files 2014-10-20 11:28:24 +02:00
Paul Franklin
55c7e223d4 enhance Serbian date handler to handle Cyrillic dates 2014-10-17 18:11:37 -07:00
Nick Hall
a29232a133 7813: Add check for empty handle in gramplets 2014-10-17 23:05:57 +01:00
Jérôme Rapinat
9eb8700cfd 8103: sidebarfilter gramplet does not fit well into People, Events, Citations or Media views (non-english locales) 2014-10-15 21:47:03 +02:00
Jérôme Rapinat
246694b0f7 8103: sidebarfilter gramplet does not fit well into People, Events, Citations or Media views 2014-10-15 21:37:03 +02:00
Paul Franklin
f68e8837f7 8113: 'Unknown' person in detailed ancestor report can not be translated 2014-10-11 14:39:37 -07:00