18 from E5Gui import E5FileDialog |
18 from E5Gui import E5FileDialog |
19 |
19 |
20 from .Ui_EditBreakpointDialog import Ui_EditBreakpointDialog |
20 from .Ui_EditBreakpointDialog import Ui_EditBreakpointDialog |
21 |
21 |
22 import Utilities |
22 import Utilities |
|
23 import UI.PixmapCache |
23 |
24 |
24 |
25 |
25 class EditBreakpointDialog(QDialog, Ui_EditBreakpointDialog): |
26 class EditBreakpointDialog(QDialog, Ui_EditBreakpointDialog): |
26 """ |
27 """ |
27 Class implementing a dialog to edit breakpoint properties. |
28 Class implementing a dialog to edit breakpoint properties. |
46 super(EditBreakpointDialog, self).__init__(parent) |
47 super(EditBreakpointDialog, self).__init__(parent) |
47 self.setupUi(self) |
48 self.setupUi(self) |
48 if name: |
49 if name: |
49 self.setObjectName(name) |
50 self.setObjectName(name) |
50 self.setModal(modal) |
51 self.setModal(modal) |
|
52 |
|
53 self.fileButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
51 |
54 |
52 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
55 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
53 self.filenameCompleter = E5FileCompleter(self.filenameCombo) |
56 self.filenameCompleter = E5FileCompleter(self.filenameCombo) |
54 |
57 |
55 fn, lineno = id |
58 fn, lineno = id |
85 self.filenameCombo.setEnabled(False) |
88 self.filenameCombo.setEnabled(False) |
86 self.fileButton.setEnabled(False) |
89 self.fileButton.setEnabled(False) |
87 self.linenoSpinBox.setEnabled(False) |
90 self.linenoSpinBox.setEnabled(False) |
88 self.conditionCombo.setFocus() |
91 self.conditionCombo.setFocus() |
89 else: |
92 else: |
90 self.setWindowTitle(self.trUtf8("Add Breakpoint")) |
93 self.setWindowTitle(self.tr("Add Breakpoint")) |
91 # set the filename |
94 # set the filename |
92 if fn is None: |
95 if fn is None: |
93 fn = "" |
96 fn = "" |
94 try: |
97 try: |
95 curr = filenameHistory.index(fn) |
98 curr = filenameHistory.index(fn) |
110 self.conditionCombo.setCurrentIndex(curr) |
113 self.conditionCombo.setCurrentIndex(curr) |
111 |
114 |
112 if not fn: |
115 if not fn: |
113 self.okButton.setEnabled(False) |
116 self.okButton.setEnabled(False) |
114 |
117 |
|
118 msh = self.minimumSizeHint() |
|
119 self.resize(max(self.width(), msh.width()), msh.height()) |
|
120 |
115 @pyqtSlot() |
121 @pyqtSlot() |
116 def on_fileButton_clicked(self): |
122 def on_fileButton_clicked(self): |
117 """ |
123 """ |
118 Private slot to select a file via a file selection dialog. |
124 Private slot to select a file via a file selection dialog. |
119 """ |
125 """ |
120 file = E5FileDialog.getOpenFileName( |
126 file = E5FileDialog.getOpenFileName( |
121 self, |
127 self, |
122 self.trUtf8("Select filename of the breakpoint"), |
128 self.tr("Select filename of the breakpoint"), |
123 self.filenameCombo.currentText(), |
129 self.filenameCombo.currentText(), |
124 "") |
130 "") |
125 |
131 |
126 if file: |
132 if file: |
127 self.filenameCombo.setEditText(Utilities.toNativeSeparators(file)) |
133 self.filenameCombo.setEditText(Utilities.toNativeSeparators(file)) |