gnome-specimen r44 - branches/import-from-bzr



Author: wbolster
Date: Tue Jun 17 18:52:35 2008
New Revision: 44
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=44&view=rev

Log:
* specimenwindow.py:
  - Select newly added previews after addition, so that
    the remove button removes the right one.


Modified:
   branches/import-from-bzr/   (props changed)
   branches/import-from-bzr/specimenwindow.py

Modified: branches/import-from-bzr/specimenwindow.py
==============================================================================
--- branches/import-from-bzr/specimenwindow.py	(original)
+++ branches/import-from-bzr/specimenwindow.py	Tue Jun 17 18:52:35 2008
@@ -303,6 +303,9 @@
         self.previews_store.append([name, family, face])
         self.previews_store.append([name, family, face])
 
+        # Select the new entry in the preview listing, so that it can be quickly removed using delete
+        self.select_last_preview()
+
     def schedule_update_previews(self, *args):
         'Schedules an update of the previews'
 
@@ -328,6 +331,12 @@
         number_of_rows = self.previews_store.iter_n_children(None)
         return number_of_rows / 2
 
+    def select_last_preview(self):
+        'Selects the last row in the preview pane'
+
+        path = (self.previews_store.iter_n_children(None) - 2)
+        self.previews_treeview.get_selection().select_path(path)
+
     def delete_selected(self):
         model, treeiter = self.previews_treeview.get_selection().get_selected()
         if treeiter is not None:



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