* src/plugins/ChangeTypes.py (run_tool): Disable/enable signals.
* src/plugins/ReorderIds.py (__init__): Disable/enable signals. * src/plugins/PatchNames.py (on_ok_clicked): Start transaction only if doing the changes; disable/enable signals. svn: r6614
This commit is contained in:
parent
f3889a89dd
commit
cc500922f8
@ -1,4 +1,8 @@
|
|||||||
2006-05-10 Alex Roitman <shura@gramps-project.org>
|
2006-05-10 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/plugins/ChangeTypes.py (run_tool): Disable/enable signals.
|
||||||
|
* src/plugins/ReorderIds.py (__init__): Disable/enable signals.
|
||||||
|
* src/plugins/PatchNames.py (on_ok_clicked): Start transaction
|
||||||
|
only if doing the changes; disable/enable signals.
|
||||||
* src/plugins/SoundGen.py: Fix WM.
|
* src/plugins/SoundGen.py: Fix WM.
|
||||||
|
|
||||||
2006-05-10 Don Allingham <don@gramps-project.org>
|
2006-05-10 Don Allingham <don@gramps-project.org>
|
||||||
|
@ -113,6 +113,7 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
modified = 0
|
modified = 0
|
||||||
|
|
||||||
self.trans = self.db.transaction_begin("",batch=True)
|
self.trans = self.db.transaction_begin("",batch=True)
|
||||||
|
self.db.disable_signals()
|
||||||
if not cli:
|
if not cli:
|
||||||
progress = Utils.ProgressMeter(_('Analyzing events'),'')
|
progress = Utils.ProgressMeter(_('Analyzing events'),'')
|
||||||
progress.set_pass('',self.db.get_number_of_people())
|
progress.set_pass('',self.db.get_number_of_people())
|
||||||
@ -132,6 +133,8 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
if not cli:
|
if not cli:
|
||||||
progress.close()
|
progress.close()
|
||||||
self.db.transaction_commit(self.trans,_('Change types'))
|
self.db.transaction_commit(self.trans,_('Change types'))
|
||||||
|
self.db.enable_signals()
|
||||||
|
self.db.request_rebuild()
|
||||||
|
|
||||||
if modified == 0:
|
if modified == 0:
|
||||||
msg = _("No event record was modified.")
|
msg = _("No event record was modified.")
|
||||||
|
@ -39,7 +39,6 @@ from gettext import gettext as _
|
|||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
import gtk.glade
|
import gtk.glade
|
||||||
import GrampsDisplay
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -50,6 +49,8 @@ import Utils
|
|||||||
from PluginUtils import Tool, register_tool
|
from PluginUtils import Tool, register_tool
|
||||||
from QuestionDialog import OkDialog
|
from QuestionDialog import OkDialog
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
|
import GrampsDisplay
|
||||||
|
import RelLib
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -96,7 +97,6 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||||
|
|
||||||
self.cb = callback
|
self.cb = callback
|
||||||
self.trans = self.db.transaction_begin("",batch=True)
|
|
||||||
self.title_list = []
|
self.title_list = []
|
||||||
self.nick_list = []
|
self.nick_list = []
|
||||||
self.prefix1_list = []
|
self.prefix1_list = []
|
||||||
@ -276,6 +276,8 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
GrampsDisplay.help('tools-db')
|
GrampsDisplay.help('tools-db')
|
||||||
|
|
||||||
def on_ok_clicked(self,obj):
|
def on_ok_clicked(self,obj):
|
||||||
|
self.trans = self.db.transaction_begin("",batch=True)
|
||||||
|
self.db.disable_signals()
|
||||||
for grp in self.nick_list:
|
for grp in self.nick_list:
|
||||||
handle = self.nick_hash[grp[0]]
|
handle = self.nick_hash[grp[0]]
|
||||||
val = self.model.get_value(handle,0)
|
val = self.model.get_value(handle,0)
|
||||||
@ -283,7 +285,11 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
p = self.db.get_person_from_handle(grp[0])
|
p = self.db.get_person_from_handle(grp[0])
|
||||||
name = p.get_primary_name()
|
name = p.get_primary_name()
|
||||||
name.set_first_name(grp[1].strip())
|
name.set_first_name(grp[1].strip())
|
||||||
p.set_nick_name(grp[2].strip())
|
nick_name = grp[2].strip()
|
||||||
|
attr = RelLib.Attribute()
|
||||||
|
attr.set_type(RelLib.AttributeType.NICKNAME)
|
||||||
|
attr.set_value(nick_name)
|
||||||
|
p.add_attribute(attr)
|
||||||
self.db.commit_person(p,self.trans)
|
self.db.commit_person(p,self.trans)
|
||||||
|
|
||||||
for grp in self.title_list:
|
for grp in self.title_list:
|
||||||
@ -318,6 +324,8 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
|
|
||||||
self.db.transaction_commit(self.trans,
|
self.db.transaction_commit(self.trans,
|
||||||
_("Extract information from names"))
|
_("Extract information from names"))
|
||||||
|
self.db.enable_signals()
|
||||||
|
self.db.request_rebuild()
|
||||||
self.close()
|
self.close()
|
||||||
self.cb()
|
self.cb()
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ class ReorderIds(Tool.BatchTool):
|
|||||||
print "Reordering GRAMPS IDs..."
|
print "Reordering GRAMPS IDs..."
|
||||||
|
|
||||||
self.trans = db.transaction_begin("",batch=True)
|
self.trans = db.transaction_begin("",batch=True)
|
||||||
|
db.disable_signals()
|
||||||
|
|
||||||
if uistate:
|
if uistate:
|
||||||
self.progress.set_pass(_('Reordering People IDs'),
|
self.progress.set_pass(_('Reordering People IDs'),
|
||||||
@ -142,6 +143,8 @@ class ReorderIds(Tool.BatchTool):
|
|||||||
print "Done."
|
print "Done."
|
||||||
|
|
||||||
db.transaction_commit(self.trans,_("Reorder GRAMPS IDs"))
|
db.transaction_commit(self.trans,_("Reorder GRAMPS IDs"))
|
||||||
|
db.enable_signals()
|
||||||
|
db.request_rebuild()
|
||||||
|
|
||||||
def reorder(self, class_type, find_from_id, find_from_handle,
|
def reorder(self, class_type, find_from_id, find_from_handle,
|
||||||
find_next_id, table, commit, prefix):
|
find_next_id, table, commit, prefix):
|
||||||
|
Loading…
Reference in New Issue
Block a user