diff options
Diffstat (limited to 'h-client/hclient.py')
-rw-r--r-- | h-client/hclient.py | 74 |
1 files changed, 44 insertions, 30 deletions
diff --git a/h-client/hclient.py b/h-client/hclient.py index f0198b2..709165a 100644 --- a/h-client/hclient.py +++ b/h-client/hclient.py @@ -87,27 +87,32 @@ class hclient: self.applyButton.set_sensitive(True) self.resetButton.set_sensitive(True) + else: + + self.currentDevice = None + #set the pyGTK device entries def setEntries(self): - #set the model entry - self.setModelEntry() - #set the vendorid:productid entry - self.setVendorIdProductIDCode() - #set the commercialization year entry - self.setCommYearEntry() - #set the interface entry - self.setInterfaceEntry() - #set the distribution entry - self.setDistributionEntry() - #set the kernel entry - self.setKernelEntry() - #set the howItWorks entry - self.setHowItWorksEntry() - #set the driver entry - self.setDriverEntry() - #set the description entry - self.setDescriptionEntry() + if self.currentDevice != None: + #set the model entry + self.setModelEntry() + #set the vendorid:productid entry + self.setVendorIdProductIDCode() + #set the commercialization year entry + self.setCommYearEntry() + #set the interface entry + self.setInterfaceEntry() + #set the distribution entry + self.setDistributionEntry() + #set the kernel entry + self.setKernelEntry() + #set the howItWorks entry + self.setHowItWorksEntry() + #set the driver entry + self.setDriverEntry() + #set the description entry + self.setDescriptionEntry() #set the model name entry @@ -235,6 +240,7 @@ class hclient: def synchronize(self,widget): self.client.sync() + print self.client.errors self.setEntries() @@ -277,7 +283,7 @@ class hclient: pref.set_tooltip_text('Preferences') pref.connect("clicked", self.openPrefWindow) sync = gtk.ToolButton(gtk.STOCK_REFRESH) - sync.set_tooltip_text('Synchronize with the server: this will override the entries or your devices') + sync.set_tooltip_text('Synchronize with the server: this will override the entries of your devices') sync.connect("clicked", self.synchronize) info = gtk.ToolButton(gtk.STOCK_INFO) info.set_tooltip_text('Information') @@ -310,11 +316,6 @@ class hclient: self.tree = gtk.TreeView() self.tree.set_headers_visible(False) - #treeFrame = gtk.Frame() - #treeFrame.set_border_width(5) - ##treeFrame.add(self.tree) - #treeFrame.show_all() - devices = gtk.TreeViewColumn("Your PCI and USB devices") cell = gtk.CellRendererText() @@ -338,7 +339,7 @@ class hclient: self.tree.set_model(self.treestore) treesw = gtk.ScrolledWindow() - treesw.set_size_request(50,400) + treesw.set_size_request(50,431) treesw.set_shadow_type(gtk.SHADOW_ETCHED_IN) treesw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) treesw.add(self.tree) @@ -359,6 +360,7 @@ class hclient: ### model #model name label self.modelNameLabel = gtk.Label("Model name:") + self.modelNameLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.modelNameLabel, 0, 1, 0, 1) @@ -371,6 +373,7 @@ class hclient: ### vendorid:productid #vendorid:productid label self.vendorIdProductIdLabel = gtk.Label("VendorID:productID code:") + self.vendorIdProductIdLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.vendorIdProductIdLabel, 0, 1, 1, 2) @@ -385,6 +388,7 @@ class hclient: ###year of commercialization #year of commercialization label self.commYearLabel = gtk.Label("Year of commercialization:") + self.commYearLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.commYearLabel, 0, 1, 2, 3) @@ -397,6 +401,7 @@ class hclient: ###interface #interface label self.interfaceLabel = gtk.Label("Interface:") + self.interfaceLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.interfaceLabel, 0, 1, 3, 4) @@ -413,6 +418,7 @@ class hclient: ### distribution #distribution label self.distributionLabel = gtk.Label("Distribution:") + self.distributionLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.distributionLabel, 0, 1, 4, 5) @@ -425,6 +431,7 @@ class hclient: ### kernel #kernel label self.kernelLabel = gtk.Label("Kernel libre version:") + self.kernelLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.kernelLabel, 0, 1, 5, 6) @@ -437,6 +444,7 @@ class hclient: ###how it works #how it works label self.howItWorksLabel = gtk.Label("Does it work?") + self.howItWorksLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.howItWorksLabel, 0, 1, 6, 7) @@ -449,6 +457,7 @@ class hclient: ### driver #driver label self.driverLabel = gtk.Label("Free driver used:") + self.driverLabel.set_alignment(0.95,0.5) #add the label self.rightTable.attach(self.driverLabel, 0, 1, 7, 8) @@ -497,18 +506,23 @@ class hclient: #start the left vertical box self.rightWindow = gtk.VBox(False, 0) - self.rightWindow.pack_start(self.rightTable, False, True, 5) + self.rightWindow.pack_start(self.rightTable, False, True, 10) self.rightWindow.pack_start(self.descriptionLabel, False, True, 3) self.rightWindow.pack_start(sw, False, True, 0) self.rightWindow.pack_start(hboxBelowEntries, False, True, 10) - self.rightWindow.show_all() - - self.centerWindow.pack_start(self.rightWindow, True, True, 5) + #self.rightWindow.show_all() + + rhbox = gtk.HBox(False, 0) + rhbox.pack_start(self.rightWindow, True, True, 5) + rFrame = gtk.Frame() + rFrame.add(rhbox) + rFrame.set_border_width(5) + self.centerWindow.pack_start(rFrame, True, True, 0) #self.rframe.add(self.rightWindow) #self.rframe.set_border_width(30) - self.centerWindow.show() + self.centerWindow.show_all() self.leftWindow.show() self.window.show() |