gnome-specimen r92 - in trunk-from-bzr: . specimen
- From: wbolster svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-specimen r92 - in trunk-from-bzr: . specimen
- Date: Tue, 17 Jun 2008 18:42:48 +0000 (UTC)
Author: wbolster
Date: Tue Jun 17 18:42:48 2008
New Revision: 92
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=92&view=rev
Log:
* specimen/specimenwindow.py:
- Update button sensitivity correctly
Modified:
trunk-from-bzr/ (props changed)
trunk-from-bzr/specimen/specimenwindow.py
Modified: trunk-from-bzr/specimen/specimenwindow.py
==============================================================================
--- trunk-from-bzr/specimen/specimenwindow.py (original)
+++ trunk-from-bzr/specimen/specimenwindow.py Tue Jun 17 18:42:48 2008
@@ -263,6 +263,7 @@
# setup the treeselection
self.previews_treeview_selection = self.previews_treeview.get_selection()
self.previews_treeview_selection.set_select_function(self._set_preview_row_selection)
+ self.previews_treeview_selection.connect('changed', self.update_button_sensitivity)
def cell_data_cb(self, column, cell, model, treeiter, data=None):
if model.get_path(treeiter)[0] % 2 == 0:
@@ -579,15 +580,20 @@
def update_button_sensitivity(self, *args):
'Updates the button sensitivity'
- # Add button is only sensitive if a font is selected in the fonts pane
+ # The Add button is only sensitive if a font is selected in the fonts
+ # pane (left pane)
model, rows = self.fonts_treeview.get_selection().get_selected_rows()
add_enabled = (len(rows) > 0)
self.buttons['add'].set_sensitive(add_enabled)
- # Remove and Clear buttons are only sensitive if the list of previews
- # is not empty.
+ # The Remove button is only sensitive if a font is selected in the
+ # preview pane (right pane)
+ model, rows = self.previews_treeview.get_selection().get_selected_rows()
+ remove_enabled = (len(rows) > 0)
+ self.buttons['remove'].set_sensitive(remove_enabled)
+
+ # The Clear button is only sensitive if the number of previews > 0
has_previews = (self.num_previews() > 0)
- self.buttons['remove'].set_sensitive(has_previews)
self.buttons['clear'].set_sensitive(has_previews)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]