aboutsummaryrefslogtreecommitdiff
path: root/h-client
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-11 15:28:08 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-11 15:28:08 +0000
commit41edb3195912124c3a214b6dddb42d29e9418d0c (patch)
treefa34bbeabb1ed02e21435d1364d2908af38d3d03 /h-client
parent6668f4d0d3e3aa8ba5eca58dbcc34f5b8f5b3876 (diff)
h-client:inproved submit process
Diffstat (limited to 'h-client')
-rw-r--r--h-client/credits.txt12
-rw-r--r--h-client/hclient.py46
-rwxr-xr-xh-client/img/devices/small/soundcard.png (renamed from h-client/img/devices/soundcard.png)bin1051 -> 1051 bytes
-rwxr-xr-xh-client/img/devices/small/unknown.png (renamed from h-client/img/devices/unknown.png)bin1222 -> 1222 bytes
-rwxr-xr-xh-client/img/devices/small/videocard.png (renamed from h-client/img/devices/videocard.png)bin3855 -> 3855 bytes
-rwxr-xr-xh-client/img/devices/small/wifi.png (renamed from h-client/img/devices/wifi.png)bin1331 -> 1331 bytes
-rw-r--r--h-client/img/title_png.pngbin0 -> 1071 bytes
7 files changed, 39 insertions, 19 deletions
diff --git a/h-client/credits.txt b/h-client/credits.txt
index 59a467d..e89d30b 100644
--- a/h-client/credits.txt
+++ b/h-client/credits.txt
@@ -2,12 +2,16 @@ 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
+img/devices/small/unknown.png
+img/devices/small/soundcard.png
+img/devices/small/wifi.png
+
+img/devices/big/unknown.png
+img/devices/big/soundcard.png
+img/devices/big/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
+img/devices/small/videocard.png
diff --git a/h-client/hclient.py b/h-client/hclient.py
index ebb0907..2679640 100644
--- a/h-client/hclient.py
+++ b/h-client/hclient.py
@@ -88,8 +88,9 @@ class hclient:
#make sensitive the apply button
self.applyButton.set_sensitive(True)
self.resetButton.set_sensitive(True)
+ self.submitButton.set_sensitive(True)
- self.updateStatus()
+ #self.updateStatus()
else:
#make non sensitive the apply button
@@ -98,7 +99,7 @@ class hclient:
self.submitButton.set_sensitive(False)
self.currentDevice = None
self.currentDeviceCode = None
- self.updateStatus()
+ #self.updateStatus()
#set the pyGTK device entries
@@ -211,23 +212,34 @@ class hclient:
def login(self,widget):
self.client.login(self.usernameEntry.get_text(),self.passwordEntry.get_text())
self.updateStatus()
+
+ if self._submitFlag:
+ if self.client.isLogged() != -2:
+ if self.client.isLogged():
+ self.applyChanges(None)
+ self.client.submit(self.currentDeviceCode)
+ self.printErrors()
+
+ self._submitFlag = False
+
#self.printErrors()
self.loginWindow.destroy()
#submit data to the server
def submit(self,widget):
self.applyChanges(None)
+ self.licenseNoticeWindow.destroy()
- if self.client.isLogged() == True:
- result = self.client.submit(self.currentDeviceCode)
- self.printErrors()
- else:
- self.client.errors.append("you are not logged")
- self.updateStatus()
+ if self.client.isLogged() != -2:
+ if self.client.isLogged():
+ self.client.submit(self.currentDeviceCode)
+ else:
+ self._submitFlag = True
+ self.openLoginWindow(None)
+
+ self.printErrors()
- self.licenseNoticeWindow.destroy()
-
#logout to the server
def logout(self,widget):
self.client.logout()
@@ -236,6 +248,8 @@ class hclient:
#close the login window
def closeLoginWindow(self,widget):
+ self._submitFlag = False
+ self.updateStatus()
self.loginWindow.destroy()
#close the license notice window
@@ -479,7 +493,6 @@ class hclient:
self.loginButton.show()
self.logoutButton.hide()
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)
@@ -499,8 +512,11 @@ class hclient:
def __init__(self):
+ #does it have to submit after the login?
+ self._submitFlag = False
+
#start the client object
- self.client = Client('http://www.h-node.com/')
+ self.client = Client('h-source')
self.client.createDevices()
# Create the main window
@@ -592,13 +608,13 @@ class hclient:
self.devices.add_attribute(device_name, "weight", 2)
- self.treestore = gtk.TreeStore(str,str,int,gtk.gdk.Pixbuf,int,str)
+ self.treestore = gtk.TreeStore(str,str,int,gtk.gdk.Pixbuf,int)
- pci = self.treestore.append(None, ["Your PCI Devices","",800,gtk.gdk.pixbuf_new_from_file('img/devices/unknown.png'),4,'no_image'])
+ pci = self.treestore.append(None, ["Your PCI Devices","",800,gtk.gdk.pixbuf_new_from_file('img/title_png.png'),4])
for key,dev in self.client.devices.iteritems():
if key[0] == 'p':
- self.treestore.append(pci, [dev[0].getType(),key,400,gtk.gdk.pixbuf_new_from_file('img/devices/'+dev[0].getIcon()),4,'image'])
+ self.treestore.append(pci, [dev[0].getType(),key,400,gtk.gdk.pixbuf_new_from_file('img/devices/small/'+dev[0].getIcon()),4])
selection = self.tree.get_selection()
selection.connect('changed', self.setCurrentDevice)
diff --git a/h-client/img/devices/soundcard.png b/h-client/img/devices/small/soundcard.png
index d5a7ad4..d5a7ad4 100755
--- a/h-client/img/devices/soundcard.png
+++ b/h-client/img/devices/small/soundcard.png
Binary files differ
diff --git a/h-client/img/devices/unknown.png b/h-client/img/devices/small/unknown.png
index 86b6407..86b6407 100755
--- a/h-client/img/devices/unknown.png
+++ b/h-client/img/devices/small/unknown.png
Binary files differ
diff --git a/h-client/img/devices/videocard.png b/h-client/img/devices/small/videocard.png
index efffd46..efffd46 100755
--- a/h-client/img/devices/videocard.png
+++ b/h-client/img/devices/small/videocard.png
Binary files differ
diff --git a/h-client/img/devices/wifi.png b/h-client/img/devices/small/wifi.png
index 94c4058..94c4058 100755
--- a/h-client/img/devices/wifi.png
+++ b/h-client/img/devices/small/wifi.png
Binary files differ
diff --git a/h-client/img/title_png.png b/h-client/img/title_png.png
new file mode 100644
index 0000000..8184ebd
--- /dev/null
+++ b/h-client/img/title_png.png
Binary files differ