gnome-games r8906 - in trunk: gnome-sudoku/src/lib gnome-sudoku/src/lib/gtk_goodies po
- From: thomashpa svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r8906 - in trunk: gnome-sudoku/src/lib gnome-sudoku/src/lib/gtk_goodies po
- Date: Fri, 27 Mar 2009 02:23:46 +0000 (UTC)
Author: thomashpa
Date: Fri Mar 27 02:23:46 2009
New Revision: 8906
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8906&view=rev
Log:
Simplify function and delete file that is now unneeded
Removed:
trunk/gnome-sudoku/src/lib/gtk_goodies/image_extras.py
Modified:
trunk/gnome-sudoku/src/lib/main.py
trunk/po/POTFILES.in
Modified: trunk/gnome-sudoku/src/lib/main.py
==============================================================================
--- trunk/gnome-sudoku/src/lib/main.py (original)
+++ trunk/gnome-sudoku/src/lib/main.py Fri Mar 27 02:23:46 2009
@@ -7,7 +7,7 @@
import gtk, gobject, gtk.glade, pango
import os, os.path
-from gtk_goodies import gconf_wrapper, Undo, dialog_extras, image_extras
+from gtk_goodies import gconf_wrapper, Undo, dialog_extras
import gsudoku, sudoku, saver, sudoku_maker, printing, sudoku_generator_gui
import game_selector
import time, threading
@@ -891,7 +891,7 @@
@simple_debug
def add_tracker (self,*args):
tracker_id = self.main_ui.gsd.create_tracker()
- pb=image_extras.pixbuf_transform_color(
+ pb = self.pixbuf_transform_color(
STOCK_PIXBUFS['tracks'],
self.main_ui.gsd.get_tracker_color(tracker_id),
)
@@ -902,7 +902,21 @@
_("Tracker %s")%(tracker_id+1)]
)
)
+
+ @simple_debug
+ def pixbuf_transform_color (self, pb, tc):
+ """Return new pixbuf with color changed to tc"""
+ pb_str = pb.get_pixels()
+ pb_str_new = ""
+
+ for alpha in pb_str[3::4]:
+ pb_str_new += chr(int(tc[0]*255))
+ pb_str_new += chr(int(tc[1]*255))
+ pb_str_new += chr(int(tc[2]*255))
+ pb_str_new += alpha
+ return gtk.gdk.pixbuf_new_from_data(pb_str_new, gtk.gdk.COLORSPACE_RGB, True, 8, pb.get_width(), pb.get_height(), pb.get_rowstride())
+
@simple_debug
def select_tracker (self, tracker_id):
for row in self.tracker_model:
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Fri Mar 27 02:23:46 2009
@@ -246,7 +246,6 @@
gnome-sudoku/src/lib/dialog_swallower.py
gnome-sudoku/src/lib/sudoku.py
gnome-sudoku/src/lib/gtk_goodies/dialog_extras.py
-gnome-sudoku/src/lib/gtk_goodies/image_extras.py
gnome-sudoku/src/lib/gtk_goodies/__init__.py
gnome-sudoku/src/lib/gtk_goodies/gconf_wrapper.py
gnome-sudoku/src/lib/gtk_goodies/Undo.py
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]