7 Module implementing a dialog to edit breakpoint properties. |
7 Module implementing a dialog to edit breakpoint properties. |
8 """ |
8 """ |
9 |
9 |
10 import os.path |
10 import os.path |
11 |
11 |
|
12 from PyQt6.QtCore import Qt |
12 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox |
13 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox |
13 |
14 |
14 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
15 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
15 |
16 |
16 from .Ui_EditBreakpointDialog import Ui_EditBreakpointDialog |
17 from .Ui_EditBreakpointDialog import Ui_EditBreakpointDialog |
55 |
56 |
56 self.filenamePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
57 self.filenamePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
57 self.filenamePicker.setSizeAdjustPolicy( |
58 self.filenamePicker.setSizeAdjustPolicy( |
58 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon |
59 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon |
59 ) |
60 ) |
60 |
|
61 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) |
|
62 |
61 |
63 fn, lineno = breakPointId |
62 fn, lineno = breakPointId |
64 |
63 |
65 if not addMode: |
64 if not addMode: |
66 cond, temp, enabled, count = properties |
65 cond, temp, enabled, count = properties |
115 curr = 0 |
114 curr = 0 |
116 self.conditionCombo.addItems(condHistory) |
115 self.conditionCombo.addItems(condHistory) |
117 self.conditionCombo.setCurrentIndex(curr) |
116 self.conditionCombo.setCurrentIndex(curr) |
118 |
117 |
119 if not fn: |
118 if not fn: |
120 self.okButton.setEnabled(False) |
119 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
|
120 False |
|
121 ) |
|
122 |
|
123 # set completer of condition combobox to be case sensitive |
|
124 self.conditionCombo.completer().setCaseSensitivity( |
|
125 Qt.CaseSensitivity.CaseSensitive |
|
126 ) |
121 |
127 |
122 msh = self.minimumSizeHint() |
128 msh = self.minimumSizeHint() |
123 self.resize(max(self.width(), msh.width()), msh.height()) |
129 self.resize(max(self.width(), msh.width()), msh.height()) |
124 |
130 |
125 def on_filenamePicker_editTextChanged(self, fn): |
131 def on_filenamePicker_editTextChanged(self, fn): |
126 """ |
132 """ |
127 Private slot to handle the change of the filename. |
133 Private slot to handle the change of the filename. |
128 |
134 |
129 @param fn text of the filename edit (string) |
135 @param fn text of the filename edit (string) |
130 """ |
136 """ |
131 if not fn: |
137 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(bool(fn)) |
132 self.okButton.setEnabled(False) |
|
133 else: |
|
134 self.okButton.setEnabled(True) |
|
135 |
138 |
136 def getData(self): |
139 def getData(self): |
137 """ |
140 """ |
138 Public method to retrieve the entered data. |
141 Public method to retrieve the entered data. |
139 |
142 |