UI/UserInterface.py

changeset 3670
f0cb7579c0b4
parent 3659
15efe6df020d
child 3676
2f62b060a931
equal deleted inserted replaced
3669:ac84ac3c0f05 3670:f0cb7579c0b4
52 from E5Network.E5SslErrorHandler import E5SslErrorHandler 52 from E5Network.E5SslErrorHandler import E5SslErrorHandler
53 SSL_AVAILABLE = True 53 SSL_AVAILABLE = True
54 except ImportError: 54 except ImportError:
55 SSL_AVAILABLE = False 55 SSL_AVAILABLE = False
56 56
57 from eric5config import getConfig 57 from eric6config import getConfig
58 58
59 59
60 class Redirector(QObject): 60 class Redirector(QObject):
61 """ 61 """
62 Helper class used to redirect stdout and stderr to the log window. 62 Helper class used to redirect stdout and stderr to the log window.
141 141
142 LeftSide = 1 142 LeftSide = 1
143 BottomSide = 2 143 BottomSide = 2
144 RightSide = 3 144 RightSide = 3
145 145
146 ErrorLogFileName = "eric5_error.log" 146 ErrorLogFileName = "eric6_error.log"
147 147
148 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, 148 def __init__(self, app, locale, splash, plugin, noOpenAtStartup,
149 restartArguments): 149 restartArguments):
150 """ 150 """
151 Constructor 151 Constructor
1220 UI.PixmapCache.getIcon("newWindow.png"), 1220 UI.PixmapCache.getIcon("newWindow.png"),
1221 self.tr('New &Window'), 1221 self.tr('New &Window'),
1222 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 1222 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
1223 0, self, 'new_window') 1223 0, self, 'new_window')
1224 self.newWindowAct.setStatusTip(self.tr( 1224 self.newWindowAct.setStatusTip(self.tr(
1225 'Open a new eric5 instance')) 1225 'Open a new eric6 instance'))
1226 self.newWindowAct.setWhatsThis(self.tr( 1226 self.newWindowAct.setWhatsThis(self.tr(
1227 """<b>New Window</b>""" 1227 """<b>New Window</b>"""
1228 """<p>This opens a new instance of the eric5 IDE.</p>""" 1228 """<p>This opens a new instance of the eric6 IDE.</p>"""
1229 )) 1229 ))
1230 self.newWindowAct.triggered.connect(self.__newWindow) 1230 self.newWindowAct.triggered.connect(self.__newWindow)
1231 self.actions.append(self.newWindowAct) 1231 self.actions.append(self.newWindowAct)
1232 self.newWindowAct.setEnabled( 1232 self.newWindowAct.setEnabled(
1233 not Preferences.getUI("SingleApplicationMode")) 1233 not Preferences.getUI("SingleApplicationMode"))
1585 0, self, 'helpviewer') 1585 0, self, 'helpviewer')
1586 self.helpviewerAct.setStatusTip(self.tr( 1586 self.helpviewerAct.setStatusTip(self.tr(
1587 'Open the helpviewer window')) 1587 'Open the helpviewer window'))
1588 self.helpviewerAct.setWhatsThis(self.tr( 1588 self.helpviewerAct.setWhatsThis(self.tr(
1589 """<b>Helpviewer</b>""" 1589 """<b>Helpviewer</b>"""
1590 """<p>Display the eric5 web browser. This window will show""" 1590 """<p>Display the eric6 web browser. This window will show"""
1591 """ HTML help files and help from Qt help collections. It has""" 1591 """ HTML help files and help from Qt help collections. It has"""
1592 """ the capability to navigate to links, set bookmarks, print""" 1592 """ the capability to navigate to links, set bookmarks, print"""
1593 """ the displayed help and some more features. You may use it to""" 1593 """ the displayed help and some more features. You may use it to"""
1594 """ browse the internet as well</p><p>If called with a word""" 1594 """ browse the internet as well</p><p>If called with a word"""
1595 """ selected, this word is search in the Qt help collection.</p>""" 1595 """ selected, this word is search in the Qt help collection.</p>"""
1619 self.tr('Check for Updates'), 1619 self.tr('Check for Updates'),
1620 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates') 1620 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates')
1621 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates')) 1621 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates'))
1622 self.checkUpdateAct.setWhatsThis(self.tr( 1622 self.checkUpdateAct.setWhatsThis(self.tr(
1623 """<b>Check for Updates...</b>""" 1623 """<b>Check for Updates...</b>"""
1624 """<p>Checks the internet for updates of eric5.</p>""" 1624 """<p>Checks the internet for updates of eric6.</p>"""
1625 )) 1625 ))
1626 self.checkUpdateAct.triggered.connect(self.performVersionCheck) 1626 self.checkUpdateAct.triggered.connect(self.performVersionCheck)
1627 self.actions.append(self.checkUpdateAct) 1627 self.actions.append(self.checkUpdateAct)
1628 1628
1629 self.showVersionsAct = E5Action( 1629 self.showVersionsAct = E5Action(
1632 0, 0, self, 'show_downloadable_versions') 1632 0, 0, self, 'show_downloadable_versions')
1633 self.showVersionsAct.setStatusTip( 1633 self.showVersionsAct.setStatusTip(
1634 self.tr('Show the versions available for download')) 1634 self.tr('Show the versions available for download'))
1635 self.showVersionsAct.setWhatsThis(self.tr( 1635 self.showVersionsAct.setWhatsThis(self.tr(
1636 """<b>Show downloadable versions...</b>""" 1636 """<b>Show downloadable versions...</b>"""
1637 """<p>Shows the eric5 versions available for download """ 1637 """<p>Shows the eric6 versions available for download """
1638 """from the internet.</p>""" 1638 """from the internet.</p>"""
1639 )) 1639 ))
1640 self.showVersionsAct.triggered.connect( 1640 self.showVersionsAct.triggered.connect(
1641 self.showAvailableVersionsInfo) 1641 self.showAvailableVersionsInfo)
1642 self.actions.append(self.showVersionsAct) 1642 self.actions.append(self.showVersionsAct)
1886 )) 1886 ))
1887 self.miniEditorAct.triggered.connect(self.__openMiniEditor) 1887 self.miniEditorAct.triggered.connect(self.__openMiniEditor)
1888 self.actions.append(self.miniEditorAct) 1888 self.actions.append(self.miniEditorAct)
1889 1889
1890 self.webBrowserAct = E5Action( 1890 self.webBrowserAct = E5Action(
1891 self.tr('eric5 Web Browser'), 1891 self.tr('eric6 Web Browser'),
1892 UI.PixmapCache.getIcon("ericWeb.png"), 1892 UI.PixmapCache.getIcon("ericWeb.png"),
1893 self.tr('eric5 &Web Browser...'), 1893 self.tr('eric6 &Web Browser...'),
1894 0, 0, self, 'web_browser') 1894 0, 0, self, 'web_browser')
1895 self.webBrowserAct.setStatusTip(self.tr( 1895 self.webBrowserAct.setStatusTip(self.tr(
1896 'Start the eric5 Web Browser')) 1896 'Start the eric6 Web Browser'))
1897 self.webBrowserAct.setWhatsThis(self.tr( 1897 self.webBrowserAct.setWhatsThis(self.tr(
1898 """<b>eric5 Web Browser</b>""" 1898 """<b>eric6 Web Browser</b>"""
1899 """<p>Browse the Internet with the eric5 Web Browser.</p>""" 1899 """<p>Browse the Internet with the eric6 Web Browser.</p>"""
1900 )) 1900 ))
1901 self.webBrowserAct.triggered.connect(self.__startWebBrowser) 1901 self.webBrowserAct.triggered.connect(self.__startWebBrowser)
1902 self.actions.append(self.webBrowserAct) 1902 self.actions.append(self.webBrowserAct)
1903 1903
1904 self.iconEditorAct = E5Action( 1904 self.iconEditorAct = E5Action(
1905 self.tr('Icon Editor'), 1905 self.tr('Icon Editor'),
1906 UI.PixmapCache.getIcon("iconEditor.png"), 1906 UI.PixmapCache.getIcon("iconEditor.png"),
1907 self.tr('&Icon Editor...'), 1907 self.tr('&Icon Editor...'),
1908 0, 0, self, 'icon_editor') 1908 0, 0, self, 'icon_editor')
1909 self.iconEditorAct.setStatusTip(self.tr( 1909 self.iconEditorAct.setStatusTip(self.tr(
1910 'Start the eric5 Icon Editor')) 1910 'Start the eric6 Icon Editor'))
1911 self.iconEditorAct.setWhatsThis(self.tr( 1911 self.iconEditorAct.setWhatsThis(self.tr(
1912 """<b>Icon Editor</b>""" 1912 """<b>Icon Editor</b>"""
1913 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" 1913 """<p>Starts the eric6 Icon Editor for editing simple icons.</p>"""
1914 )) 1914 ))
1915 self.iconEditorAct.triggered.connect(self.__editPixmap) 1915 self.iconEditorAct.triggered.connect(self.__editPixmap)
1916 self.actions.append(self.iconEditorAct) 1916 self.actions.append(self.iconEditorAct)
1917 1917
1918 self.snapshotAct = E5Action( 1918 self.snapshotAct = E5Action(
1995 self.showExternalToolsAct.setStatusTip(self.tr( 1995 self.showExternalToolsAct.setStatusTip(self.tr(
1996 'Show external tools')) 1996 'Show external tools'))
1997 self.showExternalToolsAct.setWhatsThis(self.tr( 1997 self.showExternalToolsAct.setWhatsThis(self.tr(
1998 """<b>Show external tools</b>""" 1998 """<b>Show external tools</b>"""
1999 """<p>Opens a dialog to show the path and versions of all""" 1999 """<p>Opens a dialog to show the path and versions of all"""
2000 """ extenal tools used by eric5.</p>""" 2000 """ extenal tools used by eric6.</p>"""
2001 )) 2001 ))
2002 self.showExternalToolsAct.triggered.connect( 2002 self.showExternalToolsAct.triggered.connect(
2003 self.__showExternalTools) 2003 self.__showExternalTools)
2004 self.actions.append(self.showExternalToolsAct) 2004 self.actions.append(self.showExternalToolsAct)
2005 2005
2329 self.python2DocAct.triggered.connect(self.__showPython2Doc) 2329 self.python2DocAct.triggered.connect(self.__showPython2Doc)
2330 self.actions.append(self.python2DocAct) 2330 self.actions.append(self.python2DocAct)
2331 2331
2332 def __initEricDocAction(self): 2332 def __initEricDocAction(self):
2333 """ 2333 """
2334 Private slot to initialize the action to show the eric5 documentation. 2334 Private slot to initialize the action to show the eric6 documentation.
2335 """ 2335 """
2336 self.ericDocAct = E5Action( 2336 self.ericDocAct = E5Action(
2337 self.tr("Eric API Documentation"), 2337 self.tr("Eric API Documentation"),
2338 self.tr('&Eric API Documentation'), 2338 self.tr('&Eric API Documentation'),
2339 0, 0, self, 'eric_documentation') 2339 0, 0, self, 'eric_documentation')
2341 "Open Eric API Documentation")) 2341 "Open Eric API Documentation"))
2342 self.ericDocAct.setWhatsThis(self.tr( 2342 self.ericDocAct.setWhatsThis(self.tr(
2343 """<b>Eric API Documentation</b>""" 2343 """<b>Eric API Documentation</b>"""
2344 """<p>Display the Eric API documentation. The location for the""" 2344 """<p>Display the Eric API documentation. The location for the"""
2345 """ documentation is the Documentation/Source subdirectory of""" 2345 """ documentation is the Documentation/Source subdirectory of"""
2346 """ the eric5 installation directory.</p>""" 2346 """ the eric6 installation directory.</p>"""
2347 )) 2347 ))
2348 self.ericDocAct.triggered.connect(self.__showEricDoc) 2348 self.ericDocAct.triggered.connect(self.__showEricDoc)
2349 self.actions.append(self.ericDocAct) 2349 self.actions.append(self.ericDocAct)
2350 2350
2351 def __initPySideDocAction(self): 2351 def __initPySideDocAction(self):
3017 """ 3017 """
3018 if mode == "feature": 3018 if mode == "feature":
3019 address = FeatureAddress 3019 address = FeatureAddress
3020 else: 3020 else:
3021 address = BugAddress 3021 address = BugAddress
3022 subject = "[eric5] " 3022 subject = "[eric6] "
3023 if attachFile is not None: 3023 if attachFile is not None:
3024 f = open(attachFile, "r", encoding="utf-8") 3024 f = open(attachFile, "r", encoding="utf-8")
3025 body = f.read() 3025 body = f.read()
3026 f.close() 3026 f.close()
3027 if deleteAttachFile: 3027 if deleteAttachFile:
3269 yesDefault=True) 3269 yesDefault=True)
3270 3270
3271 if res and self.__shutdown(): 3271 if res and self.__shutdown():
3272 e5App().closeAllWindows() 3272 e5App().closeAllWindows()
3273 program = sys.executable 3273 program = sys.executable
3274 eric5 = os.path.join(getConfig("ericDir"), "eric5.py") 3274 eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
3275 args = [eric5] 3275 args = [eric6]
3276 args.append("--start-session") 3276 args.append("--start-session")
3277 args.extend(self.__restartArgs) 3277 args.extend(self.__restartArgs)
3278 QProcess.startDetached(program, args) 3278 QProcess.startDetached(program, args)
3279 3279
3280 def __newWindow(self): 3280 def __newWindow(self):
3281 """ 3281 """
3282 Private slot to start a new instance of eric5. 3282 Private slot to start a new instance of eric6.
3283 """ 3283 """
3284 if not Preferences.getUI("SingleApplicationMode"): 3284 if not Preferences.getUI("SingleApplicationMode"):
3285 # start eric5 without any arguments 3285 # start eric6 without any arguments
3286 program = sys.executable 3286 program = sys.executable
3287 eric5 = os.path.join(getConfig("ericDir"), "eric5.py") 3287 eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
3288 args = [eric5] 3288 args = [eric6]
3289 QProcess.startDetached(program, args) 3289 QProcess.startDetached(program, args)
3290 3290
3291 def __showToolsMenu(self): 3291 def __showToolsMenu(self):
3292 """ 3292 """
3293 Private slot to display the Tools menu. 3293 Private slot to display the Tools menu.
4097 4097
4098 if version == 3: 4098 if version == 3:
4099 E5MessageBox.information( 4099 E5MessageBox.information(
4100 self, 4100 self,
4101 self.tr("Qt 3 support"), 4101 self.tr("Qt 3 support"),
4102 self.tr("""Qt v.3 is not supported by eric5.""")) 4102 self.tr("""Qt v.3 is not supported by eric6."""))
4103 return 4103 return
4104 4104
4105 args = [] 4105 args = []
4106 if fn is not None: 4106 if fn is not None:
4107 try: 4107 try:
4162 """ 4162 """
4163 if version < 4: 4163 if version < 4:
4164 E5MessageBox.information( 4164 E5MessageBox.information(
4165 self, 4165 self,
4166 self.tr("Qt 3 support"), 4166 self.tr("Qt 3 support"),
4167 self.tr("""Qt v.3 is not supported by eric5.""")) 4167 self.tr("""Qt v.3 is not supported by eric6."""))
4168 return 4168 return
4169 4169
4170 args = [] 4170 args = []
4171 if fn is not None: 4171 if fn is not None:
4172 fn = fn.replace('.qm', '.ts') 4172 fn = fn.replace('.qm', '.ts')
4233 """ 4233 """
4234 if version < 4: 4234 if version < 4:
4235 E5MessageBox.information( 4235 E5MessageBox.information(
4236 self, 4236 self,
4237 self.tr("Qt 3 support"), 4237 self.tr("Qt 3 support"),
4238 self.tr("""Qt v.3 is not supported by eric5.""")) 4238 self.tr("""Qt v.3 is not supported by eric6."""))
4239 return 4239 return
4240 4240
4241 args = [] 4241 args = []
4242 if home: 4242 if home:
4243 if version == 4: 4243 if version == 4:
4271 """ 4271 """
4272 self.__assistant(version=4) 4272 self.__assistant(version=4)
4273 4273
4274 def __startWebBrowser(self): 4274 def __startWebBrowser(self):
4275 """ 4275 """
4276 Private slot to start the eric5 web browser. 4276 Private slot to start the eric6 web browser.
4277 """ 4277 """
4278 self.launchHelpViewer("") 4278 self.launchHelpViewer("")
4279 4279
4280 def __customViewer(self, home=None): 4280 def __customViewer(self, home=None):
4281 """ 4281 """
4335 4335
4336 @param fn filename of the form to be previewed (string) 4336 @param fn filename of the form to be previewed (string)
4337 """ 4337 """
4338 proc = QProcess() 4338 proc = QProcess()
4339 4339
4340 viewer = os.path.join(getConfig("ericDir"), "eric5_uipreviewer.py") 4340 viewer = os.path.join(getConfig("ericDir"), "eric6_uipreviewer.py")
4341 4341
4342 args = [] 4342 args = []
4343 args.append(viewer) 4343 args.append(viewer)
4344 4344
4345 if fn is not None: 4345 if fn is not None:
4387 @param ignore flag indicating non existing files should be ignored 4387 @param ignore flag indicating non existing files should be ignored
4388 (boolean) 4388 (boolean)
4389 """ 4389 """
4390 proc = QProcess() 4390 proc = QProcess()
4391 4391
4392 viewer = os.path.join(getConfig("ericDir"), "eric5_trpreviewer.py") 4392 viewer = os.path.join(getConfig("ericDir"), "eric6_trpreviewer.py")
4393 4393
4394 args = [] 4394 args = []
4395 args.append(viewer) 4395 args.append(viewer)
4396 4396
4397 if fileNames is not None: 4397 if fileNames is not None:
4434 """ 4434 """
4435 Private slot to start the SQL browser tool. 4435 Private slot to start the SQL browser tool.
4436 """ 4436 """
4437 proc = QProcess() 4437 proc = QProcess()
4438 4438
4439 browser = os.path.join(getConfig("ericDir"), "eric5_sqlbrowser.py") 4439 browser = os.path.join(getConfig("ericDir"), "eric6_sqlbrowser.py")
4440 4440
4441 args = [] 4441 args = []
4442 args.append(browser) 4442 args.append(browser)
4443 4443
4444 if not os.path.isfile(browser) or \ 4444 if not os.path.isfile(browser) or \
4492 """ 4492 """
4493 Private slot to start the snapshot tool. 4493 Private slot to start the snapshot tool.
4494 """ 4494 """
4495 proc = QProcess() 4495 proc = QProcess()
4496 4496
4497 snap = os.path.join(getConfig("ericDir"), "eric5_snap.py") 4497 snap = os.path.join(getConfig("ericDir"), "eric6_snap.py")
4498 4498
4499 args = [] 4499 args = []
4500 args.append(snap) 4500 args.append(snap)
4501 4501
4502 if not os.path.isfile(snap) or \ 4502 if not os.path.isfile(snap) or \
5111 5111
5112 self.launchHelpViewer("", searchWord=searchWord) 5112 self.launchHelpViewer("", searchWord=searchWord)
5113 5113
5114 def __webBrowser(self, home=""): 5114 def __webBrowser(self, home=""):
5115 """ 5115 """
5116 Private slot to start the eric5 web browser. 5116 Private slot to start the eric6 web browser.
5117 5117
5118 @param home full pathname of a file to display (string) 5118 @param home full pathname of a file to display (string)
5119 """ 5119 """
5120 started = QDesktopServices.openUrl(QUrl(home)) 5120 started = QDesktopServices.openUrl(QUrl(home))
5121 if not started: 5121 if not started:
5245 self.reloadAPIs.emit() 5245 self.reloadAPIs.emit()
5246 5246
5247 def __showExternalTools(self): 5247 def __showExternalTools(self):
5248 """ 5248 """
5249 Private slot to display a dialog show a list of external tools used 5249 Private slot to display a dialog show a list of external tools used
5250 by eric5. 5250 by eric6.
5251 """ 5251 """
5252 if self.programsDialog is None: 5252 if self.programsDialog is None:
5253 from Preferences.ProgramsDialog import ProgramsDialog 5253 from Preferences.ProgramsDialog import ProgramsDialog
5254 self.programsDialog = ProgramsDialog(self) 5254 self.programsDialog = ProgramsDialog(self)
5255 self.programsDialog.show() 5255 self.programsDialog.show()
5447 5447
5448 def __writeTasks(self): 5448 def __writeTasks(self):
5449 """ 5449 """
5450 Private slot to write the tasks data to an XML file (.e4t). 5450 Private slot to write the tasks data to an XML file (.e4t).
5451 """ 5451 """
5452 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") 5452 fn = os.path.join(Utilities.getConfigDir(), "eric6tasks.e4t")
5453 f = QFile(fn) 5453 f = QFile(fn)
5454 ok = f.open(QIODevice.WriteOnly) 5454 ok = f.open(QIODevice.WriteOnly)
5455 if not ok: 5455 if not ok:
5456 E5MessageBox.critical( 5456 E5MessageBox.critical(
5457 self, 5457 self,
5467 5467
5468 def __readTasks(self): 5468 def __readTasks(self):
5469 """ 5469 """
5470 Private slot to read in the tasks file (.e4t). 5470 Private slot to read in the tasks file (.e4t).
5471 """ 5471 """
5472 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") 5472 fn = os.path.join(Utilities.getConfigDir(), "eric6tasks.e4t")
5473 if not os.path.exists(fn): 5473 if not os.path.exists(fn):
5474 return 5474 return
5475 f = QFile(fn) 5475 f = QFile(fn)
5476 if f.open(QIODevice.ReadOnly): 5476 if f.open(QIODevice.ReadOnly):
5477 from E5XML.TasksReader import TasksReader 5477 from E5XML.TasksReader import TasksReader
5488 5488
5489 def __writeSession(self): 5489 def __writeSession(self):
5490 """ 5490 """
5491 Private slot to write the session data to an XML file (.e5s). 5491 Private slot to write the session data to an XML file (.e5s).
5492 """ 5492 """
5493 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e5s") 5493 fn = os.path.join(Utilities.getConfigDir(), "eric6session.e5s")
5494 f = QFile(fn) 5494 f = QFile(fn)
5495 if f.open(QIODevice.WriteOnly): 5495 if f.open(QIODevice.WriteOnly):
5496 from E5XML.SessionWriter import SessionWriter 5496 from E5XML.SessionWriter import SessionWriter
5497 SessionWriter(f, None).writeXML() 5497 SessionWriter(f, None).writeXML()
5498 f.close() 5498 f.close()
5506 5506
5507 def __readSession(self): 5507 def __readSession(self):
5508 """ 5508 """
5509 Private slot to read in the session file (.e5s or .e4s). 5509 Private slot to read in the session file (.e5s or .e4s).
5510 """ 5510 """
5511 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e5s") 5511 fn = os.path.join(Utilities.getConfigDir(), "eric6session.e5s")
5512 if not os.path.exists(fn): 5512 if not os.path.exists(fn):
5513 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") 5513 fn = os.path.join(Utilities.getConfigDir(), "eric6session.e4s")
5514 if not os.path.exists(fn): 5514 if not os.path.exists(fn):
5515 E5MessageBox.critical( 5515 E5MessageBox.critical(
5516 self, 5516 self,
5517 self.tr("Read session"), 5517 self.tr("Read session"),
5518 self.tr( 5518 self.tr(
5816 ## Below are methods to check for new versions 5816 ## Below are methods to check for new versions
5817 ############################################## 5817 ##############################################
5818 5818
5819 def showAvailableVersionsInfo(self): 5819 def showAvailableVersionsInfo(self):
5820 """ 5820 """
5821 Public method to show the eric5 versions available for download. 5821 Public method to show the eric6 versions available for download.
5822 """ 5822 """
5823 self.performVersionCheck(manual=True, showVersions=True) 5823 self.performVersionCheck(manual=True, showVersions=True)
5824 5824
5825 @pyqtSlot() 5825 @pyqtSlot()
5826 def performVersionCheck(self, manual=True, alternative=0, 5826 def performVersionCheck(self, manual=True, alternative=0,
5827 showVersions=False): 5827 showVersions=False):
5828 """ 5828 """
5829 Public method to check the internet for an eric5 update. 5829 Public method to check the internet for an eric6 update.
5830 5830
5831 @param manual flag indicating an invocation via the menu (boolean) 5831 @param manual flag indicating an invocation via the menu (boolean)
5832 @param alternative index of server to download from (integer) 5832 @param alternative index of server to download from (integer)
5833 @keyparam showVersions flag indicating the show versions mode (boolean) 5833 @keyparam showVersions flag indicating the show versions mode (boolean)
5834 """ 5834 """
5980 if versions[2][0] == "5" and versions[2] > Version: 5980 if versions[2][0] == "5" and versions[2] > Version:
5981 res = E5MessageBox.yesNo( 5981 res = E5MessageBox.yesNo(
5982 self, 5982 self,
5983 self.tr("Update available"), 5983 self.tr("Update available"),
5984 self.tr( 5984 self.tr(
5985 """The update to <b>{0}</b> of eric5 is""" 5985 """The update to <b>{0}</b> of eric6 is"""
5986 """ available at <b>{1}</b>. Would you like to""" 5986 """ available at <b>{1}</b>. Would you like to"""
5987 """ get it?""") 5987 """ get it?""")
5988 .format(versions[2], versions[3]), 5988 .format(versions[2], versions[3]),
5989 yesDefault=True) 5989 yesDefault=True)
5990 url = res and versions[3] or '' 5990 url = res and versions[3] or ''
5991 elif versions[0] > Version: 5991 elif versions[0] > Version:
5992 res = E5MessageBox.yesNo( 5992 res = E5MessageBox.yesNo(
5993 self, 5993 self,
5994 self.tr("Update available"), 5994 self.tr("Update available"),
5995 self.tr( 5995 self.tr(
5996 """The update to <b>{0}</b> of eric5 is""" 5996 """The update to <b>{0}</b> of eric6 is"""
5997 """ available at <b>{1}</b>. Would you like to""" 5997 """ available at <b>{1}</b>. Would you like to"""
5998 """ get it?""") 5998 """ get it?""")
5999 .format(versions[0], versions[1]), 5999 .format(versions[0], versions[1]),
6000 yesDefault=True) 6000 yesDefault=True)
6001 url = res and versions[1] or '' 6001 url = res and versions[1] or ''
6002 else: 6002 else:
6003 if self.manualUpdatesCheck: 6003 if self.manualUpdatesCheck:
6004 E5MessageBox.information( 6004 E5MessageBox.information(
6005 self, 6005 self,
6006 self.tr("Eric5 is up to date"), 6006 self.tr("Eric6 is up to date"),
6007 self.tr( 6007 self.tr(
6008 """You are using the latest version of""" 6008 """You are using the latest version of"""
6009 """ eric5""")) 6009 """ eric6"""))
6010 else: 6010 else:
6011 # check release version 6011 # check release version
6012 if versions[0] > Version: 6012 if versions[0] > Version:
6013 res = E5MessageBox.yesNo( 6013 res = E5MessageBox.yesNo(
6014 self, 6014 self,
6015 self.tr("Update available"), 6015 self.tr("Update available"),
6016 self.tr( 6016 self.tr(
6017 """The update to <b>{0}</b> of eric5 is""" 6017 """The update to <b>{0}</b> of eric6 is"""
6018 """ available at <b>{1}</b>. Would you like""" 6018 """ available at <b>{1}</b>. Would you like"""
6019 """ to get it?""") 6019 """ to get it?""")
6020 .format(versions[0], versions[1]), 6020 .format(versions[0], versions[1]),
6021 yesDefault=True) 6021 yesDefault=True)
6022 url = res and versions[1] or '' 6022 url = res and versions[1] or ''
6023 else: 6023 else:
6024 if self.manualUpdatesCheck: 6024 if self.manualUpdatesCheck:
6025 E5MessageBox.information( 6025 E5MessageBox.information(
6026 self, 6026 self,
6027 self.tr("Eric5 is up to date"), 6027 self.tr("Eric6 is up to date"),
6028 self.tr( 6028 self.tr(
6029 """You are using the latest version of""" 6029 """You are using the latest version of"""
6030 """ eric5""")) 6030 """ eric6"""))
6031 except IndexError: 6031 except IndexError:
6032 E5MessageBox.warning( 6032 E5MessageBox.warning(
6033 self, 6033 self,
6034 self.tr("Error during updates check"), 6034 self.tr("Error during updates check"),
6035 self.tr("""Could not perform updates check.""")) 6035 self.tr("""Could not perform updates check."""))
6085 ## Below are methods for various checks 6085 ## Below are methods for various checks
6086 ####################################### 6086 #######################################
6087 6087
6088 def checkConfigurationStatus(self): 6088 def checkConfigurationStatus(self):
6089 """ 6089 """
6090 Public method to check, if eric5 has been configured. If it is not, 6090 Public method to check, if eric6 has been configured. If it is not,
6091 the configuration dialog is shown. 6091 the configuration dialog is shown.
6092 """ 6092 """
6093 if not Preferences.isConfigured(): 6093 if not Preferences.isConfigured():
6094 self.__initDebugToolbarsLayout() 6094 self.__initDebugToolbarsLayout()
6095 6095
6096 E5MessageBox.information( 6096 E5MessageBox.information(
6097 self, 6097 self,
6098 self.tr("First time usage"), 6098 self.tr("First time usage"),
6099 self.tr("""eric5 has not been configured yet. """ 6099 self.tr("""eric6 has not been configured yet. """
6100 """The configuration dialog will be started.""")) 6100 """The configuration dialog will be started."""))
6101 self.showPreferences() 6101 self.showPreferences()
6102 6102
6103 def checkProjectsWorkspace(self): 6103 def checkProjectsWorkspace(self):
6104 """ 6104 """
6119 E5FileDialog.Options(E5FileDialog.Option(0))) 6119 E5FileDialog.Options(E5FileDialog.Option(0)))
6120 Preferences.setMultiProject("Workspace", workspace) 6120 Preferences.setMultiProject("Workspace", workspace)
6121 6121
6122 def versionIsNewer(self, required, snapshot=None): 6122 def versionIsNewer(self, required, snapshot=None):
6123 """ 6123 """
6124 Public method to check, if the eric5 version is good compared to 6124 Public method to check, if the eric6 version is good compared to
6125 the required version. 6125 the required version.
6126 6126
6127 @param required required version (string) 6127 @param required required version (string)
6128 @param snapshot required snapshot version (string) 6128 @param snapshot required snapshot version (string)
6129 @return flag indicating, that the version is newer than the required 6129 @return flag indicating, that the version is newer than the required

eric ide

mercurial