eric6/UI/UserInterface.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8177
5688d73cc3ae
parent 8268
6b8128e0c9d1
child 8400
b3eefd7e58d1
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
13 import shutil 13 import shutil
14 import json 14 import json
15 import datetime 15 import datetime
16 import getpass 16 import getpass
17 import functools 17 import functools
18 import contextlib
18 19
19 from PyQt5.QtCore import ( 20 from PyQt5.QtCore import (
20 pyqtSlot, QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, 21 pyqtSlot, QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate,
21 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt, QUuid, QThread, 22 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt, QUuid, QThread,
22 QUrlQuery 23 QUrlQuery
57 58
58 from E5Network.E5NetworkProxyFactory import ( 59 from E5Network.E5NetworkProxyFactory import (
59 E5NetworkProxyFactory, proxyAuthenticationRequired 60 E5NetworkProxyFactory, proxyAuthenticationRequired
60 ) 61 )
61 try: 62 try:
62 from E5Network.E5SslErrorHandler import E5SslErrorHandler 63 from E5Network.E5SslErrorHandler import E5SslErrorHandler, E5SslErrorState
63 SSL_AVAILABLE = True 64 SSL_AVAILABLE = True
64 except ImportError: 65 except ImportError:
65 SSL_AVAILABLE = False 66 SSL_AVAILABLE = False
66 67
67 from eric6config import getConfig 68 from eric6config import getConfig
84 @param stderr flag indicating stderr is being redirected 85 @param stderr flag indicating stderr is being redirected
85 @type bool 86 @type bool
86 @param parent reference to the parent object 87 @param parent reference to the parent object
87 @type QObject 88 @type QObject
88 """ 89 """
89 super(Redirector, self).__init__(parent) 90 super().__init__(parent)
90 self.stderr = stderr 91 self.stderr = stderr
91 self.buffer = '' 92 self.buffer = ''
92 93
93 def __nWrite(self, n): 94 def __nWrite(self, n):
94 """ 95 """
189 a restart 190 a restart
190 @type list of str 191 @type list of str
191 @param originalPathString original PATH environment variable 192 @param originalPathString original PATH environment variable
192 @type str 193 @type str
193 """ 194 """
194 super(UserInterface, self).__init__() 195 super().__init__()
195 196
196 self.__restartArgs = restartArguments[:] 197 self.__restartArgs = restartArguments[:]
197 198
198 self.setStyle(Preferences.getUI("Style"), 199 self.setStyle(Preferences.getUI("Style"),
199 Preferences.getUI("StyleSheet")) 200 Preferences.getUI("StyleSheet"))
200 201
201 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") 202 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength")
202 self.locale = locale 203 self.locale = locale
203 self.__noOpenAtStartup = noOpenAtStartup 204 self.__openAtStartup = not noOpenAtStartup
204 self.__noCrashOpenAtStartup = noCrashOpenAtStartup 205 self.__noCrashOpenAtStartup = noCrashOpenAtStartup
205 self.__disableCrashSession = disableCrashSession 206 self.__disableCrashSession = disableCrashSession
206 self.__disabledPlugins = disabledPlugins[:] 207 self.__disabledPlugins = disabledPlugins[:]
207 208
208 self.__originalPathString = originalPathString 209 self.__originalPathString = originalPathString
1025 """ 1026 """
1026 Private method to create the Sidebars layout. 1027 Private method to create the Sidebars layout.
1027 1028
1028 @param debugServer reference to the debug server object 1029 @param debugServer reference to the debug server object
1029 """ 1030 """
1030 from E5Gui.E5SideBar import E5SideBar 1031 from E5Gui.E5SideBar import E5SideBar, E5SideBarSide
1031 1032
1032 logging.debug("Creating Sidebars Layout...") 1033 logging.debug("Creating Sidebars Layout...")
1033 1034
1034 delay = Preferences.getUI("SidebarDelay") 1035 delay = Preferences.getUI("SidebarDelay")
1035 # Create the left sidebar 1036 # Create the left sidebar
1036 self.leftSidebar = E5SideBar(E5SideBar.West, delay) 1037 self.leftSidebar = E5SideBar(E5SideBarSide.WEST, delay)
1037 1038
1038 # Create the bottom sidebar 1039 # Create the bottom sidebar
1039 self.bottomSidebar = E5SideBar(E5SideBar.South, delay) 1040 self.bottomSidebar = E5SideBar(E5SideBarSide.SOUTH, delay)
1040 1041
1041 # Create the right sidebar 1042 # Create the right sidebar
1042 self.rightSidebar = E5SideBar(E5SideBar.East, delay) 1043 self.rightSidebar = E5SideBar(E5SideBarSide.EAST, delay)
1043 1044
1044 #################################################### 1045 ####################################################
1045 ## Populate the left side bar 1046 ## Populate the left side bar
1046 #################################################### 1047 ####################################################
1047 1048
1390 if self.__readCrashSession(): 1391 if self.__readCrashSession():
1391 return 1392 return
1392 1393
1393 # no args, return 1394 # no args, return
1394 if args is None: 1395 if args is None:
1395 if not self.__noOpenAtStartup: 1396 if self.__openAtStartup:
1396 self.__openOnStartup() 1397 self.__openOnStartup()
1397 return 1398 return
1398 1399
1399 opens = 0 1400 opens = 0
1400 1401
1401 # holds space delimited list of command args, if any 1402 # holds space delimited list of command args, if any
1402 argsStr = None 1403 argsStr = None
1403 # flag indicating '--' options was found 1404 # flag indicating '--' options was found
1404 ddseen = False 1405 ddseen = False
1405 1406
1406 if Utilities.isWindowsPlatform(): 1407 argChars = ['-', '/'] if Utilities.isWindowsPlatform() else ['-']
1407 argChars = ['-', '/']
1408 else:
1409 argChars = ['-']
1410 1408
1411 for arg in args: 1409 for arg in args:
1412 # handle a request to start with last session 1410 # handle a request to start with last session
1413 if arg == '--start-file': 1411 if arg == '--start-file':
1414 self.__openOnStartup("File") 1412 self.__openOnStartup("File")
1456 1454
1457 # store away any args we had 1455 # store away any args we had
1458 if argsStr is not None: 1456 if argsStr is not None:
1459 self.debuggerUI.setArgvHistory(argsStr) 1457 self.debuggerUI.setArgvHistory(argsStr)
1460 1458
1461 if opens == 0: 1459 if opens == 0 and self.__openAtStartup:
1462 # no files, project or multiproject was given 1460 # no files, project or multiproject was given
1463 if not self.__noOpenAtStartup: 1461 self.__openOnStartup()
1464 self.__openOnStartup()
1465 1462
1466 def processInstallInfoFile(self): 1463 def processInstallInfoFile(self):
1467 """ 1464 """
1468 Public method to process the file containing installation information. 1465 Public method to process the file containing installation information.
1469 """ 1466 """
1478 else: 1475 else:
1479 filename = os.path.join(getConfig("ericDir"), 1476 filename = os.path.join(getConfig("ericDir"),
1480 "eric6installpip.json") 1477 "eric6installpip.json")
1481 if os.path.exists(filename): 1478 if os.path.exists(filename):
1482 # eric was installed via pip (i.e. eric-ide) 1479 # eric was installed via pip (i.e. eric-ide)
1483 try: 1480 with contextlib.suppress(OSError):
1484 installDateTime = datetime.datetime.now(tz=None) 1481 installDateTime = datetime.datetime.now(tz=None)
1485 with open(filename, "r") as infoFile: 1482 with open(filename, "r") as infoFile:
1486 installInfo = json.load(infoFile) 1483 installInfo = json.load(infoFile)
1487 installInfo["guessed"] = True 1484 installInfo["guessed"] = True
1488 installInfo["eric"] = getConfig("ericDir") 1485 installInfo["eric"] = getConfig("ericDir")
1498 "%Y-%m-%d %H:%M:%S") 1495 "%Y-%m-%d %H:%M:%S")
1499 installInfo["sudo"] = not os.access( 1496 installInfo["sudo"] = not os.access(
1500 installInfo["eric"], os.W_OK) 1497 installInfo["eric"], os.W_OK)
1501 with open(installInfoFile, "w") as infoFile: 1498 with open(installInfoFile, "w") as infoFile:
1502 json.dump(installInfo, infoFile, indent=2) 1499 json.dump(installInfo, infoFile, indent=2)
1503 except OSError:
1504 # ignore this
1505 pass
1506 else: 1500 else:
1507 changed = False 1501 changed = False
1508 with open(installInfoFile, "r") as infoFile: 1502 with open(installInfoFile, "r") as infoFile:
1509 installInfo = json.load(infoFile) 1503 installInfo = json.load(infoFile)
1510 1504
3745 import sip 3739 import sip
3746 sip_version_str = sip.SIP_VERSION_STR 3740 sip_version_str = sip.SIP_VERSION_STR
3747 except (ImportError, AttributeError): 3741 except (ImportError, AttributeError):
3748 sip_version_str = "sip version not available" 3742 sip_version_str = "sip version not available"
3749 3743
3750 if sys.maxsize > 2**32: 3744 sizeStr = "64-Bit" if sys.maxsize > 2**32 else "32-Bit"
3751 sizeStr = "64-Bit"
3752 else:
3753 sizeStr = "32-Bit"
3754 3745
3755 versionText = self.tr( 3746 versionText = self.tr(
3756 """<h2>Version Numbers</h2>""" 3747 """<h2>Version Numbers</h2>"""
3757 """<table>""") 3748 """<table>""")
3758 versionText += ( 3749 versionText += (
3762 """<tr><td><b>Qt</b></td><td>{0}</td></tr>""" 3753 """<tr><td><b>Qt</b></td><td>{0}</td></tr>"""
3763 ).format(qVersion()) 3754 ).format(qVersion())
3764 versionText += ( 3755 versionText += (
3765 """<tr><td><b>PyQt</b></td><td>{0}</td></tr>""" 3756 """<tr><td><b>PyQt</b></td><td>{0}</td></tr>"""
3766 ).format(PYQT_VERSION_STR) 3757 ).format(PYQT_VERSION_STR)
3767 try: 3758 with contextlib.suppress(ImportError, AttributeError):
3768 from PyQt5 import QtChart 3759 from PyQt5 import QtChart
3769 versionText += ( 3760 versionText += (
3770 """<tr><td><b>PyQtChart</b></td><td>{0}</td></tr>""" 3761 """<tr><td><b>PyQtChart</b></td><td>{0}</td></tr>"""
3771 ).format(QtChart.PYQT_CHART_VERSION_STR) 3762 ).format(QtChart.PYQT_CHART_VERSION_STR)
3772 except (ImportError, AttributeError): 3763 with contextlib.suppress(ImportError, AttributeError):
3773 pass
3774 try:
3775 from PyQt5 import QtWebEngine 3764 from PyQt5 import QtWebEngine
3776 versionText += ( 3765 versionText += (
3777 """<tr><td><b>PyQtWebEngine</b></td><td>{0}</td></tr>""" 3766 """<tr><td><b>PyQtWebEngine</b></td><td>{0}</td></tr>"""
3778 ).format(QtWebEngine.PYQT_WEBENGINE_VERSION_STR) 3767 ).format(QtWebEngine.PYQT_WEBENGINE_VERSION_STR)
3779 except (ImportError, AttributeError):
3780 pass
3781 versionText += ( 3768 versionText += (
3782 """<tr><td><b>QScintilla</b></td><td>{0}</td></tr>""" 3769 """<tr><td><b>QScintilla</b></td><td>{0}</td></tr>"""
3783 ).format(QSCINTILLA_VERSION_STR) 3770 ).format(QSCINTILLA_VERSION_STR)
3784 versionText += ( 3771 versionText += (
3785 """<tr><td><b>sip</b></td><td>{0}</td></tr>""" 3772 """<tr><td><b>sip</b></td><td>{0}</td></tr>"""
3786 ).format(sip_version_str) 3773 ).format(sip_version_str)
3787 try: 3774 with contextlib.suppress(ImportError):
3788 from WebBrowser.Tools import WebBrowserTools 3775 from WebBrowser.Tools import WebBrowserTools
3789 chromeVersion = WebBrowserTools.getWebEngineVersions()[0] 3776 chromeVersion = WebBrowserTools.getWebEngineVersions()[0]
3790 versionText += ( 3777 versionText += (
3791 """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>""" 3778 """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>"""
3792 ).format(chromeVersion) 3779 ).format(chromeVersion)
3793 except ImportError:
3794 pass
3795 versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>""" 3780 versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>"""
3796 ).format(Program, Version) 3781 ).format(Program, Version)
3797 versionText += self.tr("""</table>""") 3782 versionText += self.tr("""</table>""")
3798 3783
3799 E5MessageBox.about(self, Program, versionText) 3784 E5MessageBox.about(self, Program, versionText)
3850 @param attachFile name of a file to put into the body of the 3835 @param attachFile name of a file to put into the body of the
3851 email (string) 3836 email (string)
3852 @param deleteAttachFile flag indicating to delete the file after 3837 @param deleteAttachFile flag indicating to delete the file after
3853 it has been read (boolean) 3838 it has been read (boolean)
3854 """ 3839 """
3855 if mode == "feature": 3840 address = FeatureAddress if mode == "feature" else BugAddress
3856 address = FeatureAddress
3857 else:
3858 address = BugAddress
3859 subject = "[eric] " 3841 subject = "[eric] "
3860 if attachFile is not None: 3842 if attachFile is not None:
3861 with open(attachFile, "r", encoding="utf-8") as f: 3843 with open(attachFile, "r", encoding="utf-8") as f:
3862 body = f.read() 3844 body = f.read()
3863 if deleteAttachFile: 3845 if deleteAttachFile:
3969 @param actions list of actions (list of E5Action) 3951 @param actions list of actions (list of E5Action)
3970 @param actionType string denoting the action set to remove from. 3952 @param actionType string denoting the action set to remove from.
3971 It must be one of "ui" or "wizards". 3953 It must be one of "ui" or "wizards".
3972 """ 3954 """
3973 for act in actions: 3955 for act in actions:
3974 try: 3956 with contextlib.suppress(ValueError):
3975 if actionType == 'ui': 3957 if actionType == 'ui':
3976 self.actions.remove(act) 3958 self.actions.remove(act)
3977 elif actionType == 'wizards': 3959 elif actionType == 'wizards':
3978 self.wizardsActions.remove(act) 3960 self.wizardsActions.remove(act)
3979 except ValueError:
3980 pass
3981 3961
3982 def getActions(self, actionType): 3962 def getActions(self, actionType):
3983 """ 3963 """
3984 Public method to get a list of all actions. 3964 Public method to get a list of all actions.
3985 3965
4110 @return list of toolbars 4090 @return list of toolbars
4111 @rtype list of QToolBar 4091 @rtype list of QToolBar
4112 """ 4092 """
4113 toolbars = [] 4093 toolbars = []
4114 for tbName in self.__toolbars: 4094 for tbName in self.__toolbars:
4115 try: 4095 with contextlib.suppress(IndexError):
4116 if self.__toolbars[tbName][2] == category: 4096 if self.__toolbars[tbName][2] == category:
4117 toolbars.append(self.__toolbars[tbName][1]) 4097 toolbars.append(self.__toolbars[tbName][1])
4118 except IndexError:
4119 # backward compatibility; category is not yet supported
4120 pass
4121 4098
4122 return toolbars 4099 return toolbars
4123 4100
4124 def getLocale(self): 4101 def getLocale(self):
4125 """ 4102 """
4142 Private method to restart the application. 4119 Private method to restart the application.
4143 4120
4144 @param ask flag indicating to ask the user for permission 4121 @param ask flag indicating to ask the user for permission
4145 @type bool 4122 @type bool
4146 """ 4123 """
4147 if ask: 4124 res = (
4148 res = E5MessageBox.yesNo( 4125 E5MessageBox.yesNo(
4149 self, 4126 self,
4150 self.tr("Restart application"), 4127 self.tr("Restart application"),
4151 self.tr( 4128 self.tr(
4152 """The application needs to be restarted. Do it now?"""), 4129 """The application needs to be restarted. Do it now?"""),
4153 yesDefault=True) 4130 yesDefault=True)
4154 else: 4131 if ask else
4155 res = True 4132 True
4133 )
4156 4134
4157 if res and self.__shutdown(): 4135 if res and self.__shutdown():
4158 e5App().closeAllWindows() 4136 e5App().closeAllWindows()
4159 program = sys.executable 4137 program = sys.executable
4160 eric6 = os.path.join(getConfig("ericDir"), "eric6.py") 4138 eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
4236 act.setData(-2) 4214 act.setData(-2)
4237 act.setEnabled(self.currentToolGroup >= 0) 4215 act.setEnabled(self.currentToolGroup >= 0)
4238 self.__menus["user_tools"].addSeparator() 4216 self.__menus["user_tools"].addSeparator()
4239 4217
4240 # add the configurable entries 4218 # add the configurable entries
4241 idx = 0
4242 try: 4219 try:
4243 for tool in self.toolGroups[self.currentToolGroup][1]: 4220 for idx, tool in enumerate(
4221 self.toolGroups[self.currentToolGroup][1]
4222 ):
4244 if tool['menutext'] == '--': 4223 if tool['menutext'] == '--':
4245 self.__menus["user_tools"].addSeparator() 4224 self.__menus["user_tools"].addSeparator()
4246 else: 4225 else:
4247 act = self.__menus["user_tools"].addAction( 4226 act = self.__menus["user_tools"].addAction(
4248 UI.PixmapCache.getIcon(tool['icon']), 4227 UI.PixmapCache.getIcon(tool['icon']),
4249 tool['menutext']) 4228 tool['menutext'])
4250 act.setData(idx) 4229 act.setData(idx)
4251 idx += 1
4252 except IndexError: 4230 except IndexError:
4253 # the current tool group might have been deleted 4231 # the current tool group might have been deleted
4254 act = self.__menus["user_tools"].addAction( 4232 act = self.__menus["user_tools"].addAction(
4255 self.tr("No User Tools Configured")) 4233 self.tr("No User Tools Configured"))
4256 act.setData(-3) 4234 act.setData(-3)
4261 """ 4239 """
4262 self.toolGroupsMenu.clear() 4240 self.toolGroupsMenu.clear()
4263 4241
4264 # add the configurable tool groups 4242 # add the configurable tool groups
4265 if self.toolGroups: 4243 if self.toolGroups:
4266 idx = 0 4244 for idx, toolGroup in enumerate(self.toolGroups):
4267 for toolGroup in self.toolGroups:
4268 act = self.toolGroupsMenu.addAction(toolGroup[0]) 4245 act = self.toolGroupsMenu.addAction(toolGroup[0])
4269 act.setData(idx) 4246 act.setData(idx)
4270 if self.currentToolGroup == idx: 4247 if self.currentToolGroup == idx:
4271 font = act.font() 4248 font = act.font()
4272 font.setBold(True) 4249 font.setBold(True)
4273 act.setFont(font) 4250 act.setFont(font)
4274 idx += 1
4275 else: 4251 else:
4276 act = self.toolGroupsMenu.addAction( 4252 act = self.toolGroupsMenu.addAction(
4277 self.tr("No User Tools Configured")) 4253 self.tr("No User Tools Configured"))
4278 act.setData(-3) 4254 act.setData(-3)
4279 4255
6327 if not ext: 6303 if not ext:
6328 ex = selectedFilter.split("(*")[1].split(")")[0] 6304 ex = selectedFilter.split("(*")[1].split(")")[0]
6329 if ex: 6305 if ex:
6330 fn += ex 6306 fn += ex
6331 6307
6332 if os.path.exists(fn): 6308 ok = (
6333 ok = E5MessageBox.yesNo( 6309 E5MessageBox.yesNo(
6334 self, 6310 self,
6335 self.tr("Export Keyboard Shortcuts"), 6311 self.tr("Export Keyboard Shortcuts"),
6336 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists""" 6312 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists"""
6337 """ already. Overwrite it?</p>""").format(fn)) 6313 """ already. Overwrite it?</p>""").format(fn))
6338 else: 6314 if os.path.exists(fn) else
6339 ok = True 6315 True
6316 )
6340 6317
6341 if ok: 6318 if ok:
6342 from Preferences import Shortcuts 6319 from Preferences import Shortcuts
6343 Shortcuts.exportShortcuts(fn) 6320 Shortcuts.exportShortcuts(fn)
6344 6321
6484 """ 6461 """
6485 Private slot to check some actions for their enable/disable status. 6462 Private slot to check some actions for their enable/disable status.
6486 6463
6487 @param editor editor window 6464 @param editor editor window
6488 """ 6465 """
6489 if editor: 6466 fn = editor.getFileName() if editor else None
6490 fn = editor.getFileName() 6467
6491 else:
6492 fn = None
6493
6494 if fn: 6468 if fn:
6495 dbs = e5App().getObject("DebugServer") 6469 dbs = e5App().getObject("DebugServer")
6496 for language in dbs.getSupportedLanguages(): 6470 for language in dbs.getSupportedLanguages():
6497 exts = dbs.getExtensions(language) 6471 exts = dbs.getExtensions(language)
6498 if fn.endswith(exts): 6472 if fn.endswith(exts):
6685 """ 6659 """
6686 for ext in (".esj", ".e5s"): 6660 for ext in (".esj", ".e5s"):
6687 fn = os.path.join(Utilities.getConfigDir(), 6661 fn = os.path.join(Utilities.getConfigDir(),
6688 f"eric6_crash_session{ext}") 6662 f"eric6_crash_session{ext}")
6689 if os.path.exists(fn): 6663 if os.path.exists(fn):
6690 try: 6664 with contextlib.suppress(OSError):
6691 os.remove(fn) 6665 os.remove(fn)
6692 except OSError:
6693 # ignore it silently
6694 pass
6695 6666
6696 def __writeCrashSession(self): 6667 def __writeCrashSession(self):
6697 """ 6668 """
6698 Private slot to write a crash session file. 6669 Private slot to write a crash session file.
6699 """ 6670 """
6952 return True 6923 return True
6953 6924
6954 if self.__webBrowserProcess is not None: 6925 if self.__webBrowserProcess is not None:
6955 self.__webBrowserShutdown() 6926 self.__webBrowserShutdown()
6956 6927
6957 if self.irc is not None: 6928 if self.irc is not None and not self.irc.shutdown():
6958 if not self.irc.shutdown(): 6929 return False
6959 return False
6960 6930
6961 sessionCreated = self.__writeSession() 6931 sessionCreated = self.__writeSession()
6962 6932
6963 self.__astViewer.hide() 6933 self.__astViewer.hide()
6964 6934
7058 elif period in [2, 3, 4]: 7028 elif period in [2, 3, 4]:
7059 lastCheck = Preferences.Prefs.settings.value( 7029 lastCheck = Preferences.Prefs.settings.value(
7060 "Updates/LastCheckDate", QDate(1970, 1, 1)) 7030 "Updates/LastCheckDate", QDate(1970, 1, 1))
7061 if lastCheck.isValid(): 7031 if lastCheck.isValid():
7062 now = QDate.currentDate() 7032 now = QDate.currentDate()
7063 if period == 2 and lastCheck.day() == now.day(): 7033 if (
7064 # daily 7034 (period == 2 and lastCheck.day() == now.day()) or
7065 return 7035 (period == 3 and lastCheck.daysTo(now) < 7) or
7066 elif period == 3 and lastCheck.daysTo(now) < 7: 7036 (period == 4 and (lastCheck.daysTo(now) <
7067 # weekly 7037 lastCheck.daysInMonth()))
7068 return 7038 ):
7069 elif period == 4 and (lastCheck.daysTo(now) < 7039 # daily, weekly, monthly
7070 lastCheck.daysInMonth()):
7071 # monthly
7072 return 7040 return
7073 7041
7074 self.__inVersionCheck = True 7042 self.__inVersionCheck = True
7075 self.manualUpdatesCheck = manual 7043 self.manualUpdatesCheck = manual
7076 self.showAvailableVersions = showVersions 7044 self.showAvailableVersions = showVersions
7317 7285
7318 @param reply reference to the reply object (QNetworkReply) 7286 @param reply reference to the reply object (QNetworkReply)
7319 @param errors list of SSL errors (list of QSslError) 7287 @param errors list of SSL errors (list of QSslError)
7320 """ 7288 """
7321 ignored = self.__sslErrorHandler.sslErrorsReply(reply, errors)[0] 7289 ignored = self.__sslErrorHandler.sslErrorsReply(reply, errors)[0]
7322 if ignored == E5SslErrorHandler.NotIgnored: 7290 if ignored == E5SslErrorState.NOT_IGNORED:
7323 self.__downloadCancelled = True 7291 self.__downloadCancelled = True
7324 7292
7325 ####################################### 7293 #######################################
7326 ## Below are methods for various checks 7294 ## Below are methods for various checks
7327 ####################################### 7295 #######################################
7461 ########################################## 7429 ##########################################
7462 ## Support for desktop notifications below 7430 ## Support for desktop notifications below
7463 ########################################## 7431 ##########################################
7464 7432
7465 def showNotification(self, icon, heading, text, 7433 def showNotification(self, icon, heading, text,
7466 kind=NotificationTypes.Information, timeout=None): 7434 kind=NotificationTypes.INFORMATION, timeout=None):
7467 """ 7435 """
7468 Public method to show a desktop notification. 7436 Public method to show a desktop notification.
7469 7437
7470 @param icon icon to be shown in the notification 7438 @param icon icon to be shown in the notification
7471 @type QPixmap 7439 @type QPixmap

eric ide

mercurial