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