X-Git-Url: http://git.onelab.eu/?p=sfa-gui.git;a=blobdiff_plain;f=SubmitPanel.py;fp=SubmitPanel.py;h=f3c10a9aecc18b656b498f610b6977e653606af8;hp=0000000000000000000000000000000000000000;hb=dd75c282952182b904fbfd26b2f87f5d39552630;hpb=9b1e2b7e901d9a7edc707916c52efe808cae6cfc diff --git a/SubmitPanel.py b/SubmitPanel.py new file mode 100644 index 0000000..f3c10a9 --- /dev/null +++ b/SubmitPanel.py @@ -0,0 +1,40 @@ +from pyjamas.ui.VerticalPanel import VerticalPanel +from pyjamas.ui.HorizontalPanel import HorizontalPanel +from pyjamas.ui.Button import Button +from pyjamas.ui.HTML import HTML +from pyjamas.ui import HasAlignment + +class SubmitPanel(VerticalPanel): + def __init__(self, sfadata): + VerticalPanel.__init__(self) + self.sfadata = sfadata + self.setSpacing(10) + + hp1 = HorizontalPanel() + hp1.setSpacing(10) + hp1.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE) + b1 = Button("Apply", self.apply) + hp1.add(b1) + hp1.add(HTML("Apply the configured changes to the slice")) + + hp2 = HorizontalPanel() + hp2.setSpacing(10) + hp2.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE) + b2 = Button("Reset", self.reset) + hp2.add(b2) + hp2.add(HTML("Reset the local slice configuration")) + + self.add(hp1) + self.add(hp2) + + def refresh(self): + pass + + def apply(self, sender): + self.sfadata.applyRSpec() + + def reset(self): + self.sfadata.refreshRSpec() + + +