[PATCH] fix #1771 - paint overwrites file type instead of creating
Gonzalo Odiard
godiard at gmail.com
Fri Jun 11 00:22:36 EDT 2010
new file
http://bugs.sugarlabs.org/ticket/1771
---
OficinaActivity.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/OficinaActivity.py b/OficinaActivity.py
index c72576a..78bc8cf 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -140,8 +140,8 @@ class OficinaActivity(activity.Activity):
def read_file(self, file_path):
'''Read file from Sugar Journal.'''
+ print 'reading file', file_path, "mime_type",
self.metadata['mime_type']
- logging.debug('reading file %s', file_path)
pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)
@@ -155,6 +155,9 @@ class OficinaActivity(activity.Activity):
self._setup_handle = self.fixed.connect('size_allocate',
size_allocate_cb)
+ if self.metadata['mime_type'] != "image/png":
+ self._jobject.object_id = None
+
def write_file(self, file_path):
'''Save file on Sugar Journal. '''
--
1.6.6.1
--
Gonzalo Odiard
Responsable de Desarrollo
Sistemas Australes
--000e0cd70bb21149270488b98623
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I think it works, but i don't know if the right thing to do.<br><br>Fro=
m 97fb2adb1ea97a472e020244ae7a2d22c7a94db3 Mon Sep 17 00:00:00 2001<br>From=
: Gonzalo Odiard <<a href=3D"mailto:godiard at gmail.com">godiard at gmail.com=
</a>><br>
Date: Fri, 11 Jun 2010 01:22:36 -0300<br>Subject: [PATCH] fix #1771 - paint=
overwrites file type instead of creating new file<br><br><a href=3D"http:/=
/bugs.sugarlabs.org/ticket/1771">http://bugs.sugarlabs.org/ticket/1771</a><=
br>
---<br>=A0OficinaActivity.py |=A0=A0=A0 5 ++++-<br>=A01 files changed, 4 in=
sertions(+), 1 deletions(-)<br><br>diff --git a/OficinaActivity.py b/Oficin=
aActivity.py<br>index c72576a..78bc8cf 100644<br>--- a/OficinaActivity.py<b=
r>+++ b/OficinaActivity.py<br>
@@ -140,8 +140,8 @@ class OficinaActivity(activity.Activity):<br>=A0<br>=A0=
=A0=A0=A0 def read_file(self, file_path):<br>=A0=A0=A0=A0=A0=A0=A0=A0 '=
''Read file from Sugar Journal.'''<br>+=A0=A0=A0=A0=A0=
=A0=A0 print 'reading file', file_path, "mime_type", self=
.metadata['mime_type']<br>
=A0<br>-=A0=A0=A0=A0=A0=A0=A0 logging.debug('reading file %s', file=
_path)<br>=A0<br>=A0=A0=A0=A0=A0=A0=A0=A0 pixbuf =3D gtk.gdk.pixbuf_new_fro=
m_file(file_path)<br>=A0<br>@@ -155,6 +155,9 @@ class OficinaActivity(activ=
ity.Activity):<br>=A0=A0=A0=A0=A0=A0=A0=A0 self._setup_handle =3D self.fixe=
d.connect('size_allocate',<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 size_allocate_cb)<br>=A0<b=
r>+=A0=A0=A0=A0=A0=A0=A0 if self.metadata['mime_type'] !=3D "i=
mage/png":<br>+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 self._jobject.object_=
id =3D None<br>+<br>=A0=A0=A0=A0 def write_file(self, file_path):<br>=A0=A0=
=A0=A0=A0=A0=A0=A0 '''Save file on Sugar Journal. ''=
9;<br>
=A0<br>-- <br>1.6.6.1<br><br clear=3D"all"><br>-- <br>Gonzalo Odiard<br>Res=
ponsable de Desarrollo<br>Sistemas Australes<br><br>
--000e0cd70bb21149270488b98623--
More information about the Sugar-devel
mailing list