plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new) allow String or

2006-09-21  Sven Neumann  <sven@gimp.org>

	* plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new)
	* plug-ins/pygimp/pygimp-drawable.c (drw_set_name): allow String
	or Unicode objects.

	* plug-ins/pygimp/plug-ins/colorxhtml.py: prepared for translation.
This commit is contained in:
Sven Neumann
2006-09-21 11:19:43 +00:00
committed by Sven Neumann
parent b69be084b1
commit 48e52e674a
6 changed files with 66 additions and 18 deletions

View File

@ -1,3 +1,11 @@
2006-09-21 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/gimpui.override (_wrap_gimp_dialog_new)
* plug-ins/pygimp/pygimp-drawable.c (drw_set_name): allow String
or Unicode objects.
* plug-ins/pygimp/plug-ins/colorxhtml.py: prepared for translation.
2006-09-21 Sven Neumann <sven@gimp.org> 2006-09-21 Sven Neumann <sven@gimp.org>
* plug-ins/gfig/gfig-dialog.c: pass correct parameters to * plug-ins/gfig/gfig-dialog.c: pass correct parameters to
@ -8,7 +16,6 @@
2006-09-21 Sven Neumann <sven@gimp.org> 2006-09-21 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/test-sphere.scm ("script-fu-test-sphere"):
* app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1): * app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1):
use the same code on all platforms. The optimization for bytes == 4 use the same code on all platforms. The optimization for bytes == 4
was pointless anyway. was pointless anyway.

View File

@ -556,7 +556,7 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
for (i = 0; i < len; i += 2) { for (i = 0; i < len; i += 2) {
PyObject *text = PyTuple_GetItem(py_buttons, i); PyObject *text = PyTuple_GetItem(py_buttons, i);
PyObject *id = PyTuple_GetItem(py_buttons, i + 1); PyObject *id = PyTuple_GetItem(py_buttons, i + 1);
if (!PyString_Check(text)) { if (!PyString_Check(text) && !PyUnicode_Check(text)) {
gtk_object_destroy(GTK_OBJECT(self->obj)); gtk_object_destroy(GTK_OBJECT(self->obj));
self->obj = NULL; self->obj = NULL;
PyErr_SetString(PyExc_RuntimeError, PyErr_SetString(PyExc_RuntimeError,

View File

@ -25,6 +25,8 @@ import os.path
import gimp import gimp
from gimpfu import * from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=1)
(CHARS_SOURCE, CHARS_FILE, CHARS_PARAMETER) = range(3) (CHARS_SOURCE, CHARS_FILE, CHARS_PARAMETER) = range(3)
escape_table = { escape_table = {
@ -101,7 +103,7 @@ def colorxhtml(img, drawable, filename, raw_filename,
pr = drawable.get_pixel_rgn(0, 0, width, height, False, False) pr = drawable.get_pixel_rgn(0, 0, width, height, False, False)
gimp.progress_init("Saving '%s' as COLORXHTML..." % filename) gimp.progress_init(_("Saving as colored XHTML"))
style = style_def % size style = style_def % size
@ -178,24 +180,26 @@ class RowIterator:
register( register(
"file-colorxhtml-save", "file-colorxhtml-save",
"Saves the image as colored XHTML text", _("Save the image as colored XHTML"),
"Saves the image as colored XHTML text (based on perl version by Marc Lehmann)", "Saves the image as colored XHTML text (based on Perl version by Marc Lehmann)",
"Manish Singh and Carol Spears", "Manish Singh and Carol Spears",
"Manish Singh and Carol Spears", "Manish Singh and Carol Spears",
"2003", "2003",
"Colored XHTML", N_("Colored XHTML"),
"RGB", "RGB",
[ [
(PF_RADIO, "source", "Where to take the characters from", 0, (PF_RADIO, "source", _("Character source"), 0,
(("Source code", CHARS_SOURCE), ((_("Source code"), CHARS_SOURCE),
("Text file", CHARS_FILE), (_("Text file"), CHARS_FILE),
("Entry box", CHARS_PARAMETER))), (_("Entry box"), CHARS_PARAMETER))),
(PF_FILE, "characters", "The filename to read or the characters to use", (PF_FILE, "characters", _("File to read or characters to use"),
""), ""),
(PF_INT, "font-size", "The font size in pixels", 10), (PF_INT, "font-size", _("Font size in pixels"), 10),
(PF_BOOL, "separate", "Separate CSS file", True) (PF_BOOL, "separate", _("Write a separate CSS file"), True)
], ],
[], [],
colorxhtml, menu="<Save>", on_query=register_save) colorxhtml, on_query=register_save,
menu="<Save>", domain=("gimp20-python", gimp.locale_directory)
)
main() main()

View File

@ -931,7 +931,7 @@ drw_set_name(PyGimpDrawable *self, PyObject *value, void *closure)
return -1; return -1;
} }
if (!PyUnicode_Check(value)) { if (!PyString_Check(value) && !PyUnicode_Check(value)) {
PyErr_SetString(PyExc_TypeError, "type mismatch"); PyErr_SetString(PyExc_TypeError, "type mismatch");
return -1; return -1;
} }

View File

@ -5,5 +5,6 @@ plug-ins/pygimp/gimpfu.py
plug-ins/pygimp/gimpui.py plug-ins/pygimp/gimpui.py
plug-ins/pygimp/procbrowser.c plug-ins/pygimp/procbrowser.c
plug-ins/pygimp/plug-ins/colorxhtml.py
plug-ins/pygimp/plug-ins/gimpcons.py plug-ins/pygimp/plug-ins/gimpcons.py
plug-ins/pygimp/plug-ins/gtkcons.py plug-ins/pygimp/plug-ins/gtkcons.py

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gimp-python HEAD\n" "Project-Id-Version: gimp-python HEAD\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-09-20 13:45+0200\n" "POT-Creation-Date: 2006-09-21 12:25+0200\n"
"PO-Revision-Date: 2006-09-20 13:18+0200\n" "PO-Revision-Date: 2006-09-21 12:27+0200\n"
"Last-Translator: Sven Neumann <sven@gimp.org>\n" "Last-Translator: Sven Neumann <sven@gimp.org>\n"
"Language-Team: German <gnome-de@gnome.org>\n" "Language-Team: German <gnome-de@gnome.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -40,6 +40,42 @@ msgstr "Python-Fu Farbauswahl"
msgid "Python Procedure Browser" msgid "Python Procedure Browser"
msgstr "Python Prozedurbrowser" msgstr "Python Prozedurbrowser"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:106
msgid "Saving as colored XHTML"
msgstr "Speichere als farbiges XHTML"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:188
msgid "Colored XHTML"
msgstr "Farbiges XHTML"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:191
msgid "Character source"
msgstr "Quelle für Buchstaben"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:192
msgid "Source code"
msgstr "Quellcode"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:193
msgid "Text file"
msgstr "Textdatei"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:194
msgid "Entry box"
msgstr "Eingabefeld"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:195
msgid "File to read or characters to use"
msgstr "Dateiname oder Buchstaben"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:197
msgid "Font size in pixels"
msgstr "Schriftgrösse in Pixeln"
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:198
msgid "Write a separate CSS file"
msgstr "Erstelle separate CSS Datei"
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:44 #: ../plug-ins/pygimp/plug-ins/gimpcons.py:44
msgid "Python Console" msgid "Python Console"
msgstr "Python Konsole" msgstr "Python Konsole"