From 77320f7918a453892ae4ba0aad411c54867859fc Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 12 Apr 2011 00:40:00 +0000 Subject: h-client:improved synchronize --- h-client/hclient.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'h-client/hclient.py') diff --git a/h-client/hclient.py b/h-client/hclient.py index f97cbd3..2ef8fff 100644 --- a/h-client/hclient.py +++ b/h-client/hclient.py @@ -90,13 +90,7 @@ class hclient: self.resetButton.set_sensitive(True) self.submitButton.set_sensitive(True) - self.tihbox.show() - self.bigIcon.set_from_file("img/devices/big/"+self.currentDevice.getIcon()) - if self.client.devices[code][2] == 'insert': - self.deviceInfoLabel.set_markup("this device is not present in the server database,\n would you like to insert it?") - else: - self.deviceInfoLabel.set_markup("this device is already present in the server database,\n would you like to update it?") - #self.updateStatus() + self.setDeviceInfoLabel() else: #make non sensitive the apply button @@ -108,6 +102,14 @@ class hclient: #self.updateStatus() + #set the top label + def setDeviceInfoLabel(self): + if self.currentDeviceCode != None: + self.bigIcon.set_from_file("img/devices/big/"+self.currentDevice.getIcon()) + if self.client.devices[self.currentDeviceCode][2] == 'insert': + self.deviceInfoLabel.set_markup("this device is not present in the server database,\n would you like to insert it?") + else: + self.deviceInfoLabel.set_markup("this device is already present in the server database,\n would you like to update it?") #set the pyGTK device entries def setEntries(self): @@ -211,6 +213,7 @@ class hclient: self.client.errors = [] self.client.setNode(self.serverEntry.get_text()) self.updateStatus() + self.synchronize(None) #close the preferences window def closePref(self,widget): @@ -225,7 +228,7 @@ class hclient: if self.client.isLogged(): self.applyChanges(None) self.client.submit(self.currentDeviceCode) - self.printErrors() + self.synchronize(None) self._submitFlag = False @@ -239,11 +242,12 @@ class hclient: if self.client.isLogged(): self.client.submit(self.currentDeviceCode) + self.synchronize(None) else: self._submitFlag = True self.openLoginWindow(None) - self.printErrors() + self.updateStatus() #logout to the server @@ -440,6 +444,7 @@ class hclient: self.printErrors() #print self.client.errors self.setEntries() + self.setDeviceInfoLabel() def printErrors(self): -- cgit v1.2.3