def show_about(self, widget): sw_version, fw_version, os_version = get_versions() if fw_version is None: fw_version = "No connection to PiJuice" message = "\n".join([ "Software version: %s" % sw_version, "Firmware version: %s" % fw_version, "OS version: %s" % os_version, ]) dialog = gtk.MessageDialog( None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message) dialog.set_title("About") dialog.run() dialog.destroy()
def show_about(self, widget): widget.set_sensitive(False) sw_version, fw_version, os_version = get_versions() if fw_version is None: fw_version = "No connection to PiJuice" message = "\n".join([ "Software version: %s" % sw_version, "Firmware version: %s" % fw_version, "OS version: %s" % os_version, ]) dialog = gtk.MessageDialog(None, gtk.DialogFlags.MODAL, gtk.MessageType.INFO, gtk.ButtonsType.OK, message) dialog.set_title("About") dialog.run() dialog.destroy() widget.set_sensitive(True)
def show_about(self, widget): widget.set_sensitive(False) sw_version, fw_version, os_version = get_versions() if fw_version is None: fw_version = "No connection to PiJuice" message = "\n".join([ "Software version: %s" % sw_version, "Firmware version: %s" % fw_version, "OS version: %s" % os_version, ]) dialog = gtk.MessageDialog( None, gtk.DialogFlags.MODAL, gtk.MessageType.INFO, gtk.ButtonsType.OK, message ) dialog.set_title("About") dialog.run() dialog.destroy() widget.set_sensitive(True)
def show_about(self, widget): widget.set_sensitive(False) sw_version, fw_version, os_version = get_versions() if fw_version is None: fw_version = "No connection to PiJuice" message = "\n".join([ "Software version: %s" % sw_version, "Firmware version: %s" % fw_version, "OS version: %s" % os_version, ]) if py3 == False: # Python 2 dialog = gtk.MessageDialog( None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message) else: # Python 3 dialog = gtk.MessageDialog(None, gtk.DialogFlags.MODAL, gtk.MessageType.INFO, gtk.ButtonsType.OK, message) dialog.set_title("About") dialog.run() dialog.destroy() widget.set_sensitive(True)