128 """ |
128 """ |
129 Private slot to set some data after the page was loaded. |
129 Private slot to set some data after the page was loaded. |
130 |
130 |
131 @param ok flag indicating a successful load (boolean) |
131 @param ok flag indicating a successful load (boolean) |
132 """ |
132 """ |
133 if self.__browser.url().scheme() in ["pyrc", "about"]: |
133 try: |
134 self.__bookmarkButton.setVisible(False) |
134 if self.__browser.url().scheme() in ["pyrc", "about"]: |
135 else: |
135 self.__bookmarkButton.setVisible(False) |
136 if Helpviewer.HelpWindow.HelpWindow.bookmarksManager()\ |
|
137 .bookmarkForUrl(self.__browser.url()) is None: |
|
138 self.__bookmarkButton.setIcon(self.__bmInactiveIcon) |
|
139 else: |
136 else: |
140 self.__bookmarkButton.setIcon(self.__bmActiveIcon) |
137 if Helpviewer.HelpWindow.HelpWindow.bookmarksManager()\ |
141 self.__bookmarkButton.setVisible(True) |
138 .bookmarkForUrl(self.__browser.url()) is None: |
142 |
139 self.__bookmarkButton.setIcon(self.__bmInactiveIcon) |
143 if ok and \ |
140 else: |
144 self.__browser.url().scheme() == "https" and \ |
141 self.__bookmarkButton.setIcon(self.__bmActiveIcon) |
145 QSslCertificate is not None: |
142 self.__bookmarkButton.setVisible(True) |
146 sslInfo = self.__browser.page().getSslInfo() |
143 |
147 if sslInfo is not None: |
144 if ok and \ |
148 org = Utilities.decodeString( |
145 self.__browser.url().scheme() == "https" and \ |
149 sslInfo.subjectInfo(QSslCertificate.Organization)) |
146 QSslCertificate is not None: |
150 if org == "": |
147 sslInfo = self.__browser.page().getSslInfo() |
151 cn = Utilities.decodeString( |
148 if sslInfo is not None: |
152 sslInfo.subjectInfo(QSslCertificate.CommonName)) |
149 org = Utilities.decodeString( |
153 if cn != "": |
150 sslInfo.subjectInfo(QSslCertificate.Organization)) |
154 org = cn.split(".", 1)[1] |
|
155 if org == "": |
151 if org == "": |
156 org = self.trUtf8("Unknown") |
152 cn = Utilities.decodeString( |
157 self.__sslLabel.setText(" {0} ".format(org)) |
153 sslInfo.subjectInfo(QSslCertificate.CommonName)) |
158 self.__sslLabel.setVisible(True) |
154 if cn != "": |
159 return |
155 org = cn.split(".", 1)[1] |
160 |
156 if org == "": |
161 self.__sslLabel.setVisible(False) |
157 org = self.trUtf8("Unknown") |
|
158 self.__sslLabel.setText(" {0} ".format(org)) |
|
159 self.__sslLabel.setVisible(True) |
|
160 return |
|
161 |
|
162 self.__sslLabel.setVisible(False) |
|
163 except RuntimeError: |
|
164 pass |
162 |
165 |
163 def setPrivateMode(self, on): |
166 def setPrivateMode(self, on): |
164 """ |
167 """ |
165 Public method to set the private mode. |
168 Public method to set the private mode. |
166 |
169 |