ScolaSync  5.1
mytextbrowser.py
Aller à la documentation de ce fichier.
1 #!/usr/bin/python
2 # $Id: mytextbrowser.py 8 2010-10-11 10:03:05Z georgesk $
3 
4 licence={}
5 licence['en']="""
6  file mytextbrowser.py
7  this file is part of the project scolasync
8 
9  Copyright (C) 2010 Georges Khaznadar <georgesk@ofset.org>
10 
11  This program is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version3 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program. If not, see <http://www.gnu.org/licenses/>.
23 """
24 
25 from PyQt5.QtCore import *
26 from PyQt5.QtWidgets import *
27 import subprocess
28 
29 ##
30 #
31 # Une classe qui ouvre Firefox quand on clique sur un lien externe
32 #
34  ##
35  #
36  # lance Firefox en tâche de fond.
37  # @param url l'adresse à ouvrir.
38  #
39  def setSource(self,url):
40  subprocess.call("(firefox %s &)"%url,shell=True)
41 
42  ##
43  #
44  # lien vers la méthode setSource originale
45  # @param url l'adresse à ouvrir.
46  #
47  def setHtml(self,url):
48  QTextBrowser.setSource(self,QUrl(url))
def setSource(self, url)
lance Firefox en tâche de fond.
def setHtml(self, url)
lien vers la méthode setSource originale
Une classe qui ouvre Firefox quand on clique sur un lien externe.