eric7/WebBrowser/Feeds/FeedsManager.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
10 from PyQt6.QtCore import pyqtSlot, pyqtSignal, Qt, QUrl, QXmlStreamReader 10 from PyQt6.QtCore import pyqtSlot, pyqtSignal, Qt, QUrl, QXmlStreamReader
11 from PyQt6.QtGui import QCursor 11 from PyQt6.QtGui import QCursor
12 from PyQt6.QtWidgets import QDialog, QTreeWidgetItem, QMenu, QApplication 12 from PyQt6.QtWidgets import QDialog, QTreeWidgetItem, QMenu, QApplication
13 from PyQt6.QtNetwork import QNetworkRequest, QNetworkReply 13 from PyQt6.QtNetwork import QNetworkRequest, QNetworkReply
14 14
15 from E5Gui import E5MessageBox 15 from E5Gui import EricMessageBox
16 16
17 from .Ui_FeedsManager import Ui_FeedsManager 17 from .Ui_FeedsManager import Ui_FeedsManager
18 18
19 import Preferences 19 import Preferences
20 import UI.PixmapCache 20 import UI.PixmapCache
177 dlg = FeedEditDialog(origUrlString, origTitle) 177 dlg = FeedEditDialog(origUrlString, origTitle)
178 if dlg.exec() == QDialog.DialogCode.Accepted: 178 if dlg.exec() == QDialog.DialogCode.Accepted:
179 urlString, title = dlg.getData() 179 urlString, title = dlg.getData()
180 for feed in self.__feeds: 180 for feed in self.__feeds:
181 if feed[0] == urlString: 181 if feed[0] == urlString:
182 E5MessageBox.critical( 182 EricMessageBox.critical(
183 self, 183 self,
184 self.tr("Duplicate Feed URL"), 184 self.tr("Duplicate Feed URL"),
185 self.tr( 185 self.tr(
186 """A feed with the URL {0} exists already.""" 186 """A feed with the URL {0} exists already."""
187 """ Aborting...""".format(urlString))) 187 """ Aborting...""".format(urlString)))
199 """ 199 """
200 Private slot to delete the selected feed. 200 Private slot to delete the selected feed.
201 """ 201 """
202 itm = self.feedsTree.selectedItems()[0] 202 itm = self.feedsTree.selectedItems()[0]
203 title = itm.text(0) 203 title = itm.text(0)
204 res = E5MessageBox.yesNo( 204 res = EricMessageBox.yesNo(
205 self, 205 self,
206 self.tr("Delete Feed"), 206 self.tr("Delete Feed"),
207 self.tr( 207 self.tr(
208 """<p>Do you really want to delete the feed""" 208 """<p>Do you really want to delete the feed"""
209 """ <b>{0}</b>?</p>""".format(title))) 209 """ <b>{0}</b>?</p>""".format(title)))
479 if itm is None: 479 if itm is None:
480 return 480 return
481 481
482 errorStr = itm.data(0, FeedsManager.ErrorDataRole) 482 errorStr = itm.data(0, FeedsManager.ErrorDataRole)
483 if errorStr: 483 if errorStr:
484 E5MessageBox.critical( 484 EricMessageBox.critical(
485 self, 485 self,
486 self.tr("Error loading feed"), 486 self.tr("Error loading feed"),
487 "{0}".format(errorStr)) 487 "{0}".format(errorStr))

eric ide

mercurial