From 41edb3195912124c3a214b6dddb42d29e9418d0c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 11 Apr 2011 15:28:08 +0000 Subject: h-client:inproved submit process --- h-client/credits.txt | 12 +++++--- h-client/hclient.py | 46 +++++++++++++++++++++---------- h-client/img/devices/small/soundcard.png | Bin 0 -> 1051 bytes h-client/img/devices/small/unknown.png | Bin 0 -> 1222 bytes h-client/img/devices/small/videocard.png | Bin 0 -> 3855 bytes h-client/img/devices/small/wifi.png | Bin 0 -> 1331 bytes h-client/img/devices/soundcard.png | Bin 1051 -> 0 bytes h-client/img/devices/unknown.png | Bin 1222 -> 0 bytes h-client/img/devices/videocard.png | Bin 3855 -> 0 bytes h-client/img/devices/wifi.png | Bin 1331 -> 0 bytes h-client/img/title_png.png | Bin 0 -> 1071 bytes 11 files changed, 39 insertions(+), 19 deletions(-) create mode 100755 h-client/img/devices/small/soundcard.png create mode 100755 h-client/img/devices/small/unknown.png create mode 100755 h-client/img/devices/small/videocard.png create mode 100755 h-client/img/devices/small/wifi.png delete mode 100755 h-client/img/devices/soundcard.png delete mode 100755 h-client/img/devices/unknown.png delete mode 100755 h-client/img/devices/videocard.png delete mode 100755 h-client/img/devices/wifi.png create mode 100644 h-client/img/title_png.png (limited to 'h-client') 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("you are not logged in") - 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/small/soundcard.png b/h-client/img/devices/small/soundcard.png new file mode 100755 index 0000000..d5a7ad4 Binary files /dev/null and b/h-client/img/devices/small/soundcard.png differ diff --git a/h-client/img/devices/small/unknown.png b/h-client/img/devices/small/unknown.png new file mode 100755 index 0000000..86b6407 Binary files /dev/null and b/h-client/img/devices/small/unknown.png differ diff --git a/h-client/img/devices/small/videocard.png b/h-client/img/devices/small/videocard.png new file mode 100755 index 0000000..efffd46 Binary files /dev/null and b/h-client/img/devices/small/videocard.png differ diff --git a/h-client/img/devices/small/wifi.png b/h-client/img/devices/small/wifi.png new file mode 100755 index 0000000..94c4058 Binary files /dev/null and b/h-client/img/devices/small/wifi.png differ diff --git a/h-client/img/devices/soundcard.png b/h-client/img/devices/soundcard.png deleted file mode 100755 index d5a7ad4..0000000 Binary files a/h-client/img/devices/soundcard.png and /dev/null differ diff --git a/h-client/img/devices/unknown.png b/h-client/img/devices/unknown.png deleted file mode 100755 index 86b6407..0000000 Binary files a/h-client/img/devices/unknown.png and /dev/null differ diff --git a/h-client/img/devices/videocard.png b/h-client/img/devices/videocard.png deleted file mode 100755 index efffd46..0000000 Binary files a/h-client/img/devices/videocard.png and /dev/null differ diff --git a/h-client/img/devices/wifi.png b/h-client/img/devices/wifi.png deleted file mode 100755 index 94c4058..0000000 Binary files a/h-client/img/devices/wifi.png and /dev/null differ diff --git a/h-client/img/title_png.png b/h-client/img/title_png.png new file mode 100644 index 0000000..8184ebd Binary files /dev/null and b/h-client/img/title_png.png differ -- cgit v1.2.3