gnome-specimen r32 - branches/import-from-bzr
- From: wbolster svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-specimen r32 - branches/import-from-bzr
- Date: Tue, 17 Jun 2008 18:52:22 +0000 (UTC)
Author: wbolster
Date: Tue Jun 17 18:52:22 2008
New Revision: 32
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=32&view=rev
Log:
* specimenwindow.py:
- Use model.get_value() instead of model.get() if we're
only getting a single value
- Copying font names to the clipboard works now!
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:22 2008
@@ -151,8 +151,8 @@
'Sorting function for the font listing'
# We need the names for sorting
- name1 = model.get(iter1, 0)[0]
- name2 = model.get(iter2, 0)[0]
+ name1 = model.get_value(iter1, 0)
+ name2 = model.get_value(iter2, 0)
# name2 can be None in some cases
if name2 is None: return -1
@@ -225,7 +225,7 @@
def cell_data_cb(self, column, cell, model, iter, data=None):
if model.get_path(iter)[0] % 2 == 0:
# this is a name row
- (name,) = model.get(iter, 0)
+ name = model.get_value(iter, 0)
self._set_cell_attributes_for_name_cell(cell, name)
else:
# this is a preview row
@@ -437,7 +437,20 @@
def on_copy_item_activate(self, widget, data=None):
'Callback for the Edit->Copy menu item'
- print 'on_copy_item_clicked'
+
+ # Only use one clipboard instance during the lifetime of the
+ # application.
+ try:
+ self.clipboard
+ except (AttributeError):
+ self.clipboard = gtk.Clipboard()
+ else:
+ (model, iter) = self.previews_treeview.get_selection().get_selected()
+ if iter is not None:
+ # Copy the font name to the clipboard.
+ name = model.get_value(iter, 0);
+ self.clipboard.set_text(name)
+ self.clipboard.store()
def on_clear_item_activate(self, widget, data=None):
'Callback for the Edit->Clear menu item'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]