Read ~/.sfi/sfi_config
[sfa-gui.git] / SubmitPanel.py
1 from pyjamas.ui.VerticalPanel import VerticalPanel
2 from pyjamas.ui.HorizontalPanel import HorizontalPanel
3 from pyjamas.ui.Button import Button
4 from pyjamas.ui.HTML import HTML
5 from pyjamas.ui import HasAlignment
6
7 class SubmitPanel(VerticalPanel):
8     def __init__(self, sfadata):
9         VerticalPanel.__init__(self)
10         self.sfadata = sfadata
11         self.setSpacing(10)
12         
13         hp1 = HorizontalPanel()
14         hp1.setSpacing(10)
15         hp1.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
16         b1 = Button("Apply", self.apply)
17         hp1.add(b1)
18         hp1.add(HTML("Apply the configured changes to the slice"))
19                 
20         hp2 = HorizontalPanel()
21         hp2.setSpacing(10)
22         hp2.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
23         b2 = Button("Reset", self.reset)
24         hp2.add(b2)
25         hp2.add(HTML("Reset the local slice configuration"))
26         
27         self.add(hp1)
28         self.add(hp2)
29         self.setStyleName("ks-layouts")
30         
31     def refresh(self):
32         pass
33                     
34     def apply(self, sender):
35         self.sfadata.applyRSpec()
36
37     def reset(self, sender):
38         self.sfadata.refreshRSpec()
39         
40
41