aboutsummaryrefslogtreecommitdiff
path: root/h-client
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-12 00:40:00 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-12 00:40:00 +0000
commit77320f7918a453892ae4ba0aad411c54867859fc (patch)
treebbe15a2366be077a523546763f5fc60f65678c42 /h-client
parent9fb4924d5aa544bc51b3f5811772485fe865ca81 (diff)
h-client:improved synchronize
Diffstat (limited to 'h-client')
-rw-r--r--h-client/hclient.py23
-rw-r--r--h-client/hlibrary.py9
2 files changed, 17 insertions, 15 deletions
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 <b>insert</b> it?")
- else:
- self.deviceInfoLabel.set_markup("this device is already present in the server database,\n would you like to <b>update</b> 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 <b>insert</b> it?")
+ else:
+ self.deviceInfoLabel.set_markup("this device is already present in the server database,\n would you like to <b>update</b> 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):
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index cc25edc..c86c66c 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -570,14 +570,11 @@ class Client:
#find the class
#Class = dev[1]
vendorid_productid = key[2:]
- #find the controller
- #controller = self.getController(Class)
- ##perform an http request
- #self.request.contents = ''
+ #reset the device params
+ dev[2] = 'insert'
+ dev[3] = '0'
- #result = self.request.perform('download/' + controller + '/en')
-
#parse the xml database
try:
xmldoc = minidom.parseString(self.request.contents)