Merge lp:~methanal-developers/methanal/808487-modaldialog-liveform-actions into lp:methanal

Proposed by Jonathan Jacobs
Status: Merged
Approved by: Tristan Seligmann
Approved revision: 176
Merged at revision: 176
Proposed branch: lp:~methanal-developers/methanal/808487-modaldialog-liveform-actions
Merge into: lp:methanal
Diff against target: 33 lines (+9/-7)
1 file modified
methanal/widgets.py (+9/-7)
To merge this branch: bzr merge lp:~methanal-developers/methanal/808487-modaldialog-liveform-actions
Reviewer Review Type Date Requested Status
Tristan Seligmann Approve
Review via email: mp+67525@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tristan Seligmann (mithrandi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'methanal/widgets.py'
2--- methanal/widgets.py 2011-03-09 14:45:01 +0000
3+++ methanal/widgets.py 2011-07-11 11:06:08 +0000
4@@ -26,8 +26,8 @@
5 from methanal.imethanal import IColumn
6 from methanal.util import getArgsDict
7 from methanal.view import (
8- liveFormFromAttributes, SimpleForm, FormInput, LiveForm, SubmitAction,
9- ActionButton, ActionContainer, SelectInput)
10+ liveFormFromAttributes, SimpleForm, FormInput, LiveForm, ActionButton,
11+ SelectInput)
12 from methanal.model import Value
13 from methanal.errors import InvalidIdentifier
14
15@@ -628,14 +628,16 @@
16 class ModalDialogForm(LiveForm):
17 """
18 L{methanal.view.LiveForm} for L{methanal.widgets.ModalDialog}.
19+
20+ @type addCancelAction: C{bool}
21+ @ivar addCancelAction: Add the cancel action? Defaults to C{True}.
22 """
23 jsClass = u'Methanal.Widgets.ModalDialogForm'
24
25- def __init__(self, actions=None, **kw):
26- if actions is None:
27- actions = ActionContainer(
28- actions=[SubmitAction(name=u'OK'), CancelAction()])
29- super(ModalDialogForm, self).__init__(actions=actions, **kw)
30+ def __init__(self, addCancelAction=True, **kw):
31+ super(ModalDialogForm, self).__init__(**kw)
32+ if addCancelAction:
33+ self.actions.addAction(CancelAction())
34
35
36

Subscribers

People subscribed via source and target branches

to all changes: