Helpviewer/Network/FtpReply.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3022
57179e4cdadd
child 3145
a9de05d4a22f
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
144 if not Preferences.getUI("UseProxy"): 144 if not Preferences.getUI("UseProxy"):
145 proxyType = E5FtpProxyType.NoProxy 145 proxyType = E5FtpProxyType.NoProxy
146 else: 146 else:
147 proxyType = Preferences.getUI("ProxyType/Ftp") 147 proxyType = Preferences.getUI("ProxyType/Ftp")
148 if proxyType != E5FtpProxyType.NoProxy: 148 if proxyType != E5FtpProxyType.NoProxy:
149 self.__ftp.setProxy(proxyType, 149 self.__ftp.setProxy(
150 proxyType,
150 Preferences.getUI("ProxyHost/Ftp"), 151 Preferences.getUI("ProxyHost/Ftp"),
151 Preferences.getUI("ProxyPort/Ftp")) 152 Preferences.getUI("ProxyPort/Ftp"))
152 if proxyType != E5FtpProxyType.NonAuthorizing: 153 if proxyType != E5FtpProxyType.NonAuthorizing:
153 self.__ftp.setProxyAuthentication( 154 self.__ftp.setProxyAuthentication(
154 Preferences.getUI("ProxyUser/Ftp"), 155 Preferences.getUI("ProxyUser/Ftp"),
287 AuthenticationDialog 288 AuthenticationDialog
288 info = self.trUtf8( 289 info = self.trUtf8(
289 "<b>Connect to proxy '{0}' using:</b>")\ 290 "<b>Connect to proxy '{0}' using:</b>")\
290 .format(Utilities.html_encode( 291 .format(Utilities.html_encode(
291 Preferences.getUI("ProxyHost/Ftp"))) 292 Preferences.getUI("ProxyHost/Ftp")))
292 dlg = AuthenticationDialog(info, 293 dlg = AuthenticationDialog(
293 Preferences.getUI("ProxyUser/Ftp"), True) 294 info, Preferences.getUI("ProxyUser/Ftp"), True)
294 dlg.setData(Preferences.getUI("ProxyUser/Ftp"), 295 dlg.setData(Preferences.getUI("ProxyUser/Ftp"),
295 Preferences.getUI("ProxyPassword/Ftp")) 296 Preferences.getUI("ProxyPassword/Ftp"))
296 if dlg.exec_() == QDialog.Accepted: 297 if dlg.exec_() == QDialog.Accepted:
297 username, password = dlg.getData() 298 username, password = dlg.getData()
298 if dlg.shallSave(): 299 if dlg.shallSave():
394 # write a blank pixmap on error 395 # write a blank pixmap on error
395 pixmap = QPixmap(size, size) 396 pixmap = QPixmap(size, size)
396 pixmap.fill(Qt.transparent) 397 pixmap.fill(Qt.transparent)
397 imageBuffer.buffer().clear() 398 imageBuffer.buffer().clear()
398 pixmap.save(imageBuffer, "PNG") 399 pixmap.save(imageBuffer, "PNG")
399 return cssString.format(size + 4, 400 return cssString.format(
401 size + 4,
400 str(imageBuffer.buffer().toBase64(), encoding="ascii")) 402 str(imageBuffer.buffer().toBase64(), encoding="ascii"))
401 403
402 def __setListContent(self): 404 def __setListContent(self):
403 """ 405 """
404 Private method to prepare the content for the reader. 406 Private method to prepare the content for the reader.

eric ide

mercurial