From b66c5810f3546c0f66c0328ecb051f07695b3f3b Mon Sep 17 00:00:00 2001 From: oepen Date: Sun, 25 Jul 2010 17:05:04 +0000 Subject: [PATCH] -Actually show help text, when the user clicks on the info icon .Place window in the center of the screen (only relevant on the PC, not on the Moko) git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@229 96b47cad-a561-4643-ad3b-153ac7d7599c --- pace-gui/src/pace-gui.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pace-gui/src/pace-gui.py b/pace-gui/src/pace-gui.py index c7d13ff..69c73fd 100644 --- a/pace-gui/src/pace-gui.py +++ b/pace-gui/src/pace-gui.py @@ -84,6 +84,9 @@ class MokoWindow(gtk.Window): lbl.modify_font(pango.FontDescription("sans 12")) self.__vb.pack_start(hbox, False, False) + #Place window in the center of the screen + self.set_position(gtk.WIN_POS_CENTER_ALWAYS) + def btnBack_clicked(self, widget, data=None): """Go back to the previous window. If there is no previous window, do nothing""" @@ -109,7 +112,7 @@ class MsgBox(gtk.Dialog): if img_type is not None: assert IMAGES.has_key(img_type) - super(MsgBox, self).__init__(title="Foo", parent=parent, flags=flags) + super(MsgBox, self).__init__(title="", parent=parent, flags=flags) #Dialog will be resized to screen width no matter what. Therefore we #use the whole width from the beginning to avoid being resized @@ -136,7 +139,7 @@ class MsgBox(gtk.Dialog): #hbox.pack_start(vbox) #self.add(hbox) - self.set_decorated(False) + #self.set_decorated(False) self.set_modal(True) self.show_all() @@ -307,6 +310,7 @@ class customCheckButton(object): strings = AT_CHAT_STRINGS[index] self.label = strings[0] self.helptext = strings[1] + self.parent = vbox.get_parent_window() #Setup a label with the name of the access right self.lbl = gtk.Label(self.label) @@ -347,7 +351,9 @@ class customCheckButton(object): def _show_info(self, widget=None, data=None): """Show a messagebox containing info about the access right in question""" - print self.helptext + help = MsgBox(self.parent, self.helptext, "info", + gtk.DIALOG_DESTROY_WITH_PARENT) + #print self.helptext class PinpadGTK: """This a simple GTK based GUI to enter a PIN/PUK/CAN"""