8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtCore import QItemSelectionModel, QModelIndex, QSortFilterProxyModel, Qt |
10 from PyQt6.QtCore import QItemSelectionModel, QModelIndex, QSortFilterProxyModel, Qt |
11 from PyQt6.QtWidgets import QAbstractItemView, QDialog, QHeaderView, QMenu, QTreeView |
11 from PyQt6.QtWidgets import QAbstractItemView, QDialog, QHeaderView, QMenu, QTreeView |
12 |
12 |
13 from eric7 import Utilities |
13 from eric7 import EricUtilities |
14 from eric7.EricWidgets import EricMessageBox |
14 from eric7.EricWidgets import EricMessageBox |
15 from eric7.EricWidgets.EricApplication import ericApp |
15 from eric7.EricWidgets.EricApplication import ericApp |
16 |
16 |
17 |
17 |
18 class WatchPointViewer(QTreeView): |
18 class WatchPointViewer(QTreeView): |
247 duplicate = idx.isValid() and idx.internalPointer() != index.internalPointer() |
247 duplicate = idx.isValid() and idx.internalPointer() != index.internalPointer() |
248 if showMessage and duplicate: |
248 if showMessage and duplicate: |
249 if not special: |
249 if not special: |
250 msg = self.tr( |
250 msg = self.tr( |
251 """<p>A watch expression '<b>{0}</b>' already exists.</p>""" |
251 """<p>A watch expression '<b>{0}</b>' already exists.</p>""" |
252 ).format(Utilities.html_encode(cond)) |
252 ).format(EricUtilities.html_encode(cond)) |
253 else: |
253 else: |
254 msg = self.tr( |
254 msg = self.tr( |
255 """<p>A watch expression '<b>{0}</b>'""" |
255 """<p>A watch expression '<b>{0}</b>'""" |
256 """ for the variable <b>{1}</b> already exists.</p>""" |
256 """ for the variable <b>{1}</b> already exists.</p>""" |
257 ).format(special, Utilities.html_encode(cond)) |
257 ).format(special, EricUtilities.html_encode(cond)) |
258 EricMessageBox.warning( |
258 EricMessageBox.warning( |
259 self, self.tr("Watch expression already exists"), msg |
259 self, self.tr("Watch expression already exists"), msg |
260 ) |
260 ) |
261 |
261 |
262 return duplicate |
262 return duplicate |