ScolaSync: Fichier source de src/help.py

ScolaSync 5.1 |

help.py
Aller à la documentation de ce fichier.
1 #!/usr/bin/python
2 # $Id: help.py 47 2011-06-13 10:20:14Z georgesk $
3
4 licence={}
5 licence['en']="""
6 file help.py
7 this file is part of the project scolasync
8
9 Copyright (C) 2010-2015 Georges Khaznadar <georgesk@debian.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 version
28 from globaldef import _dir
29 from xml.dom.minidom import parse
30
31 class helpWindow(QDialog):
32
34
35 def __init__(self, parent=None):
36 QDialog.__init__(self, parent)
37 from Ui_help import Ui_Aide
38 self.ui=Ui_Aide()
39 self.ui.setupUi(self)
40 self.ui.labelVersion.setText(QApplication.translate("Main","Version numéro {major}.{minor}",None).format(major=version.major(), minor=version.minor()))
41 self.loadBrowsers(_dir("help"),self.parent().locale)
42 self.ui.closeButton.clicked.connect(self.close)
43
44 # met en place les textes dans les afficheurs, en fonction de la locale.
45 # le répertoire où sont les textes au format HTML est \b dir.
46 # @param dir le répertoire où sont les fichiers HTML
47 # @param locale la langue choisie
48 #
49
50 def loadBrowsers(self, dir, locale):
51 self.ui.usageBrowser.setHtml(QUrl("file://"+dir+"/usage_"+locale+".html"))
52 self.ui.authorsBrowser.setHtml(QUrl("file://"+dir+"/authors_"+locale+".html"))
53 self.ui.licenseBrowser.setHtml(QUrl("file://"+dir+"/license_"+locale+".html"))
54 self.ui.languagesBrowser.setHtml(QUrl("file://"+dir+"/languages_"+locale+".html"))
55 # parses the manual-tab's text to include the custom
56 # manual's URL.
57 manuals=parse(dir+"/manual_"+locale+".html")
58 dl=manuals.documentElement.getElementsByTagName("dl")[0]
59 dd=dl.getElementsByTagName("dd")[1]
60 a=dd.getElementsByTagName("a")[0]
61 a.setAttribute("href", self.parent().manFileLocation)
62 # then sets the manual-tab's contents
63 self.ui.manualBrowser.setText(manuals.toxml())
QDialog
src.help.helpWindow
Definition: help.py:31
src.help.helpWindow.loadBrowsers
def loadBrowsers(self, dir, locale)
Definition: help.py:50
QtCore
src.help.helpWindow.__init__
def __init__(self, parent=None)
Le constructeur.
Definition: help.py:35
QtWidgets
src.help.helpWindow.ui
ui
Definition: help.py:38