def __init__(self, parent=None): QtGui.QSplashScreen.__init__(self, parent, flags=QtCore.Qt.WindowStaysOnTopHint) self.pix = QtGui.QPixmap( SPLASH_IMAGE ) self.setPixmap(self.pix) self.setMask( self.pix.mask() ) self.showMessage( SPLASH_NOTICE + ' loading modules . . .', QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtGui.QColor("#eecc77")) self.fw_update = FirmwareLibUpdate(self) self.input_dlg = QtGui.QInputDialog(self) self.fw_update_timer_id = None
class AboutDialog(QtGui.QSplashScreen): ide_revision = "(unknown)" def __init__(self, parent=None): QtGui.QSplashScreen.__init__(self, parent, flags=QtCore.Qt.WindowStaysOnTopHint) self.pix = QtGui.QPixmap(SPLASH_IMAGE) self.setPixmap(self.pix) self.setMask(self.pix.mask()) self.showMessage(SPLASH_NOTICE + ' loading modules . . .', QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtGui.QColor("#eecc77")) self.fw_update = FirmwareLibUpdate(self) self.input_dlg = QtGui.QInputDialog(self) self.fw_update_timer_id = None def getVersions(self): fw_rev = self.fw_update.getCurrentRevision() return 'build: %s Library: %s' % (self.ide_revision, fw_rev) def mousePressEvent(self, *args, **kwargs): # print 'you pressed me!' if not self.fw_update.isRunning(): self.close() return QtGui.QSplashScreen.mousePressEvent(self, *args, **kwargs) def setMsg(self, msg): self.showMessage('[developer mode] ' + msg, QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtGui.QColor("#eecc77")) def showUpdateDialog(self): rev, res = self.input_dlg.getInteger( self, 'Update FW Lib', 'Input version ("0" = get latest)', 0, 0, 10000) if res: self.fw_update.setDesiredRevision(rev) self.fw_update.start() self.fw_update_timer_id = self.startTimer(200) def timerEvent(self, *args, **kwargs): timerID = args[0].timerId() if timerID == self.fw_update_timer_id: msg = self.fw_update.getLog() if msg: self.setMsg(msg) elif not self.fw_update.isRunning(): self.killTimer(self.fw_update_timer_id) return QtGui.QSplashScreen.timerEvent(self, *args, **kwargs)
class AboutDialog(QtGui.QSplashScreen): ide_revision = "(unknown)" def __init__(self, parent=None): QtGui.QSplashScreen.__init__(self, parent, flags=QtCore.Qt.WindowStaysOnTopHint) self.pix = QtGui.QPixmap( SPLASH_IMAGE ) self.setPixmap(self.pix) self.setMask( self.pix.mask() ) self.showMessage( SPLASH_NOTICE + ' loading modules . . .', QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtGui.QColor("#eecc77")) self.fw_update = FirmwareLibUpdate(self) self.input_dlg = QtGui.QInputDialog(self) self.fw_update_timer_id = None def getVersions(self): fw_rev = self.fw_update.getCurrentRevision() return 'build: %s Library: %s' %(self.ide_revision, fw_rev) def mousePressEvent(self, *args, **kwargs): # print 'you pressed me!' if not self.fw_update.isRunning(): self.close() return QtGui.QSplashScreen.mousePressEvent(self, *args, **kwargs) def setMsg(self, msg): self.showMessage( '[developer mode] '+ msg, QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtGui.QColor("#eecc77")) def showUpdateDialog(self): rev, res = self.input_dlg.getInteger(self, 'Update FW Lib', 'Input version ("0" = get latest)', 0, 0, 10000) if res: self.fw_update.setDesiredRevision(rev) self.fw_update.start() self.fw_update_timer_id = self.startTimer(200) def timerEvent(self, *args, **kwargs): timerID = args[0].timerId() if timerID == self.fw_update_timer_id: msg = self.fw_update.getLog(); if msg: self.setMsg(msg) elif not self.fw_update.isRunning(): self.killTimer(self.fw_update_timer_id) return QtGui.QSplashScreen.timerEvent(self, *args, **kwargs)