1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2006 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
7
Module implementing the Debugger Python configuration page.
10
from PyQt4.QtCore import QDir, QString, pyqtSignature
12
from KdeQt import KQFileDialog
14
from E4Gui.E4Completers import E4FileCompleter
16
from ConfigurationPageBase import ConfigurationPageBase
17
from Ui_DebuggerPythonPage import Ui_DebuggerPythonPage
22
class DebuggerPythonPage(ConfigurationPageBase, Ui_DebuggerPythonPage):
24
Class implementing the Debugger Python configuration page.
30
ConfigurationPageBase.__init__(self)
32
self.setObjectName("DebuggerPythonPage")
34
self.interpreterCompleter = E4FileCompleter(self.interpreterEdit)
35
self.debugClientCompleter = E4FileCompleter(self.debugClientEdit)
38
self.customPyCheckBox.setChecked(\
39
Preferences.getDebugger("CustomPythonInterpreter"))
40
self.interpreterEdit.setText(\
41
Preferences.getDebugger("PythonInterpreter"))
42
dct = Preferences.getDebugger("DebugClientType")
44
self.standardButton.setChecked(True)
45
elif dct == "threaded":
46
self.threadedButton.setChecked(True)
48
self.customButton.setChecked(True)
49
self.debugClientEdit.setText(\
50
Preferences.getDebugger("DebugClient"))
51
self.pyRedirectCheckBox.setChecked(\
52
Preferences.getDebugger("PythonRedirect"))
53
self.pyNoEncodingCheckBox.setChecked(\
54
Preferences.getDebugger("PythonNoEncoding"))
58
Public slot to save the Debugger Python configuration.
60
Preferences.setDebugger("CustomPythonInterpreter",
61
int(self.customPyCheckBox.isChecked()))
62
Preferences.setDebugger("PythonInterpreter",
63
self.interpreterEdit.text())
64
if self.standardButton.isChecked():
66
elif self.threadedButton.isChecked():
70
Preferences.setDebugger("DebugClientType", dct)
71
Preferences.setDebugger("DebugClient",
72
self.debugClientEdit.text())
73
Preferences.setDebugger("PythonRedirect",
74
int(self.pyRedirectCheckBox.isChecked()))
75
Preferences.setDebugger("PythonNoEncoding",
76
int(self.pyNoEncodingCheckBox.isChecked()))
79
def on_interpreterButton_clicked(self):
81
Private slot to handle the Python interpreter selection.
83
file = KQFileDialog.getOpenFileName(\
85
self.trUtf8("Select Python interpreter for Debug Client"),
86
self.interpreterEdit.text(),
89
if not file.isEmpty():
90
self.interpreterEdit.setText(\
91
Utilities.toNativeSeparators(file))
94
def on_debugClientButton_clicked(self):
96
Private slot to handle the Debug Client selection.
98
file = KQFileDialog.getOpenFileName(\
100
self.trUtf8("Select Debug Client"),
101
self.debugClientEdit.text(),
102
self.trUtf8("Python Files (*.py)"))
104
if not file.isEmpty():
105
self.debugClientEdit.setText(\
106
Utilities.toNativeSeparators(file))
110
Module function to create the configuration page.
112
@param dlg reference to the configuration dialog
114
page = DebuggerPythonPage()