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): |
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. |
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 |