Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mmm_modules/image_category.py
diff options
context:
space:
mode:
Diffstat (limited to 'mmm_modules/image_category.py')
-rw-r--r--mmm_modules/image_category.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mmm_modules/image_category.py b/mmm_modules/image_category.py
index de133f5..a8c9740 100644
--- a/mmm_modules/image_category.py
+++ b/mmm_modules/image_category.py
@@ -27,6 +27,7 @@ from glob import glob
import logging
import md5
+from sugar import mime
from sugar.graphics.objectchooser import ObjectChooser
from borderframe import BorderFrame
@@ -212,8 +213,14 @@ class ImageSelectorWidget (gtk.Table):
def add_image (self, *args):#widget=None, response=None, *args):
""" Use to trigger and process the My Own Image selector. """
- chooser = ObjectChooser(_('Choose image'), None, #self._parent,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ if hasattr(mime, 'GENERIC_TYPE_IMAGE'):
+ chooser = ObjectChooser(_('Choose image'), None, #self._parent,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ what_filter=mime.GENERIC_TYPE_IMAGE)
+ else:
+ chooser = ObjectChooser(_('Choose image'), None, #self._parent,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+
try:
result = chooser.run()
if result == gtk.RESPONSE_ACCEPT: