Added SubmitPanel, HelpPanel for PlanetLab and VINI
[sfa-gui.git] / SubmitPanel.py
diff --git a/SubmitPanel.py b/SubmitPanel.py
new file mode 100644 (file)
index 0000000..f3c10a9
--- /dev/null
@@ -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()
+        
+
+