connect.show_all()
fields = [callsign, name, cert, facility, rating]
keepRunning = true
while keepRunning:
keepRunning = false
# run dialog
response = connect.run()
# see if there's any errors
for field in fields:
if len(field.get_text().strip()) == 0:
self.showerror("The fileld can not be left blank.")
# uh oh an error better flag it and run the loop again
# until the user gets it right
keepRunning = true
if response == gtk.RESPONSE_OK:
# Get the text entries
# TODO: Send this to server, not stdout.
print "call " + callsign
print "name " + name
print "cert " + cert
print facility
print rating
connect.destroy()
def showerror(self, message):
dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, message_format=message, buttons=gtk.BUTTONS_OK)
dialog.run()
dialog.destroy()