aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-05-01 16:27:46 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-05-01 16:27:46 +0000
commitb01d7818be154028a757be81e5eea70061d97882 (patch)
tree9d71ba07f11e2da9825c1a2ace4a0513b840d694
parentdfdf11645e1abc61d3bc2143f26e2dc3e59289fc (diff)
h-client: unknown devices now listed in the device tree
-rw-r--r--h-client/hclient.py37
-rw-r--r--h-client/hlibrary.py8
2 files changed, 34 insertions, 11 deletions
diff --git a/h-client/hclient.py b/h-client/hclient.py
index 2cd8d5c..1a9f1fe 100644
--- a/h-client/hclient.py
+++ b/h-client/hclient.py
@@ -88,22 +88,33 @@ class hclient:
self.setEntries()
#make sensitive the apply button
- self.applyButton.set_sensitive(True)
- self.resetButton.set_sensitive(True)
- self.submitButton.set_sensitive(True)
+ if self.currentDevice.getType() != 'unknown':
+ self.enableButtons()
+ else:
+ self.disableButtons()
self.setDeviceInfoLabel()
else:
#make non sensitive the apply button
- self.applyButton.set_sensitive(False)
- self.resetButton.set_sensitive(False)
- self.submitButton.set_sensitive(False)
+ self.disableButtons()
self.currentDevice = None
self.currentDeviceCode = None
#self.updateStatus()
+ #enable the bottom buttons
+ def enableButtons(self):
+ self.applyButton.set_sensitive(True)
+ self.resetButton.set_sensitive(True)
+ self.submitButton.set_sensitive(True)
+
+ #disable the bottom buttons
+ def disableButtons(self):
+ self.applyButton.set_sensitive(False)
+ self.resetButton.set_sensitive(False)
+ self.submitButton.set_sensitive(False)
+
#set the top label
def setDeviceInfoLabel(self):
if self.currentDeviceCode != None:
@@ -590,8 +601,9 @@ class hclient:
def delete_event_login(self, widget, event, data=None):
self._submitFlag = False
return False
-
-
+
+
+
def delete_event(self, widget, event, data=None):
gtk.main_quit()
return False
@@ -706,12 +718,14 @@ class hclient:
if key[0] == 'u':
self.treestore.append(usb, [dev[0].getType(),key,400,gtk.gdk.pixbuf_new_from_file('img/devices/small/'+dev[0].getIcon()),4])
+ self.tree.set_model(self.treestore)
+
selection = self.tree.get_selection()
selection.connect('changed', self.setCurrentDevice)
self.tree.append_column(self.devices)
- self.tree.set_model(self.treestore)
+
treesw = gtk.ScrolledWindow()
treesw.set_size_request(110,401)
@@ -965,8 +979,6 @@ class hclient:
self.bottomWindow.show_all()
self.leftWindow.show()
self.window.show()
- self.synchronize(None)
- self.updateStatus()
#select the first device
self.tree.get_selection().select_path(0)
@@ -976,6 +988,9 @@ class hclient:
path = ts.get_path(next)
self.tree.get_selection().select_path(path)
+ self.synchronize(None)
+ self.updateStatus()
+
#self.logoutButton.hide()
def main():
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 6c3803c..b78f452 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -421,6 +421,10 @@ class Client:
'0701ff' : {
'type' : 'printer',
'controller': 'printers'
+ },
+ '255255255' : {
+ 'type' : 'unknown',
+ 'controller': 'unknown'
}
}
@@ -484,6 +488,8 @@ class Client:
return Videocard()
elif Class == '070100' or Class == '070101' or Class == '070102' or Class == '070103' or Class == '0701ff':
return Printer()
+ elif Class == '255255255':
+ return Unknown()
else:
return None
@@ -574,6 +580,8 @@ class Client:
def addLeadingZero(self,string):
if len(string) == 1:
return '0'+string
+ else:
+ return string
def createDevices(self):