~ubuntu-branches/debian/sid/nautilus-image-manipulator/sid

« back to all changes in this revision

Viewing changes to nautilus_image_manipulator/nautilus-image-manipulator-extension.py

  • Committer: Package Import Robot
  • Author(s): Emilien Klein
  • Date: 2011-11-22 23:32:00 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20111122233200-smrh298f0z6o35ll
Tags: 0.5-1
* New upstream release
  - Make sure that only valid filenames are passed (LP #711508 and
      LP#711509)
  - Better handling of zipfile creation
  - Do not allow appendString to end in "/", because the image would be
      called ".EXT", which is a hidden file in it's own folder
  - Various lower-level enhancements
    - Gracefully handle when ImageMagick is not installed (LP #877738)
    - Display an error message is DistUtilsExtra is not installed when
        updating the translations
* debian/copyright:
  - Use a versioned URL to indicate DEP-5 conformance

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
import os, subprocess, urllib, gettext
30
30
from gettext import gettext as _
 
31
from gettext import ngettext
31
32
gettext.textdomain('nautilus-image-manipulator')
32
33
 
33
34
from gi.repository import Nautilus, GObject
51
52
            if f.get_mime_type()[:6] == "image/":
52
53
                images.append(f)
53
54
 
54
 
        # Don't display this option in the menu if there is not a single images
55
 
        # in the selection
 
55
        # Don't display this option in the menu if there is not a single
 
56
        # image in the selection
56
57
        if not images:
57
58
            return
58
 
 
59
 
        # TODO: Update the extension's menu label and tooltip message
 
59
        
 
60
        extLabel = ngettext("_Resize image", "_Resize images", len(images))
 
61
        extTip = ngettext("Resize the selected image",
 
62
                          "Resize each selected image",
 
63
                          len(images))
 
64
        
60
65
        item = Nautilus.MenuItem(name='NautilusImageManipulator::resize',
61
 
                                 label=_("_Resize images..."),
62
 
                                 tip=_("Resize each selected image"))
 
66
                                 label=extLabel,
 
67
                                 tip=extTip)
63
68
        item.connect('activate', self.menu_activate_cb, images)
64
69
        return item,
65
70