From b541ecb651c4a9d7612ac1eb6a2a86e3a01c8739 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Wed, 25 Nov 2009 20:37:22 +0100 Subject: [PATCH] Added a Password widget (new String.format) and minor GUI improvements. --- gen/__init__.py | 1 + gen/plone25/descriptors.py | 6 ++++-- gen/plone25/skin/edit.gif | Bin 0 -> 476 bytes gen/plone25/skin/macros.pt | 24 ++++++++++++++---------- gen/plone25/skin/ref.pt | 3 ++- pod/converter.py | 3 ++- 6 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 gen/plone25/skin/edit.gif diff --git a/gen/__init__.py b/gen/__init__.py index e9ecbba..bba5f87 100755 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -243,6 +243,7 @@ class String(Type): LINE = 0 TEXT = 1 XHTML = 2 + PASSWORD = 3 def __init__(self, validator=None, multiplicity=(0,1), index=None, default=None, optional=False, editDefault=False, format=LINE, show=True, page='main', group=None, move=0, indexed=False, diff --git a/gen/plone25/descriptors.py b/gen/plone25/descriptors.py index a8c3f8c..2d2c7fe 100644 --- a/gen/plone25/descriptors.py +++ b/gen/plone25/descriptors.py @@ -130,9 +130,11 @@ class ArchetypeFieldDescriptor: self.widgetType = 'RichWidget' self.fieldParams['allowable_content_types'] = ('text/html',) self.fieldParams['default_output_type'] = "text/html" - else: + elif self.appyType.format == String.PASSWORD: self.fieldType = 'StringField' - self.widgetType = 'StringWidget' + self.widgetType = 'PasswordWidget' + if self.appyType.width: + self.widgetParams['size'] = self.appyType.width def walkComputed(self): '''How to generate a computed field? We generate an Archetypes String diff --git a/gen/plone25/skin/edit.gif b/gen/plone25/skin/edit.gif new file mode 100644 index 0000000000000000000000000000000000000000..2c8d2ca20d2a1c6e46c8e0158d7db4cefa486f63 GIT binary patch literal 476 zcmd6kJxc;%0D#}rs8NT0K+qIHgBXd@6iGp}MT1LAZPgGoG+26-r$p3{Sy2g*P-_K+ zTOmYBLnfN}QFoqq=Y4s1@2SUKmp`ND7d#J-XL4fHId274khB2^d0A$kPI`@$J+%O` z3A-pVzlKjy#7yP|$MXVDPOU^rrEHz75LiLe+J<2?1PVfqWpG1Bm^#*KL0wlt)PPWu z8VrPD%okZ*T;dr*RUujZ5=EY+@sHB0u4^P&gs|a#FgULImfUr?=jd9w*^~rST6~SOMs9ZutBGWNUjTh=u|t vQ`m3nF^`4!&E1xesV@>m508#dW9J8#!GWtYbkG(@N2bU3Ztw1qP2l - + @@ -150,12 +150,15 @@ - + + + ******** + - +
When no tabs are shown, we provide an edit icon. @@ -539,9 +542,9 @@ tal:attributes="href python: contextObj.absolute_url() + '/skyn/view?phase=%s&pageName=%s' % (phase, thePage)"> @@ -718,7 +721,8 @@ Edit the element - + Delete the element diff --git a/gen/plone25/skin/ref.pt b/gen/plone25/skin/ref.pt index 1ed1c97..e6bf1b7 100644 --- a/gen/plone25/skin/ref.pt +++ b/gen/plone25/skin/ref.pt @@ -39,7 +39,8 @@ Edit the element - + Delete the element diff --git a/pod/converter.py b/pod/converter.py index 263a116..cfcbc02 100755 --- a/pod/converter.py +++ b/pod/converter.py @@ -91,7 +91,8 @@ class Converter: raise ConverterError(CANNOT_WRITE_RESULT % (res, oe)) def connect(self): '''Connects to OpenOffice''' - import socket + if os.name == 'nt': + import socket import uno from com.sun.star.connection import NoConnectException try: