def main(): app = QApplication(sys.argv) import qdarkstyle # setup stylesheet app.setStyleSheet(qdarkstyle.load_stylesheet()) pixmap = QPixmap(os.path.join(_resourcepath('images'), "splash.png")) splash = QSplashScreen(pixmap, Qt.WindowStaysOnTopHint) splash.setMask(pixmap.mask()) splash_font = splash.font() splash_font.setPixelSize(14) splash.setFont(splash_font) splash.show() splash.showMessage('Initialising...', Qt.AlignBottom | Qt.AlignLeft | Qt.AlignAbsolute, Qt.white) app.processEvents() """ for count in range(1, 6): splash.showMessage('Processing {0}...'.format(count), Qt.AlignBottom | Qt.AlignLeft, Qt.white) QApplication.processEvents() QThread.msleep(1000) """ frame = ConfiguratorWindow() frame.show_and_raise() splash.finish(frame) sys.exit(app.exec_())
if self.donationButton.text() == 'Donate': self.copyEthAddressButton.setVisible(True) self.copyBtcAddressButton.setVisible(True) self.donationButton.setText('Hide') elif self.donationButton.text() == 'Hide': self.copyEthAddressButton.setVisible(False) self.copyBtcAddressButton.setVisible(False) self.donationButton.setText('Donate') self.worker.start() def cleanup(self): # Clears the clipboard of any copied text clip.setText('') form = MainWindow() # Define program window # Set up and display splash screen splashImage = QImage(splashByteArray) splashPixmap = QPixmap(splashImage) splashScr = QSplashScreen(splashPixmap, Qt.WindowStaysOnTopHint) splashScr.setMask(splashPixmap.mask()) splashScr.show() sleep(1) app.processEvents() splashScr.hide() splashScr.deleteLater() form.show() app.aboutToQuit.connect(form.cleanup) # Clears the clipboard when exiting app.exec_()
# if self.alpha > 0: # self.repaint() # if self.alpha == 0: # self.timer.stop() # #self.close() # def paintEvent(self,pe): # super(SplashScreen, self).paintEvent(pe) # p = QPainter(self) # p.fillRect(0,0,self.width(),self.height(), QColor(255,255,255,self.alpha)) pixmap = QPixmap(os.path.join(resource_dir,"client_splash.png")) splash = QSplashScreen(pixmap) splash.setMask(pixmap.mask()) # splash.setWindowFlags(Qt.WindowStaysOnTopHint) splash.show() splash_msg( u"{} - ".format(configuration.this_version) + _("Contacting updates server")) splash_msg( _("Loading database URL")) try: configuration.load_database_param() except Exception as e: mainlog.error(e) mainlog.error( "I was unable to get the DB URL from the server {}, so I'll continue with the file configuration".format( configuration.database_url_source)) showErrorBox( _("Can't connect to the main server"), _("I was unable to contact the main server (located here : {}). It is not 100% necessary to do so but that's not normal either. You should tell your administrator about that. I will now allow you to change the network address of the server I know in the preferences panel.").format( configuration.database_url_source))
import sys from PySide.QtCore import Qt from PySide.QtGui import QApplication, QPixmap, QSplashScreen from dialog.directory_dialog import DirectoryDialog from indexer.indexer import Indexer from gui.mainwindow import MainWindow if __name__ == "__main__": app = QApplication(sys.argv) dir = DirectoryDialog() if dir.exec_() and dir.result() != "" and dir.result() != None: app.indexer = Indexer(dir.result()) splash_pix = QPixmap('res/SplashScreen.png') splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() app.processEvents() app.indexer.load_data() app.doclist = None app.webview = None app.currentWord = None app.mainWindow = MainWindow() splash.finish(app.mainWindow) app.mainWindow.show() sys.exit(app.exec_()) else: app.quit()