9 |
9 |
10 from PyQt6.QtCore import pyqtSlot, Qt, QUrl, QUrlQuery |
10 from PyQt6.QtCore import pyqtSlot, Qt, QUrl, QUrlQuery |
11 from PyQt6.QtGui import QDesktopServices |
11 from PyQt6.QtGui import QDesktopServices |
12 from PyQt6.QtWidgets import QDialog, QListWidgetItem |
12 from PyQt6.QtWidgets import QDialog, QListWidgetItem |
13 |
13 |
14 from E5Gui import E5MessageBox |
14 from E5Gui import EricMessageBox |
15 |
15 |
16 from .Ui_UnknownDevicesDialog import Ui_UnknownDevicesDialog |
16 from .Ui_UnknownDevicesDialog import Ui_UnknownDevicesDialog |
17 |
17 |
18 import Preferences |
18 import Preferences |
19 from UI.Info import BugAddress |
19 from UI.Info import BugAddress |
148 """ |
148 """ |
149 unsaved = False |
149 unsaved = False |
150 for itm in self.deviceList.selectedItems(): |
150 for itm in self.deviceList.selectedItems(): |
151 unsaved |= itm.data(self.ModifiedRole) |
151 unsaved |= itm.data(self.ModifiedRole) |
152 if unsaved: |
152 if unsaved: |
153 ok = E5MessageBox.yesNo( |
153 ok = EricMessageBox.yesNo( |
154 self, |
154 self, |
155 self.tr("Delete Unknown Devices"), |
155 self.tr("Delete Unknown Devices"), |
156 self.tr("The selected entries contain some with modified" |
156 self.tr("The selected entries contain some with modified" |
157 " data. Shall they really be deleted?")) |
157 " data. Shall they really be deleted?")) |
158 if not ok: |
158 if not ok: |
166 def on_deleteAllButton_clicked(self): |
166 def on_deleteAllButton_clicked(self): |
167 """ |
167 """ |
168 Private slot to delete all devices. |
168 Private slot to delete all devices. |
169 """ |
169 """ |
170 if self.__isDirty(): |
170 if self.__isDirty(): |
171 ok = E5MessageBox.yesNo( |
171 ok = EricMessageBox.yesNo( |
172 self, |
172 self, |
173 self.tr("Delete Unknown Devices"), |
173 self.tr("Delete Unknown Devices"), |
174 self.tr("The list contains some devices with modified" |
174 self.tr("The list contains some devices with modified" |
175 " data. Shall they really be deleted?")) |
175 " data. Shall they really be deleted?")) |
176 if not ok: |
176 if not ok: |
182 def on_restoreButton_clicked(self): |
182 def on_restoreButton_clicked(self): |
183 """ |
183 """ |
184 Private slot to restore the list of unknown devices. |
184 Private slot to restore the list of unknown devices. |
185 """ |
185 """ |
186 if self.__isDirty(): |
186 if self.__isDirty(): |
187 ok = E5MessageBox.yesNo( |
187 ok = EricMessageBox.yesNo( |
188 self, |
188 self, |
189 self.tr("Restore Unknown Devices"), |
189 self.tr("Restore Unknown Devices"), |
190 self.tr("Restoring the list of unknown devices will overwrite" |
190 self.tr("Restoring the list of unknown devices will overwrite" |
191 " all changes made. Do you really want to restore the" |
191 " all changes made. Do you really want to restore the" |
192 " list?")) |
192 " list?")) |
245 def on_buttonBox_rejected(self): |
245 def on_buttonBox_rejected(self): |
246 """ |
246 """ |
247 Private slot handling the cancellation of the dialog. |
247 Private slot handling the cancellation of the dialog. |
248 """ |
248 """ |
249 if self.__isDirty(): |
249 if self.__isDirty(): |
250 ok = E5MessageBox.okToClearData( |
250 ok = EricMessageBox.okToClearData( |
251 self, |
251 self, |
252 self.tr("Unsaved Data"), |
252 self.tr("Unsaved Data"), |
253 self.tr("""The list of devices contains some with modified""" |
253 self.tr("""The list of devices contains some with modified""" |
254 """ data."""), |
254 """ data."""), |
255 self.__saveDeviceData) |
255 self.__saveDeviceData) |