18 """ |
18 """ |
19 Class implementing a dialog to change the default size settings of the |
19 Class implementing a dialog to change the default size settings of the |
20 Source Outline pane. |
20 Source Outline pane. |
21 """ |
21 """ |
22 |
22 |
23 def __init__(self, currentWidth, defaultWidth, defaultStepSize, parent=None): |
23 def __init__(self, currentWidth, defaultWidth, parent=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param currentWidth value of the current width |
27 @param currentWidth value of the current width |
28 @type int |
28 @type int |
29 @param defaultWidth value of the default width |
29 @param defaultWidth value of the default width |
30 @type int |
|
31 @param defaultStepSize value of the step size |
|
32 @type int |
30 @type int |
33 @param parent reference to the parent widget (defaults to None) |
31 @param parent reference to the parent widget (defaults to None) |
34 @type QWidget (optional) |
32 @type QWidget (optional) |
35 """ |
33 """ |
36 super().__init__(parent) |
34 super().__init__(parent) |
37 self.setupUi(self) |
35 self.setupUi(self) |
38 |
36 |
39 self.__defaultWidth = defaultWidth |
37 self.__defaultWidth = defaultWidth |
40 self.__defaultStepSize = defaultStepSize |
|
41 |
38 |
42 self.sourceOutlineWidthSpinBox.setValue(currentWidth) |
39 self.sourceOutlineWidthSpinBox.setValue(currentWidth) |
43 self.sourceOutlineWidthStepSpinBox.setValue(defaultStepSize) |
|
44 |
40 |
45 msh = self.minimumSizeHint() |
41 msh = self.minimumSizeHint() |
46 self.resize(max(self.width(), msh.width()), msh.height()) |
42 self.resize(max(self.width(), msh.width()), msh.height()) |
47 |
43 |
48 @pyqtSlot(QAbstractButton) |
44 @pyqtSlot(QAbstractButton) |
55 """ |
51 """ |
56 if button is self.buttonBox.button( |
52 if button is self.buttonBox.button( |
57 QDialogButtonBox.StandardButton.RestoreDefaults |
53 QDialogButtonBox.StandardButton.RestoreDefaults |
58 ): |
54 ): |
59 self.sourceOutlineWidthSpinBox.setValue(self.__defaultWidth) |
55 self.sourceOutlineWidthSpinBox.setValue(self.__defaultWidth) |
60 self.sourceOutlineWidthStepSpinBox.setValue(self.__defaultStepSize) |
|
61 |
56 |
62 def getSizes(self): |
57 def getSizes(self): |
63 """ |
58 """ |
64 Public method to retrieve the entered values. |
59 Public method to retrieve the entered values. |
65 |
60 |
66 @return tuple containing the values of the default width and step size |
61 @return new default width value |
67 @rtype tuple of (int, int) |
62 @rtype int |
68 """ |
63 """ |
69 return ( |
64 return self.sourceOutlineWidthSpinBox.value() |
70 self.sourceOutlineWidthSpinBox.value(), |
|
71 self.sourceOutlineWidthStepSpinBox.value(), |
|
72 ) |
|