Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ground.py
diff options
context:
space:
mode:
Diffstat (limited to 'ground.py')
-rw-r--r--ground.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/ground.py b/ground.py
index 99611d2..ab5d07c 100644
--- a/ground.py
+++ b/ground.py
@@ -14,12 +14,12 @@
import os
import gtk
-import cStringIO
from gettext import gettext as _
from sugar.graphics.objectchooser import ObjectChooser
import theme
+from utils import pixbuf, pixbuf2str
def load():
from document import Document
@@ -36,7 +36,7 @@ class Ground:
if type == theme.RESTORED:
tmpfile = os.path.join(theme.SESSION_PATH, '.tmp.png')
file(tmpfile, 'w').write(image)
- self._orig = gtk.gdk.pixbuf_new_from_file(tmpfile)
+ self._orig = theme.pixbuf(tmpfile)
os.unlink(tmpfile)
self._filename = 'ground.png'
else:
@@ -47,12 +47,7 @@ class Ground:
return self._type != theme.PREINSTALLED
def read(self):
- def push(data, buffer):
- buffer.write(data)
-
- buffer = cStringIO.StringIO()
- self._orig.save_to_callback(push, 'png', user_data=buffer)
- return buffer.getvalue()
+ pixbuf2str(self._orig)
def filename(self):
return self._filename
@@ -65,7 +60,7 @@ class Ground:
def orig(self):
return self._orig
- def change(self):
+ def select(self):
if self._type != theme.CUSTOM:
return self
return theme.choose(