aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-03-31 09:11:14 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-03-31 09:11:14 +0000
commit2444b6adb8cf240c6a024d661ee6d2756c66f1c6 (patch)
tree5c84a0142752450f473027752fd65624b20b1bb2
parent80569fc6fdacd64ff61f75ab24991b488dd24143 (diff)
start the integration of the submit button
-rw-r--r--h-client/hclient.py42
1 files changed, 31 insertions, 11 deletions
diff --git a/h-client/hclient.py b/h-client/hclient.py
index e8783b8..c154579 100644
--- a/h-client/hclient.py
+++ b/h-client/hclient.py
@@ -86,11 +86,13 @@ class hclient:
#make sensitive the apply button
self.applyButton.set_sensitive(True)
self.resetButton.set_sensitive(True)
+ self.submitButton.set_sensitive(True)
else:
#make non sensitive the apply button
self.applyButton.set_sensitive(False)
self.resetButton.set_sensitive(False)
+ self.submitButton.set_sensitive(False)
self.currentDevice = None
@@ -248,20 +250,23 @@ class hclient:
def printErrors(self):
+ #destroy the error bar HBox
+ if hasattr(self, "errorBarHBox"):
+ self.errorBarHBox.destroy()
+
if len(self.client.errors) > 0:
- sw = gtk.ScrolledWindow()
- #sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
- sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER)
- hbox = gtk.HBox(False, 0)
+
+ #self.errorBar.set_shadow_type(gtk.SHADOW_ETCHED_IN)
+
+ self.errorBarHBox = gtk.HBox(False, 0)
for error in self.client.errors:
label = gtk.Label("error: " + error)
- hbox.pack_start(label, False, True, 0)
+ self.errorBarHBox.pack_start(label, False, True, 10)
- sw.add_with_viewport(hbox)
- sw.set_border_width(5)
- sw.show_all()
- self.bottomWindow.add(sw)
-
+ self.errorBar.add_with_viewport(self.errorBarHBox)
+
+ self.errorBar.show_all()
+
self.client.errors = []
#another callback
@@ -295,6 +300,15 @@ class hclient:
self.centerWindow = gtk.HBox(False, 0)
self.bottomWindow = gtk.HBox(False, 0)
+ self.errorBar = gtk.ScrolledWindow()
+ self.errorBar.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER)
+ self.errorBar.set_border_width(5)
+ self.errorBar.set_size_request(-1,50)
+ self.bottomWindow.add(self.errorBar)
+ self.errorBarHBox = gtk.HBox(False, 0)
+ self.errorBar.add_with_viewport(self.errorBarHBox)
+ self.errorBar.show_all()
+
## build the toolbar ##
toolbar = gtk.Toolbar()
toolbar.set_tooltips(True)
@@ -361,7 +375,7 @@ class hclient:
self.tree.set_model(self.treestore)
treesw = gtk.ScrolledWindow()
- treesw.set_size_request(50,431)
+ treesw.set_size_request(50,441)
treesw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
treesw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
treesw.add(self.tree)
@@ -520,9 +534,14 @@ class hclient:
self.resetButton = gtk.Button(stock=gtk.STOCK_REVERT_TO_SAVED)
self.resetButton.set_sensitive(False)
self.resetButton.connect("clicked", self.resetChanges)
+ #submit button
+ self.submitButton = gtk.Button("Submit")
+ self.submitButton.set_sensitive(False)
+ #self.resetButton.connect("clicked", self.resetChanges)
hboxBelowEntries.pack_end(self.applyButton, False, True, 0)
hboxBelowEntries.pack_end(self.resetButton, False, True, 0)
+ hboxBelowEntries.pack_end(self.submitButton, False, True, 0)
hboxBelowEntries.show_all()
#start the left vertical box
@@ -548,6 +567,7 @@ class hclient:
self.bottomWindow.show_all()
self.leftWindow.show()
self.window.show()
+ self.synchronize(None);
def main():
gtk.main()