src/eric7/DataViews/PyCoverageHtmlReportDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
19 class PyCoverageHtmlReportDialog(QDialog, Ui_PyCoverageHtmlReportDialog): 19 class PyCoverageHtmlReportDialog(QDialog, Ui_PyCoverageHtmlReportDialog):
20 """ 20 """
21 Class implementing a dialog to enter the parameters for a coverage HTML 21 Class implementing a dialog to enter the parameters for a coverage HTML
22 report. 22 report.
23 """ 23 """
24
24 def __init__(self, defaultDirectory, parent=None): 25 def __init__(self, defaultDirectory, parent=None):
25 """ 26 """
26 Constructor 27 Constructor
27 28
28 @param defaultDirectory default directory for selecting the output 29 @param defaultDirectory default directory for selecting the output
29 directory 30 directory
30 @type str 31 @type str
31 @param parent reference to the parent widget (defaults to None) 32 @param parent reference to the parent widget (defaults to None)
32 @type QWidget (optional) 33 @type QWidget (optional)
33 """ 34 """
34 super().__init__(parent) 35 super().__init__(parent)
35 self.setupUi(self) 36 self.setupUi(self)
36 37
37 self.outputDirectoryPicker.setMode( 38 self.outputDirectoryPicker.setMode(
38 EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE) 39 EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE
40 )
39 self.outputDirectoryPicker.setDefaultDirectory(defaultDirectory) 41 self.outputDirectoryPicker.setDefaultDirectory(defaultDirectory)
40 42
41 self.extraCssPicker.setMode( 43 self.extraCssPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
42 EricPathPickerModes.OPEN_FILE_MODE) 44
43 45 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False)
44 self.buttonBox.button( 46
45 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
46
47 msh = self.minimumSizeHint() 47 msh = self.minimumSizeHint()
48 self.resize(max(self.width(), msh.width()), msh.height()) 48 self.resize(max(self.width(), msh.width()), msh.height())
49 49
50 @pyqtSlot(str) 50 @pyqtSlot(str)
51 def on_outputDirectoryPicker_textChanged(self, directory): 51 def on_outputDirectoryPicker_textChanged(self, directory):
52 """ 52 """
53 Private slot handling a change of the output directory. 53 Private slot handling a change of the output directory.
54 54
55 @param directory current text of the directory picker 55 @param directory current text of the directory picker
56 @type str 56 @type str
57 """ 57 """
58 self.buttonBox.button( 58 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
59 QDialogButtonBox.StandardButton.Ok).setEnabled(bool(directory)) 59 bool(directory)
60 60 )
61
61 def getData(self): 62 def getData(self):
62 """ 63 """
63 Public method to get the entered data. 64 Public method to get the entered data.
64 65
65 @return tuple containing the report title, the output directory, the 66 @return tuple containing the report title, the output directory, the
66 path of a file containing extra CSS and a flag indicating to open 67 path of a file containing extra CSS and a flag indicating to open
67 the generated report in a browser 68 the generated report in a browser
68 69
69 @rtype tuple of (str, str, str, bool) 70 @rtype tuple of (str, str, str, bool)
70 """ 71 """
71 title = self.titleEdit.text() 72 title = self.titleEdit.text()
72 return ( 73 return (
73 title if bool(title) else None, 74 title if bool(title) else None,

eric ide

mercurial