src/eric7/WebBrowser/Tools/WebIconProvider.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
107 Public method to save the web site icons. 107 Public method to save the web site icons.
108 """ 108 """
109 if not self.__loaded: 109 if not self.__loaded:
110 return 110 return
111 111
112 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow 112 from eric7.WebBrowser.WebBrowserWindow import ( # __IGNORE_WARNING_I101__
113 WebBrowserWindow,
114 )
113 115
114 if not WebBrowserWindow.isPrivate() and bool(self.__iconDatabasePath): 116 if not WebBrowserWindow.isPrivate() and bool(self.__iconDatabasePath):
115 db = {} 117 db = {}
116 for url, icon in self.__iconsDB.items(): 118 for url, icon in self.__iconsDB.items():
117 ba = QByteArray() 119 ba = QByteArray()
217 self.load() 219 self.load()
218 self.__iconsDB = {} 220 self.__iconsDB = {}
219 self.changed.emit() 221 self.changed.emit()
220 self.__saveTimer.saveIfNeccessary() 222 self.__saveTimer.saveIfNeccessary()
221 223
222 def showWebIconDialog(self): 224 def showWebIconDialog(self, parent=None):
223 """ 225 """
224 Public method to show a dialog to manage the Favicons. 226 Public method to show a dialog to manage the Favicons.
225 """ 227
226 self.load() 228 @param parent reference to the parent widget
227 229 @type QWidget
230 """
228 from .WebIconDialog import WebIconDialog 231 from .WebIconDialog import WebIconDialog
229 232
230 dlg = WebIconDialog(self.__iconsDB) 233 self.load()
234
235 dlg = WebIconDialog(self.__iconsDB, parent=parent)
231 if dlg.exec() == QDialog.DialogCode.Accepted: 236 if dlg.exec() == QDialog.DialogCode.Accepted:
232 changed = False 237 changed = False
233 urls = dlg.getUrls() 238 urls = dlg.getUrls()
234 for url in list(self.__iconsDB.keys())[:]: 239 for url in list(self.__iconsDB.keys())[:]:
235 if url not in urls: 240 if url not in urls:

eric ide

mercurial