[orca/introspection] Fix adding new entries to the pronunciation dictionary treeview



commit c1eb456ebf6a2adae28cfb9acf5269facf5754b0
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun Aug 28 14:49:36 2011 -0400

    Fix adding new entries to the pronunciation dictionary treeview

 src/orca/orca_gui_prefs.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 7a7e998..7cbceae 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -3055,14 +3055,13 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         - widget: the component that generated the signal.
         """
 
-        model, oldIter = self.pronunciationView.get_selection().get_selected()
+        model = self.pronunciationView.get_model()
         thisIter = model.append()
-
-        model.set(thisIter, ACTUAL, "", REPLACEMENT, "")
-        noRows = model.iter_n_children(None)
+        model.set(thisIter, ACTUAL, "", REPLACEMENT, "")        
+        path = model.get_path(thisIter)
         col = self.pronunciationView.get_column(0)
         self.pronunciationView.grab_focus()
-        self.pronunciationView.set_cursor(noRows-1, col, True) 
+        self.pronunciationView.set_cursor(path, col, True) 
 
     def pronunciationDeleteButtonClicked(self, widget):
         """Signal handler for the "clicked" signal for the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]