Use img.name if filename is not available (bug #158392). Patch by Joao S.

2004-11-16  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/gimpui.py: Use img.name if filename is not
        available (bug #158392). Patch by Joao S. O. Bueno.
This commit is contained in:
Manish Singh
2004-11-17 03:11:46 +00:00
committed by Manish Singh
parent 5020e691a8
commit 027a85b17b
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-11-16 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/gimpui.py: Use img.name if filename is not
available (bug #158392). Patch by Joao S. O. Bueno.
2004-11-16 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/gimpfu.py

View File

@ -39,7 +39,11 @@ def ImageMenu(constraint=None, callback=None, data=None):
for img in gimp.image_list():
if constraint and not constraint(img):
continue
items.append((img.filename, img))
if not img.filename:
filename = img.name
else:
filename = img.filename
items.append((filename, img))
items.sort()
return _createMenu(items, callback, data)
@ -47,6 +51,8 @@ def LayerMenu(constraint=None, callback=None, data=None):
items = []
for img in gimp.image_list():
filename = img.filename
if not filename:
filename = img.name
for layer in img.layers:
if constraint and not constraint(img, layer):
continue
@ -59,6 +65,8 @@ def ChannelMenu(constraint=None, callback=None, data=None):
items = []
for img in gimp.image_list():
filename = img.filename
if not filename:
filename = img.name
for channel in img.channels:
if constraint and not constraint(img, channel):
continue
@ -71,6 +79,8 @@ def DrawableMenu(constraint=None, callback=None, data=None):
items = []
for img in gimp.image_list():
filename = img.filename
if not filename:
filename = img.name
for drawable in img.layers + img.channels:
if constraint and not constraint(img, drawable):
continue