Author: eallen
Date: 2008-08-25 14:27:29 -0400 (Mon, 25 Aug 2008)
New Revision: 2352
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Add new SaveParameter type for adding broker links
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:26:57 UTC (rev 2351)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:27:29 UTC (rev 2352)
@@ -731,6 +731,40 @@
def render_title(self, session):
return "Transient"
+class SavedField(RadioField):
+ def __init__(self, app, name, form):
+ super(SavedField, self).__init__(app, name, form)
+
+ param = Parameter(app, "param")
+ param.default = "saved"
+ self.add_parameter(param)
+ self.set_parameter(param)
+
+ option = self.Saved(app, "saved", form)
+ option.set_value(param.default)
+ self.add_option(option)
+
+ option = self.NotSaved(app, "notsaved", form)
+ option.set_value("notsaved")
+ self.add_option(option)
+
+ def render_title(self, session):
+ return "Restore if broker restarts?"
+
+ class Saved(RadioFieldOption):
+ def render_value(self, session):
+ return "saved"
+
+ def render_title(self, session):
+ return "Yes, restore if broker restarts"
+
+ class NotSaved(RadioFieldOption):
+ def render_value(self, session):
+ return "notsaved"
+
+ def render_title(self, session):
+ return "No, do not restore if broker restarts"
+
class ExclusivityField(RadioField):
def __init__(self, app, name, form):
super(ExclusivityField, self).__init__(app, name, form)