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:
@@ -2,7 +2,8 @@ pixmapsdir = $(datadir)/pace-gui/
|
|||||||
pixmaps_DATA = \
|
pixmaps_DATA = \
|
||||||
OpenPACElogo.png \
|
OpenPACElogo.png \
|
||||||
apply.png \
|
apply.png \
|
||||||
error.png
|
error.png \
|
||||||
|
wait.gif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
$(pixmaps_DATA)
|
$(pixmaps_DATA)
|
||||||
|
|||||||
BIN
pace-gui/images/wait.gif
Normal file
BIN
pace-gui/images/wait.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -448,7 +448,10 @@ class PinpadGTK:
|
|||||||
|
|
||||||
#If we have a CHAT, we pass it to pace-tool
|
#If we have a CHAT, we pass it to pace-tool
|
||||||
if (self.chat):
|
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
|
#Try to call pace-tool. This is a blocking call. A progress bar is being
|
||||||
#shown while the subprocess is running
|
#shown while the subprocess is running
|
||||||
@@ -465,19 +468,35 @@ class PinpadGTK:
|
|||||||
return
|
return
|
||||||
|
|
||||||
#Animate the progress bar
|
#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()
|
line = p.stdout.readline()
|
||||||
self.progressWindow.show()
|
# self.progressWindow.show()
|
||||||
while gtk.events_pending():
|
|
||||||
gtk.main_iteration()
|
|
||||||
while line:
|
while line:
|
||||||
self.progressWindow.inc_fraction()
|
# self.progressWindow.inc_fraction()
|
||||||
while gtk.events_pending():
|
while gtk.events_pending(): #Keep GUI responsive
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
line = p.stdout.readline()
|
line = p.stdout.readline()
|
||||||
|
|
||||||
#Get the return value of the pace-tool process
|
#Get the return value of the pace-tool process
|
||||||
ret = p.poll()
|
ret = p.poll()
|
||||||
self.progressWindow.hide()
|
foo.destroy()
|
||||||
|
# self.progressWindow.hide()
|
||||||
self.cardChecker.resume()
|
self.cardChecker.resume()
|
||||||
|
|
||||||
if (ret == 0):
|
if (ret == 0):
|
||||||
@@ -486,7 +505,7 @@ class PinpadGTK:
|
|||||||
gtk.BUTTONS_OK, "PIN wurde korrekt eingegeben")
|
gtk.BUTTONS_OK, "PIN wurde korrekt eingegeben")
|
||||||
res = popup.run()
|
res = popup.run()
|
||||||
popup.destroy()
|
popup.destroy()
|
||||||
self.shutdown() #FIXME
|
self.shutdown(None) #FIXME
|
||||||
else:
|
else:
|
||||||
popup = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL |
|
popup = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL |
|
||||||
gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING,
|
gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING,
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0.10000000149011612</property>
|
<property name="xalign">0.10000000149011612</property>
|
||||||
<property name="ypad">5</property>
|
<property name="ypad">5</property>
|
||||||
<property name="pixbuf">apply.png</property>
|
<property name="pixbuf">error.png</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user