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