ScolaSync
4.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
python3safe=
True
27
28
from
PyQt4.QtCore
import
*
29
from
PyQt4.QtGui
import
*
30
import
subprocess
31
32
##
33
#
34
# Une classe qui ouvre Firefox quand on clique sur un lien externe
35
#
36
class
myTextBrowser
(
QTextBrowser
):
37
##
38
#
39
# lance Firefox en tâche de fond.
40
# @param url l'adresse à ouvrir.
41
#
42
def
setSource
(self,url):
43
subprocess.call(
"(firefox %s &)"
%url.toString(),shell=
True
)
44
45
##
46
#
47
# lien vers la méthode setSource originale
48
# @param url l'adresse à ouvrir.
49
#
50
def
setHtml
(self,url):
51
QTextBrowser.setSource(self,QUrl(url))
52
src
mytextbrowser.py
Généré le Samedi Juin 22 2013 15:36:35 pour ScolaSync par
1.8.1.2