Preferences/ConfigurationPages/HelpDocumentationPage.py

Sat, 20 Mar 2010 13:14:56 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 20 Mar 2010 13:14:56 +0000
changeset 148
727a907b8305
parent 97
c4086afea02b
child 518
2b991e88765e
child 792
a13346916170
permissions
-rw-r--r--

Changed help documentation config page to select files instead of directories.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
13
1af94a91f439 Changed copyright for 2010.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 12
diff changeset
3 # Copyright (c) 2006 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Help Documentation configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
10 from PyQt4.QtCore import pyqtSlot, QUrl
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt4.QtGui import QFileDialog
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
13 from E5Gui.E5Completers import E5FileCompleter
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
15 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
16 from .Ui_HelpDocumentationPage import Ui_HelpDocumentationPage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 class HelpDocumentationPage(ConfigurationPageBase, Ui_HelpDocumentationPage):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Class implementing the Help Documentation configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 ConfigurationPageBase.__init__(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setObjectName("HelpDocumentationPage")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
33 self.pythonDocDirCompleter = E5FileCompleter(self.pythonDocDirEdit)
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
34 self.qt4DocDirCompleter = E5FileCompleter(self.qt4DocDirEdit)
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
35 self.pyqt4DocDirCompleter = E5FileCompleter(self.pyqt4DocDirEdit)
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
36 self.pysideDocDirCompleter = E5FileCompleter(self.pysideDocDirEdit)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 import PySide
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.pysideGroup.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 del PySide
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 except ImportError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.pysideGroup.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 # set initial values
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.pythonDocDirEdit.setText(\
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 Preferences.getHelp("PythonDocDir"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.qt4DocDirEdit.setText(\
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 Preferences.getHelp("Qt4DocDir"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.pyqt4DocDirEdit.setText(\
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 Preferences.getHelp("PyQt4DocDir"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.pysideDocDirEdit.setText(\
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 Preferences.getHelp("PySideDocDir"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 Public slot to save the Help Documentation configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 Preferences.setHelp("PythonDocDir",
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 self.pythonDocDirEdit.text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 Preferences.setHelp("Qt4DocDir",
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 self.qt4DocDirEdit.text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 Preferences.setHelp("PyQt4DocDir",
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.pyqt4DocDirEdit.text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 Preferences.setHelp("PySideDocDir",
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.pysideDocDirEdit.text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 def on_pythonDocDirButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 Private slot to select the Python documentation directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
73 entry = QFileDialog.getOpenFileName(\
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self,
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
75 self.trUtf8("Select Python documentation entry"),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
76 QUrl(self.pythonDocDirEdit.text()).path(),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
77 self.trUtf8("HTML Files (*.html *.htm);;All Files (*)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
79 if entry:
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
80 self.pythonDocDirEdit.setText(Utilities.toNativeSeparators(entry))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 def on_qt4DocDirButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 Private slot to select the Qt4 documentation directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
87 entry = QFileDialog.getOpenFileName(\
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self,
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
89 self.trUtf8("Select Qt4 documentation entry"),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
90 QUrl(self.qt4DocDirEdit.text()).path(),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
91 self.trUtf8("HTML Files (*.html *.htm);;All Files (*)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
93 if entry:
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
94 self.qt4DocDirEdit.setText(Utilities.toNativeSeparators(entry))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 def on_pyqt4DocDirButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 Private slot to select the PyQt4 documentation directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 """
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
101 entry = QFileDialog.getOpenFileName(\
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self,
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
103 self.trUtf8("Select PyQt4 documentation entry"),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
104 QUrl(self.pyqt4DocDirEdit.text()).path(),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
105 self.trUtf8("HTML Files (*.html *.htm);;All Files (*)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
107 if entry:
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
108 self.pyqt4DocDirEdit.setText(Utilities.toNativeSeparators(entry))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 def on_pysideDocDirButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 Private slot to select the PySide documentation directory.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
115 entry = QFileDialog.getOpenFileName(\
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 self,
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
117 self.trUtf8("Select PySide documentation entry"),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
118 QUrl(self.pysideDocDirEdit.text()).path(),
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
119 self.trUtf8("HTML Files (*.html *.htm);;All Files (*)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120
148
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
121 if entry:
727a907b8305 Changed help documentation config page to select files instead of directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
122 self.pysideDocDirEdit.setText(Utilities.toNativeSeparators(entry))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 @param dlg reference to the configuration dialog
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 page = HelpDocumentationPage()
97
c4086afea02b Finished cleaning up the code supported by py3flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 55
diff changeset
131 return page

eric ide

mercurial