Display an animation instead of the progress bar, when waiting for pace-tool to finish

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@212 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
oepen
2010-07-12 15:26:25 +00:00
parent deaf8a8096
commit 5ef9a322b7
4 changed files with 31 additions and 11 deletions

View File

@@ -2,7 +2,8 @@ pixmapsdir = $(datadir)/pace-gui/
pixmaps_DATA = \
OpenPACElogo.png \
apply.png \
error.png
error.png \
wait.gif
EXTRA_DIST = \
$(pixmaps_DATA)

BIN
pace-gui/images/wait.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -448,7 +448,10 @@ class PinpadGTK:
#If we have a CHAT, we pass it to pace-tool
if (self.chat):
cmd.append("--chat=" + self.chat)
# cmd.append("--chat=" + self.chat)
print "--chat=" + self.chat
cmd.append("-v")
#Try to call pace-tool. This is a blocking call. A progress bar is being
#shown while the subprocess is running
@@ -465,19 +468,35 @@ class PinpadGTK:
return
#Animate the progress bar
# line = p.stdout.readline()
# self.progressWindow.show()
# while gtk.events_pending():
# gtk.main_iteration()
# while line:
# self.progressWindow.inc_fraction()
# while gtk.events_pending():
# gtk.main_iteration()
# line = p.stdout.readline()
foo = gtk.Window(gtk.WINDOW_POPUP)
animation = gtk.gdk.PixbufAnimation(image_dir + "/wait.gif")
img = gtk.Image()
img.set_from_animation(animation)
foo.add(img)
foo.show_all()
line = p.stdout.readline()
self.progressWindow.show()
while gtk.events_pending():
gtk.main_iteration()
# self.progressWindow.show()
while line:
self.progressWindow.inc_fraction()
while gtk.events_pending():
gtk.main_iteration()
# self.progressWindow.inc_fraction()
while gtk.events_pending(): #Keep GUI responsive
gtk.main_iteration()
line = p.stdout.readline()
#Get the return value of the pace-tool process
ret = p.poll()
self.progressWindow.hide()
foo.destroy()
# self.progressWindow.hide()
self.cardChecker.resume()
if (ret == 0):
@@ -486,7 +505,7 @@ class PinpadGTK:
gtk.BUTTONS_OK, "PIN wurde korrekt eingegeben")
res = popup.run()
popup.destroy()
self.shutdown() #FIXME
self.shutdown(None) #FIXME
else:
popup = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING,

View File

@@ -82,7 +82,7 @@
<property name="visible">True</property>
<property name="xalign">0.10000000149011612</property>
<property name="ypad">5</property>
<property name="pixbuf">apply.png</property>
<property name="pixbuf">error.png</property>
</object>
<packing>
<property name="position">1</property>