Merge lp:~flozz/nautilus-image-manipulator/nautilus-3.2-support into lp:nautilus-image-manipulator

Proposed by Fabien LOISON on 2011-10-10
Status: Merged
Approved by: Emilien Klein on 2011-10-14
Approved revision: 92
Merge reported by: Emilien Klein
Merged at revision: not available
Proposed branch: lp:~flozz/nautilus-image-manipulator/nautilus-3.2-support
Merge into: lp:nautilus-image-manipulator
Diff against target: 54 lines (+15/-10)
1 file modified
nautilus_image_manipulator/nautilus-image-manipulator-extension.py (+15/-10)
To merge this branch: bzr merge lp:~flozz/nautilus-image-manipulator/nautilus-3.2-support
Reviewer Review Type Date Requested Status
Emilien Klein 2011-10-10 Approve on 2011-10-14
Review via email: mp+78864@code.launchpad.net

Commit message

Make Nautilus Image Manipulator work with Nautilus 3.2

Description of the change

Makes Nautilus Image Manipulator working with Nautilus 3.2

NOTE: Works with the patched version of Nautilus Python, see this bug report for more informations:
https://bugzilla.gnome.org/show_bug.cgi?id=660348

To post a comment you must log in.
Emilien Klein (emilien-klein) wrote :

Thanks Fabien, everything seems fine. However I don't have a development environment yet that has Nautilus 3.2, so I don't want to merge it yet. As soon as I can handle this I'll merge it in. Thanks!

Emilien Klein (emilien-klein) wrote :

Your patch, in conjunction with the package in -proposed (see [0]), makes the extension work in Ubuntu 11.10. Thanks again!

[0] https://bugs.launchpad.net/ubuntu/+source/nautilus-python/+bug/858925

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus_image_manipulator/nautilus-image-manipulator-extension.py'
2--- nautilus_image_manipulator/nautilus-image-manipulator-extension.py 2011-05-17 05:19:57 +0000
3+++ nautilus_image_manipulator/nautilus-image-manipulator-extension.py 2011-10-10 15:58:23 +0000
4@@ -25,36 +25,41 @@
5 # or
6 # /usr/lib/nautilus/extensions-2.0/python/
7
8-import nautilus, os, subprocess, urllib, gettext
9+
10+import os, subprocess, urllib, gettext
11 from gettext import gettext as _
12 gettext.textdomain('nautilus-image-manipulator')
13
14-class BackgroundImageExtension(nautilus.MenuProvider):
15+from gi.repository import Nautilus, GObject
16+
17+
18+class BackgroundImageExtension(GObject.GObject, Nautilus.MenuProvider):
19 def __init__(self):
20 pass
21-
22+
23 def menu_activate_cb(self, menu, images):
24 args = ["nautilus-image-manipulator"]
25 for ff in images:
26 # Remove "file://" and unquote the filename
27 args.extend(("-f", urllib.unquote(ff.get_uri()[7:])))
28 retVal = subprocess.call(args)
29-
30+
31 def get_file_items(self, window, files):
32 images = []
33 # Extract only the images from the list of selected files
34 for f in files:
35 if f.get_mime_type()[:6] == "image/":
36 images.append(f)
37-
38- # Don't display this option in the menu if there is not a single image in the selection
39+
40+ # Don't display this option in the menu if there is not a single images
41+ # in the selection
42 if not images:
43 return
44-
45+
46 # TODO: Update the extension's menu label and tooltip message
47- item = nautilus.MenuItem('NautilusImageManipulator::resize',
48- _("_Resize images..."),
49- _("Resize each selected image"))
50+ item = Nautilus.MenuItem(name='NautilusImageManipulator::resize',
51+ label=_("_Resize images..."),
52+ tip=_("Resize each selected image"))
53 item.connect('activate', self.menu_activate_cb, images)
54 return item,
55

Subscribers

People subscribed via source and target branches

to all changes: