aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--h-client/credits.txt13
-rw-r--r--h-client/hclient.py40
-rw-r--r--h-client/hlibrary.py7
-rwxr-xr-xh-client/img/devices/soundcard.pngbin0 -> 1051 bytes
-rwxr-xr-xh-client/img/devices/unknown.pngbin0 -> 1222 bytes
-rwxr-xr-xh-client/img/devices/videocard.pngbin0 -> 3855 bytes
-rwxr-xr-xh-client/img/devices/wifi.pngbin0 -> 1331 bytes
7 files changed, 49 insertions, 11 deletions
diff --git a/h-client/credits.txt b/h-client/credits.txt
new file mode 100644
index 0000000..59a467d
--- /dev/null
+++ b/h-client/credits.txt
@@ -0,0 +1,13 @@
+Icons:
+
+icons taken from the H2O Icon Theme 0.0.5 (http://kde-look.org/content/show.php/ACUN+Simgeleri?content=83018), licensed under the GNU GPL license:
+
+img/devices/unknown.png
+img/devices/soundcard.png
+img/devices/wifi.png
+
+
+icons taken from the Crystal Projects icons (http://www.everaldo.com/crystal/?action=downloads), licensed under the LGPL license
+
+img/devices/videocard.png
+
diff --git a/h-client/hclient.py b/h-client/hclient.py
index 1868add..ebb0907 100644
--- a/h-client/hclient.py
+++ b/h-client/hclient.py
@@ -481,6 +481,16 @@ class hclient:
self.statusLabel.set_markup("<i>you are not logged in</i>")
self.submitButton.set_sensitive(False)
+ #def setTreeViewCell(self,column, cell_renderer, model, iter):
+ ##img = model.get_value(iter, 3)
+ ##imgFlag = model.get_value(iter, 5)
+ #print model
+ ##self.devices.clear_attributes(cell_renderer)
+ ##if imgFlag == 'image':
+ ###print True
+ ##cell_renderer.set_property('pixbuf', img)
+ #return
+
#another callback
def delete_event(self, widget, event, data=None):
@@ -490,7 +500,7 @@ class hclient:
def __init__(self):
#start the client object
- self.client = Client('h-source')
+ self.client = Client('http://www.h-node.com/')
self.client.createDevices()
# Create the main window
@@ -567,30 +577,38 @@ class hclient:
self.tree = gtk.TreeView()
self.tree.set_headers_visible(False)
- devices = gtk.TreeViewColumn("Your PCI and USB devices")
+ self.devices = gtk.TreeViewColumn("Your PCI and USB devices")
+
+ device_icon = gtk.CellRendererPixbuf()
+ self.devices.pack_start(device_icon, True)
+ self.devices.add_attribute(device_icon, 'pixbuf', 3)
+ #self.devices.set_cell_data_func(device_icon, self.setTreeViewCell)
- cell = gtk.CellRendererText()
- devices.pack_start(cell, False)
- devices.add_attribute(cell, "text", 0)
- devices.add_attribute(cell, "weight", 2)
+
+ device_name = gtk.CellRendererText()
+ self.devices.pack_start(device_name, True)
+ self.devices.add_attribute(device_name, "text", 0)
+ self.devices.add_attribute(device_name, "xpad", 4)
+ self.devices.add_attribute(device_name, "weight", 2)
+
- self.treestore = gtk.TreeStore(str,str,int)
+ self.treestore = gtk.TreeStore(str,str,int,gtk.gdk.Pixbuf,int,str)
- pci = self.treestore.append(None, ["Your PCI Devices","",800])
+ pci = self.treestore.append(None, ["Your PCI Devices","",800,gtk.gdk.pixbuf_new_from_file('img/devices/unknown.png'),4,'no_image'])
for key,dev in self.client.devices.iteritems():
if key[0] == 'p':
- self.treestore.append(pci, [dev[0].getType(),key,400])
+ self.treestore.append(pci, [dev[0].getType(),key,400,gtk.gdk.pixbuf_new_from_file('img/devices/'+dev[0].getIcon()),4,'image'])
selection = self.tree.get_selection()
selection.connect('changed', self.setCurrentDevice)
- self.tree.append_column(devices)
+ self.tree.append_column(self.devices)
self.tree.set_model(self.treestore)
treesw = gtk.ScrolledWindow()
- treesw.set_size_request(50,441)
+ treesw.set_size_request(110,401)
treesw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
treesw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
treesw.add(self.tree)
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 969239c..c3ade68 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -105,6 +105,7 @@ class Device(object):
self._howItWorks = ''
self._driver = ''
self._description = ''
+ self._icon = 'unknown.png'
def setPost(self):
self._post['model'] = self._model;
@@ -215,6 +216,9 @@ class Device(object):
def getDescription(self):
return self._description
+ def getIcon(self):
+ return self._icon
+
def setType(self,ttype):
self._type = ttype
@@ -265,6 +269,7 @@ class Videocard(Device):
self._howItWorks = 'does_not_work'
self._interfaces = ['not-specified','PCI','AGP','PCI-E','ISA','MCA','VLB']
self._howItWorksOptions = ['works_with_3D','works_without_3D','does_not_work']
+ self._icon = 'videocard.png'
def setPost(self):
super(Videocard, self).setPost()
@@ -277,6 +282,7 @@ class Wifi(Device):
self._type = 'wifi'
self._howItWorks = 'no'
self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card']
+ self._icon = 'wifi.png'
def setPost(self):
super(Wifi, self).setPost()
@@ -289,6 +295,7 @@ class Soundcard(Device):
self._type = 'soundcard'
self._howItWorks = 'no'
self._interfaces = ['not-specified','PCI','ISA','USB','Firewire','Parallel','PCI-E','PCMCIA']
+ self._icon = 'soundcard.png'
def setPost(self):
super(Soundcard, self).setPost()
diff --git a/h-client/img/devices/soundcard.png b/h-client/img/devices/soundcard.png
new file mode 100755
index 0000000..d5a7ad4
--- /dev/null
+++ b/h-client/img/devices/soundcard.png
Binary files differ
diff --git a/h-client/img/devices/unknown.png b/h-client/img/devices/unknown.png
new file mode 100755
index 0000000..86b6407
--- /dev/null
+++ b/h-client/img/devices/unknown.png
Binary files differ
diff --git a/h-client/img/devices/videocard.png b/h-client/img/devices/videocard.png
new file mode 100755
index 0000000..efffd46
--- /dev/null
+++ b/h-client/img/devices/videocard.png
Binary files differ
diff --git a/h-client/img/devices/wifi.png b/h-client/img/devices/wifi.png
new file mode 100755
index 0000000..94c4058
--- /dev/null
+++ b/h-client/img/devices/wifi.png
Binary files differ