src/eric7/WebBrowser/SiteInfo/SiteInfoWidget.py

branch
eric7
changeset 9413
80c06d472826
parent 9384
b1b8e2dc2280
child 9473
3f23dbf37dbe
equal deleted inserted replaced
9412:45e7bb09c120 9413:80c06d472826
17 QSizePolicy, 17 QSizePolicy,
18 QPushButton, 18 QPushButton,
19 QSpacerItem, 19 QSpacerItem,
20 ) 20 )
21 21
22 import UI.PixmapCache 22 from eric7.EricGui import EricPixmapCache
23 23
24 from WebBrowser.WebBrowserWindow import WebBrowserWindow 24 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
25 25
26 26
27 class SiteInfoWidget(QMenu): 27 class SiteInfoWidget(QMenu):
28 """ 28 """
29 Class implementing a widget to show site related infos. 29 Class implementing a widget to show site related infos.
69 if url.scheme() in ["https"]: 69 if url.scheme() in ["https"]:
70 if WebBrowserWindow.networkManager().isInsecureHost(url.host()): 70 if WebBrowserWindow.networkManager().isInsecureHost(url.host()):
71 secureLabel.setText( 71 secureLabel.setText(
72 self.tr("Your connection to this site " "<b>may not be secure</b>.") 72 self.tr("Your connection to this site " "<b>may not be secure</b>.")
73 ) 73 )
74 secureIcon.setPixmap(UI.PixmapCache.getPixmap("securityMedium")) 74 secureIcon.setPixmap(EricPixmapCache.getPixmap("securityMedium"))
75 else: 75 else:
76 secureLabel.setText( 76 secureLabel.setText(
77 self.tr("Your connection to this site is <b>secure</b>.") 77 self.tr("Your connection to this site is <b>secure</b>.")
78 ) 78 )
79 secureIcon.setPixmap(UI.PixmapCache.getPixmap("securityHigh")) 79 secureIcon.setPixmap(EricPixmapCache.getPixmap("securityHigh"))
80 else: 80 else:
81 secureLabel.setText( 81 secureLabel.setText(
82 self.tr("Your connection to this site is <b>not secure</b>.") 82 self.tr("Your connection to this site is <b>not secure</b>.")
83 ) 83 )
84 secureIcon.setPixmap(UI.PixmapCache.getPixmap("securityLow")) 84 secureIcon.setPixmap(EricPixmapCache.getPixmap("securityLow"))
85 rows += 1 85 rows += 1
86 86
87 visits = WebBrowserWindow.historyManager().siteVisitsCount( 87 visits = WebBrowserWindow.historyManager().siteVisitsCount(
88 url.scheme(), url.host() 88 url.scheme(), url.host()
89 ) 89 )
96 layout.addWidget(historyLabel, rows, 1) 96 layout.addWidget(historyLabel, rows, 1)
97 if visits > 3: 97 if visits > 3:
98 historyLabel.setText( 98 historyLabel.setText(
99 self.tr("This is your <b>{0}.</b> visit of this site.").format(visits) 99 self.tr("This is your <b>{0}.</b> visit of this site.").format(visits)
100 ) 100 )
101 historyIcon.setPixmap(UI.PixmapCache.getPixmap("flagGreen")) 101 historyIcon.setPixmap(EricPixmapCache.getPixmap("flagGreen"))
102 elif visits == 0: 102 elif visits == 0:
103 historyLabel.setText( 103 historyLabel.setText(
104 self.tr("You have <b>never</b> visited this site before.").format( 104 self.tr("You have <b>never</b> visited this site before.").format(
105 visits 105 visits
106 ) 106 )
107 ) 107 )
108 historyIcon.setPixmap(UI.PixmapCache.getPixmap("flagBlack")) 108 historyIcon.setPixmap(EricPixmapCache.getPixmap("flagBlack"))
109 else: 109 else:
110 historyIcon.setPixmap(UI.PixmapCache.getPixmap("flagYellow")) 110 historyIcon.setPixmap(EricPixmapCache.getPixmap("flagYellow"))
111 if visits == 1: 111 if visits == 1:
112 visitStr = self.tr("first") 112 visitStr = self.tr("first")
113 elif visits == 2: 113 elif visits == 2:
114 visitStr = self.tr("second") 114 visitStr = self.tr("second")
115 else: 115 else:

eric ide

mercurial