From cf0f1267318017af48d1a0168002714d2d746765 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 24 Aug 2006 19:56:51 +0000 Subject: [PATCH] (on_apply_clicked): Properly save entered types, including custom. svn: r7253 --- ChangeLog | 1 + src/plugins/ChangeTypes.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1edab8197..997aea11e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2006-08-24 Alex Roitman * src/plugins/ChangeTypes.py (run_tool): Properly set the new type. + (on_apply_clicked): Properly save entered types, including custom. 2006-08-23 Alex Roitman * src/DataViews/_PersonView.py (person_removed): Properly create diff --git a/src/plugins/ChangeTypes.py b/src/plugins/ChangeTypes.py index fb5e9f633..c9de1ee4c 100644 --- a/src/plugins/ChangeTypes.py +++ b/src/plugins/ChangeTypes.py @@ -82,8 +82,7 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow): self.auto1 = self.glade.get_widget("original") self.auto2 = self.glade.get_widget("new") - event_names = [item[1] for item in EventType._DATAMAP - if item[0] > 0 ] + event_names = [item[1] for item in EventType._DATAMAP if item[0] > 0 ] event_names.sort(locale.strcoll) AutoComp.fill_combo(self.auto1,event_names) AutoComp.fill_combo(self.auto2,event_names) @@ -151,10 +150,13 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow): def on_apply_clicked(self,obj): # Need to store English names for later comparison - self.options.handler.options_dict['fromtype'] = EventType._I2EMAP[ - EventType._S2IMAP[self.auto1.child.get_text()]] - self.options.handler.options_dict['totype'] = EventType._I2EMAP[ - EventType._S2IMAP[self.auto2.child.get_text()]] + the_type = EventType() + + the_type.set(self.auto1.child.get_text()) + self.options.handler.options_dict['fromtype'] = the_type.xml_str() + + the_type.set(self.auto2.child.get_text()) + self.options.handler.options_dict['totype'] = the_type.xml_str() modified,msg = self.run_tool(cli=False) OkDialog(_('Change types'),msg,self.window)