From 3df4194d3d70e681c4e435e389b7905cfc1df612 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 13 May 2003 15:28:29 +0000 Subject: [PATCH] Send rox-changed instead of row-deleted/row-inserted. git-svn-id: http://dom-editor.googlecode.com/svn/branches/Gtk2@482 ef21e15d-ca94-4315-9c45-0d95b1b2e117 --- Dome/Namespaces.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Dome/Namespaces.py b/Dome/Namespaces.py index c283e1a..36921af 100644 --- a/Dome/Namespaces.py +++ b/Dome/Namespaces.py @@ -42,11 +42,6 @@ class Namespaces(g.GenericTreeModel): if iter < len(self.list) - 1: return iter + 1 - def add_new(self): - x = 1 - while ('ns%d' % x) in self.dict: x += 1 - self['ns%d' % x] = 'http://example.com' - def __setitem__(self, prefix, uri): if prefix in self.dict and self.dict[prefix] == uri: return @@ -55,13 +50,16 @@ class Namespaces(g.GenericTreeModel): if prefix in fixed_ns: raise Exception('That namespace prefix cannot be changed') - if prefix in self.dict: - del self[self.get_iter((self.list.index(prefix)))] + modifed = prefix in self.dict self.dict[prefix] = uri self.update_list() path = (self.list.index(prefix),) - self.emit('row-inserted', path, self.get_iter(path)) + + if modifed: + self.emit('row-changed', path, self.get_iter(path)) + else: + self.emit('row-inserted', path, self.get_iter(path)) def __delitem__(self, iter): prefix = self[iter][0] -- 2.11.4.GIT