src/eric7/WebBrowser/SafeBrowsing/SafeBrowsingManager.py

branch
eric7
changeset 9413
80c06d472826
parent 9221
bf71ee032bb4
child 9473
3f23dbf37dbe
equal deleted inserted replaced
9412:45e7bb09c120 9413:80c06d472826
25 QUrl, 25 QUrl,
26 QDateTime, 26 QDateTime,
27 QTimer, 27 QTimer,
28 ) 28 )
29 29
30 import Preferences 30 from eric7 import Preferences, Utilities
31 import Utilities 31
32 32 from eric7.EricGui import EricPixmapCache
33 import UI.PixmapCache 33 from eric7.UI.NotificationWidget import NotificationTypes
34 from UI.NotificationWidget import NotificationTypes
35 34
36 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient 35 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient
37 from .SafeBrowsingCache import SafeBrowsingCache 36 from .SafeBrowsingCache import SafeBrowsingCache
38 from .SafeBrowsingThreatList import ThreatList, HashPrefixList 37 from .SafeBrowsingThreatList import ThreatList, HashPrefixList
39 from .SafeBrowsingUrl import SafeBrowsingUrl 38 from .SafeBrowsingUrl import SafeBrowsingUrl
159 @type str 158 @type str
160 @param timeout amount of time in seconds the message should be shown 159 @param timeout amount of time in seconds the message should be shown
161 (0 = indefinitely) 160 (0 = indefinitely)
162 @type int 161 @type int
163 """ 162 """
164 from WebBrowser.WebBrowserWindow import WebBrowserWindow 163 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
165 164
166 kind = ( 165 kind = (
167 NotificationTypes.CRITICAL 166 NotificationTypes.CRITICAL
168 if timeout == 0 167 if timeout == 0
169 else NotificationTypes.INFORMATION 168 else NotificationTypes.INFORMATION
170 ) 169 )
171 170
172 WebBrowserWindow.showNotification( 171 WebBrowserWindow.showNotification(
173 UI.PixmapCache.getPixmap("safeBrowsing48"), 172 EricPixmapCache.getPixmap("safeBrowsing48"),
174 self.tr("Google Safe Browsing"), 173 self.tr("Google Safe Browsing"),
175 message, 174 message,
176 kind=kind, 175 kind=kind,
177 timeout=timeout, 176 timeout=timeout,
178 ) 177 )
369 def showSafeBrowsingDialog(self): 368 def showSafeBrowsingDialog(self):
370 """ 369 """
371 Public slot to show the safe browsing management dialog. 370 Public slot to show the safe browsing management dialog.
372 """ 371 """
373 if self.__gsbDialog is None: 372 if self.__gsbDialog is None:
374 from WebBrowser.WebBrowserWindow import WebBrowserWindow 373 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
375 from .SafeBrowsingDialog import SafeBrowsingDialog 374 from .SafeBrowsingDialog import SafeBrowsingDialog
376 375
377 self.__gsbDialog = SafeBrowsingDialog( 376 self.__gsbDialog = SafeBrowsingDialog(
378 self, parent=WebBrowserWindow.mainWindow() 377 self, parent=WebBrowserWindow.mainWindow()
379 ) 378 )

eric ide

mercurial