- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import sys
- import time
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- from PyQt4.QtNetwork import *
- from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings
- #############################################################################
- class Abort(Exception):
- """classe d'exception créée pour l'arrêt du thread"""
- pass
- #############################################################################
- class Propagande(QThread):
- """Thread de téléchargement"""
- #========================================================================
- def __init__(self, parent=None):
- super(Propagande,self).__init__(parent)
- #========================================================================
- def run(self):
- while(1):
- # Chargement de la page
- self.emit(SIGNAL("loader(PyQt_PyObject)"),"http://files.meteofrance.com/files/dm/videoplayer/mplayer.swf?autoplay=true")
- time.sleep(8)
- #############################################################################
- class Window1(QWebView):
- #========================================================================
- def __init__(self, parent=None):
- super(Window1,self).__init__(parent)
- Settings = self.settings()
- #QNetworkProxy.setApplicationProxy(QNetworkProxy(QNetworkProxy.HttpProxy, "192.168.69.3", 8080))
- Settings.setAttribute(QWebSettings.JavascriptEnabled, True)
- Settings.setAttribute(QWebSettings.PluginsEnabled, True)
- self.setWindowFlags(Qt.FramelessWindowHint);
- palette = self.palette()
- palette.setBrush(QPalette.Base, Qt.transparent)
- self.page().setPalette(palette)
- self.setAttribute(Qt.WA_OpaquePaintEvent, False);
- self.setAttribute(Qt.WA_TranslucentBackground, True);
- #self.setFixedSize(500,500);
- self.prop = Propagande()
- self.connect(self.prop, SIGNAL("loader(PyQt_PyObject)"), self.loader)
- self.prop.start()
- #========================================================================
- def loader(self, msg):
- url = msg
- self.load(QUrl(url))
- self.showFullScreen()
- #========================================================================
- #############################################################################
- if __name__ == "__main__":
- app = QApplication(sys.argv)
- fen = Window1()
- fen.show()
- sys.exit(app.exec_())