diff options
author | Jorge Saldivar Galli <jorgesaldivar@gmail.com> | 2010-05-20 18:56:58 (GMT) |
---|---|---|
committer | Jorge Saldivar Galli <jorgesaldivar@gmail.com> | 2010-05-20 18:56:58 (GMT) |
commit | 31d12f2ca21cce580443c01483760bca54881fa2 (patch) | |
tree | 529757d15dd5565cfe99acc44940e0744a7d308e | |
parent | 2b5521b666f2e39ef096fd53fd333f8cef314d1f (diff) |
Some code changed to works with sugar 0.82
-rw-r--r-- | poll.py | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -790,10 +790,15 @@ class PollBuilder(activity.Activity): self.show_all() def _button_choose_image_cb(self, button, data=None, data2=None): - chooser = ObjectChooser(_('Choose image'), self, - gtk.DIALOG_MODAL | - gtk.DIALOG_DESTROY_WITH_PARENT, \ - what_filter=mime.GENERIC_TYPE_IMAGE) + if hasattr(mime, 'GENERIC_TYPE_IMAGE'): + chooser = ObjectChooser(_('Choose image'), self, + gtk.DIALOG_MODAL | + gtk.DIALOG_DESTROY_WITH_PARENT, \ + what_filter=mime.GENERIC_TYPE_IMAGE) + else: + chooser = ObjectChooser(_('Choose image'), self, + gtk.DIALOG_MODAL | + gtk.DIALOG_DESTROY_WITH_PARENT) try: result = chooser.run() if result == gtk.RESPONSE_ACCEPT: |