135 @signal reloadAPIs() emitted to reload the api information |
135 @signal reloadAPIs() emitted to reload the api information |
136 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The |
136 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The |
137 name of the menu and a reference to the menu are given. |
137 name of the menu and a reference to the menu are given. |
138 @signal masterPasswordChanged(str, str) emitted after the master |
138 @signal masterPasswordChanged(str, str) emitted after the master |
139 password has been changed with the old and the new password |
139 password has been changed with the old and the new password |
140 @signal onlineStateChanged(online) emitted to indicate a change of the |
|
141 network state |
|
142 """ |
140 """ |
143 appendStderr = pyqtSignal(str) |
141 appendStderr = pyqtSignal(str) |
144 appendStdout = pyqtSignal(str) |
142 appendStdout = pyqtSignal(str) |
145 preferencesChanged = pyqtSignal() |
143 preferencesChanged = pyqtSignal() |
146 reloadAPIs = pyqtSignal() |
144 reloadAPIs = pyqtSignal() |
147 showMenu = pyqtSignal(str, QMenu) |
145 showMenu = pyqtSignal(str, QMenu) |
148 masterPasswordChanged = pyqtSignal(str, str) |
146 masterPasswordChanged = pyqtSignal(str, str) |
149 onlineStateChanged = pyqtSignal(bool) |
|
150 |
147 |
151 maxFilePathLen = 100 |
148 maxFilePathLen = 100 |
152 maxMenuFilePathLen = 75 |
149 maxMenuFilePathLen = 75 |
153 |
150 |
154 LeftSide = 1 |
151 LeftSide = 1 |
430 self.__writeCrashSession) |
427 self.__writeCrashSession) |
431 |
428 |
432 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) |
429 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) |
433 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) |
430 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) |
434 self.debuggerUI.resetUI.connect(self.__debuggingDone) |
431 self.debuggerUI.resetUI.connect(self.__debuggingDone) |
435 self.debuggerUI.debuggingStarted.connect( |
|
436 self.debugViewer.exceptionLogger.debuggingStarted) |
|
437 self.debuggerUI.debuggingStarted.connect( |
|
438 self.debugViewer.handleDebuggingStarted) |
|
439 self.debuggerUI.debuggingStarted.connect(self.__programChange) |
432 self.debuggerUI.debuggingStarted.connect(self.__programChange) |
440 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) |
433 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) |
441 self.debuggerUI.compileForms.connect( |
434 self.debuggerUI.compileForms.connect( |
442 self.projectBrowser.pfBrowser.compileChangedForms) |
435 self.projectBrowser.pfBrowser.compileChangedForms) |
443 self.debuggerUI.compileResources.connect( |
436 self.debuggerUI.compileResources.connect( |
444 self.projectBrowser.prBrowser.compileChangedResources) |
437 self.projectBrowser.prBrowser.compileChangedResources) |
445 self.debuggerUI.executeMake.connect(self.project.executeMake) |
438 self.debuggerUI.executeMake.connect(self.project.executeMake) |
446 self.debuggerUI.appendStdout.connect(self.appendToStdout) |
439 self.debuggerUI.appendStdout.connect(self.appendToStdout) |
447 |
440 |
448 debugServer.passiveDebugStarted.connect( |
|
449 self.debugViewer.exceptionLogger.debuggingStarted) |
|
450 debugServer.passiveDebugStarted.connect( |
|
451 self.debugViewer.handleDebuggingStarted) |
|
452 debugServer.clientException.connect( |
|
453 self.debugViewer.exceptionLogger.addException) |
|
454 debugServer.clientLine.connect( |
|
455 self.debugViewer.breakpointViewer.highlightBreakpoint) |
|
456 debugServer.clientDisassembly.connect( |
441 debugServer.clientDisassembly.connect( |
457 self.debugViewer.disassemblyViewer.showDisassembly) |
442 self.debugViewer.disassemblyViewer.showDisassembly) |
458 debugServer.clientProcessStdout.connect(self.appendToStdout) |
443 debugServer.clientProcessStdout.connect(self.appendToStdout) |
459 debugServer.clientProcessStderr.connect(self.appendToStderr) |
444 debugServer.clientProcessStderr.connect(self.appendToStderr) |
460 debugServer.appendStdout.connect(self.appendToStdout) |
445 debugServer.appendStdout.connect(self.appendToStdout) |
1698 UI.PixmapCache.getIcon("newWindow"), |
1683 UI.PixmapCache.getIcon("newWindow"), |
1699 self.tr('New &Window'), |
1684 self.tr('New &Window'), |
1700 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), |
1685 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), |
1701 0, self, 'new_window') |
1686 0, self, 'new_window') |
1702 self.newWindowAct.setStatusTip(self.tr( |
1687 self.newWindowAct.setStatusTip(self.tr( |
1703 'Open a new eric6 instance')) |
1688 'Open a new eric instance')) |
1704 self.newWindowAct.setWhatsThis(self.tr( |
1689 self.newWindowAct.setWhatsThis(self.tr( |
1705 """<b>New Window</b>""" |
1690 """<b>New Window</b>""" |
1706 """<p>This opens a new instance of the eric6 IDE.</p>""" |
1691 """<p>This opens a new instance of the eric IDE.</p>""" |
1707 )) |
1692 )) |
1708 self.newWindowAct.triggered.connect(self.__newWindow) |
1693 self.newWindowAct.triggered.connect(self.__newWindow) |
1709 self.actions.append(self.newWindowAct) |
1694 self.actions.append(self.newWindowAct) |
1710 self.newWindowAct.setEnabled( |
1695 self.newWindowAct.setEnabled( |
1711 not Preferences.getUI("SingleApplicationMode")) |
1696 not Preferences.getUI("SingleApplicationMode")) |
2144 0, self, 'helpviewer') |
2129 0, self, 'helpviewer') |
2145 self.helpviewerAct.setStatusTip(self.tr( |
2130 self.helpviewerAct.setStatusTip(self.tr( |
2146 'Open the helpviewer window')) |
2131 'Open the helpviewer window')) |
2147 self.helpviewerAct.setWhatsThis(self.tr( |
2132 self.helpviewerAct.setWhatsThis(self.tr( |
2148 """<b>Helpviewer</b>""" |
2133 """<b>Helpviewer</b>""" |
2149 """<p>Display the eric6 web browser. This window will show""" |
2134 """<p>Display the eric web browser. This window will show""" |
2150 """ HTML help files and help from Qt help collections. It""" |
2135 """ HTML help files and help from Qt help collections. It""" |
2151 """ has the capability to navigate to links, set bookmarks,""" |
2136 """ has the capability to navigate to links, set bookmarks,""" |
2152 """ print the displayed help and some more features. You may""" |
2137 """ print the displayed help and some more features. You may""" |
2153 """ use it to browse the internet as well</p><p>If called""" |
2138 """ use it to browse the internet as well</p><p>If called""" |
2154 """ with a word selected, this word is search in the Qt help""" |
2139 """ with a word selected, this word is search in the Qt help""" |
2465 self.tr('Hex Editor'), |
2450 self.tr('Hex Editor'), |
2466 UI.PixmapCache.getIcon("hexEditor"), |
2451 UI.PixmapCache.getIcon("hexEditor"), |
2467 self.tr('&Hex Editor...'), |
2452 self.tr('&Hex Editor...'), |
2468 0, 0, self, 'hex_editor') |
2453 0, 0, self, 'hex_editor') |
2469 self.hexEditorAct.setStatusTip(self.tr( |
2454 self.hexEditorAct.setStatusTip(self.tr( |
2470 'Start the eric6 Hex Editor')) |
2455 'Start the eric Hex Editor')) |
2471 self.hexEditorAct.setWhatsThis(self.tr( |
2456 self.hexEditorAct.setWhatsThis(self.tr( |
2472 """<b>Hex Editor</b>""" |
2457 """<b>Hex Editor</b>""" |
2473 """<p>Starts the eric6 Hex Editor for viewing or editing""" |
2458 """<p>Starts the eric Hex Editor for viewing or editing""" |
2474 """ binary files.</p>""" |
2459 """ binary files.</p>""" |
2475 )) |
2460 )) |
2476 self.hexEditorAct.triggered.connect(self.__openHexEditor) |
2461 self.hexEditorAct.triggered.connect(self.__openHexEditor) |
2477 self.actions.append(self.hexEditorAct) |
2462 self.actions.append(self.hexEditorAct) |
2478 |
2463 |
2479 self.webBrowserAct = E5Action( |
2464 self.webBrowserAct = E5Action( |
2480 self.tr('eric6 Web Browser'), |
2465 self.tr('eric Web Browser'), |
2481 UI.PixmapCache.getIcon("ericWeb"), |
2466 UI.PixmapCache.getIcon("ericWeb"), |
2482 self.tr('eric6 &Web Browser...'), |
2467 self.tr('eric &Web Browser...'), |
2483 0, 0, self, 'web_browser') |
2468 0, 0, self, 'web_browser') |
2484 self.webBrowserAct.setStatusTip(self.tr( |
2469 self.webBrowserAct.setStatusTip(self.tr( |
2485 'Start the eric6 Web Browser')) |
2470 'Start the eric Web Browser')) |
2486 self.webBrowserAct.setWhatsThis(self.tr( |
2471 self.webBrowserAct.setWhatsThis(self.tr( |
2487 """<b>eric6 Web Browser</b>""" |
2472 """<b>eric Web Browser</b>""" |
2488 """<p>Browse the Internet with the eric6 Web Browser.</p>""" |
2473 """<p>Browse the Internet with the eric Web Browser.</p>""" |
2489 )) |
2474 )) |
2490 self.webBrowserAct.triggered.connect(self.__startWebBrowser) |
2475 self.webBrowserAct.triggered.connect(self.__startWebBrowser) |
2491 self.actions.append(self.webBrowserAct) |
2476 self.actions.append(self.webBrowserAct) |
2492 ## else: |
|
2493 ## self.webBrowserAct = None |
|
2494 |
2477 |
2495 self.iconEditorAct = E5Action( |
2478 self.iconEditorAct = E5Action( |
2496 self.tr('Icon Editor'), |
2479 self.tr('Icon Editor'), |
2497 UI.PixmapCache.getIcon("iconEditor"), |
2480 UI.PixmapCache.getIcon("iconEditor"), |
2498 self.tr('&Icon Editor...'), |
2481 self.tr('&Icon Editor...'), |
2499 0, 0, self, 'icon_editor') |
2482 0, 0, self, 'icon_editor') |
2500 self.iconEditorAct.setStatusTip(self.tr( |
2483 self.iconEditorAct.setStatusTip(self.tr( |
2501 'Start the eric6 Icon Editor')) |
2484 'Start the eric Icon Editor')) |
2502 self.iconEditorAct.setWhatsThis(self.tr( |
2485 self.iconEditorAct.setWhatsThis(self.tr( |
2503 """<b>Icon Editor</b>""" |
2486 """<b>Icon Editor</b>""" |
2504 """<p>Starts the eric6 Icon Editor for editing simple icons.</p>""" |
2487 """<p>Starts the eric Icon Editor for editing simple icons.</p>""" |
2505 )) |
2488 )) |
2506 self.iconEditorAct.triggered.connect(self.__editPixmap) |
2489 self.iconEditorAct.triggered.connect(self.__editPixmap) |
2507 self.actions.append(self.iconEditorAct) |
2490 self.actions.append(self.iconEditorAct) |
2508 |
2491 |
2509 self.snapshotAct = E5Action( |
2492 self.snapshotAct = E5Action( |
2862 """ |
2845 """ |
2863 Private slot to initialize the action to show the Qt documentation. |
2846 Private slot to initialize the action to show the Qt documentation. |
2864 """ |
2847 """ |
2865 self.qt5DocAct = E5Action( |
2848 self.qt5DocAct = E5Action( |
2866 self.tr('Qt5 Documentation'), |
2849 self.tr('Qt5 Documentation'), |
2867 self.tr('Qt&5 Documentation'), |
2850 self.tr('Qt5 Documentation'), |
2868 0, 0, self, 'qt5_documentation') |
2851 0, 0, self, 'qt5_documentation') |
2869 self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation')) |
2852 self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation')) |
2870 self.qt5DocAct.setWhatsThis(self.tr( |
2853 self.qt5DocAct.setWhatsThis(self.tr( |
2871 """<b>Qt5 Documentation</b>""" |
2854 """<b>Qt5 Documentation</b>""" |
2872 """<p>Display the Qt5 Documentation. Dependent upon your""" |
2855 """<p>Display the Qt5 Documentation. Dependent upon your""" |
2873 """ settings, this will either show the help in Eric's internal""" |
2856 """ settings, this will either show the help in Eric's internal""" |
2874 """ help viewer/web browser, or execute a web browser or Qt""" |
2857 """ help viewer/web browser, or execute a web browser or Qt""" |
2875 """ Assistant. </p>""" |
2858 """ Assistant. </p>""" |
2876 )) |
2859 )) |
2877 self.qt5DocAct.triggered.connect(self.__showQt5Doc) |
2860 self.qt5DocAct.triggered.connect(lambda: self.__showQtDoc(5)) |
2878 self.actions.append(self.qt5DocAct) |
2861 self.actions.append(self.qt5DocAct) |
|
2862 |
|
2863 self.qt6DocAct = E5Action( |
|
2864 self.tr('Qt6 Documentation'), |
|
2865 self.tr('Qt6 Documentation'), |
|
2866 0, 0, self, 'qt6_documentation') |
|
2867 self.qt6DocAct.setStatusTip(self.tr('Open Qt6 Documentation')) |
|
2868 self.qt6DocAct.setWhatsThis(self.tr( |
|
2869 """<b>Qt6 Documentation</b>""" |
|
2870 """<p>Display the Qt6 Documentation. Dependent upon your""" |
|
2871 """ settings, this will either show the help in Eric's internal""" |
|
2872 """ help viewer/web browser, or execute a web browser or Qt""" |
|
2873 """ Assistant. </p>""" |
|
2874 )) |
|
2875 self.qt6DocAct.triggered.connect(lambda: self.__showQtDoc(6)) |
|
2876 self.actions.append(self.qt6DocAct) |
2879 |
2877 |
2880 self.pyqt5DocAct = E5Action( |
2878 self.pyqt5DocAct = E5Action( |
2881 self.tr('PyQt5 Documentation'), |
2879 self.tr('PyQt5 Documentation'), |
2882 self.tr('PyQt&5 Documentation'), |
2880 self.tr('PyQt5 Documentation'), |
2883 0, 0, self, 'pyqt5_documentation') |
2881 0, 0, self, 'pyqt5_documentation') |
2884 self.pyqt5DocAct.setStatusTip(self.tr( |
2882 self.pyqt5DocAct.setStatusTip(self.tr( |
2885 'Open PyQt5 Documentation')) |
2883 'Open PyQt5 Documentation')) |
2886 self.pyqt5DocAct.setWhatsThis(self.tr( |
2884 self.pyqt5DocAct.setWhatsThis(self.tr( |
2887 """<b>PyQt5 Documentation</b>""" |
2885 """<b>PyQt5 Documentation</b>""" |
2888 """<p>Display the PyQt5 Documentation. Dependent upon your""" |
2886 """<p>Display the PyQt5 Documentation. Dependent upon your""" |
2889 """ settings, this will either show the help in Eric's""" |
2887 """ settings, this will either show the help in Eric's""" |
2890 """ internal help viewer/web browser, or execute a web""" |
2888 """ internal help viewer/web browser, or execute a web""" |
2891 """ browser or Qt Assistant. </p>""" |
2889 """ browser or Qt Assistant. </p>""" |
2892 )) |
2890 )) |
2893 self.pyqt5DocAct.triggered.connect(self.__showPyQt5Doc) |
2891 self.pyqt5DocAct.triggered.connect( |
|
2892 lambda: self.__showPyQtDoc(variant=5)) |
2894 self.actions.append(self.pyqt5DocAct) |
2893 self.actions.append(self.pyqt5DocAct) |
2895 |
2894 |
|
2895 self.pyqt6DocAct = E5Action( |
|
2896 self.tr('PyQt6 Documentation'), |
|
2897 self.tr('PyQt6 Documentation'), |
|
2898 0, 0, self, 'pyqt6_documentation') |
|
2899 self.pyqt6DocAct.setStatusTip(self.tr( |
|
2900 'Open PyQt6 Documentation')) |
|
2901 self.pyqt6DocAct.setWhatsThis(self.tr( |
|
2902 """<b>PyQt6 Documentation</b>""" |
|
2903 """<p>Display the PyQt6 Documentation. Dependent upon your""" |
|
2904 """ settings, this will either show the help in Eric's""" |
|
2905 """ internal help viewer/web browser, or execute a web""" |
|
2906 """ browser or Qt Assistant. </p>""" |
|
2907 )) |
|
2908 self.pyqt6DocAct.triggered.connect( |
|
2909 lambda: self.__showPyQtDoc(variant=6)) |
|
2910 self.actions.append(self.pyqt6DocAct) |
|
2911 |
2896 def __initPythonDocActions(self): |
2912 def __initPythonDocActions(self): |
2897 """ |
2913 """ |
2898 Private slot to initialize the actions to show the Python |
2914 Private slot to initialize the actions to show the Python |
2899 documentation. |
2915 documentation. |
2900 """ |
2916 """ |
2901 self.pythonDocAct = E5Action( |
2917 self.pythonDocAct = E5Action( |
2902 self.tr('Python 3 Documentation'), |
2918 self.tr('Python 3 Documentation'), |
2903 self.tr('Python &3 Documentation'), |
2919 self.tr('Python 3 Documentation'), |
2904 0, 0, self, 'python3_documentation') |
2920 0, 0, self, 'python3_documentation') |
2905 self.pythonDocAct.setStatusTip(self.tr( |
2921 self.pythonDocAct.setStatusTip(self.tr( |
2906 'Open Python 3 Documentation')) |
2922 'Open Python 3 Documentation')) |
2907 self.pythonDocAct.setWhatsThis(self.tr( |
2923 self.pythonDocAct.setWhatsThis(self.tr( |
2908 """<b>Python 3 Documentation</b>""" |
2924 """<b>Python 3 Documentation</b>""" |
2916 self.pythonDocAct.triggered.connect(self.__showPythonDoc) |
2932 self.pythonDocAct.triggered.connect(self.__showPythonDoc) |
2917 self.actions.append(self.pythonDocAct) |
2933 self.actions.append(self.pythonDocAct) |
2918 |
2934 |
2919 def __initEricDocAction(self): |
2935 def __initEricDocAction(self): |
2920 """ |
2936 """ |
2921 Private slot to initialize the action to show the eric6 documentation. |
2937 Private slot to initialize the action to show the eric documentation. |
2922 """ |
2938 """ |
2923 self.ericDocAct = E5Action( |
2939 self.ericDocAct = E5Action( |
2924 self.tr("Eric API Documentation"), |
2940 self.tr("Eric API Documentation"), |
2925 self.tr('&Eric API Documentation'), |
2941 self.tr('Eric API Documentation'), |
2926 0, 0, self, 'eric_documentation') |
2942 0, 0, self, 'eric_documentation') |
2927 self.ericDocAct.setStatusTip(self.tr( |
2943 self.ericDocAct.setStatusTip(self.tr( |
2928 "Open Eric API Documentation")) |
2944 "Open Eric API Documentation")) |
2929 self.ericDocAct.setWhatsThis(self.tr( |
2945 self.ericDocAct.setWhatsThis(self.tr( |
2930 """<b>Eric API Documentation</b>""" |
2946 """<b>Eric API Documentation</b>""" |
2931 """<p>Display the Eric API documentation. The location for the""" |
2947 """<p>Display the Eric API documentation. The location for the""" |
2932 """ documentation is the Documentation/Source subdirectory of""" |
2948 """ documentation is the Documentation/Source subdirectory of""" |
2933 """ the eric6 installation directory.</p>""" |
2949 """ the eric installation directory.</p>""" |
2934 )) |
2950 )) |
2935 self.ericDocAct.triggered.connect(self.__showEricDoc) |
2951 self.ericDocAct.triggered.connect(self.__showEricDoc) |
2936 self.actions.append(self.ericDocAct) |
2952 self.actions.append(self.ericDocAct) |
2937 |
2953 |
2938 def __initPySideDocActions(self): |
2954 def __initPySideDocActions(self): |
2939 """ |
2955 """ |
2940 Private slot to initialize the actions to show the PySide |
2956 Private slot to initialize the actions to show the PySide |
2941 documentation. |
2957 documentation. |
2942 """ |
2958 """ |
2943 if Utilities.checkPyside(): |
2959 if Utilities.checkPyside(variant=2): |
2944 self.pyside2DocAct = E5Action( |
2960 self.pyside2DocAct = E5Action( |
2945 self.tr('PySide2 Documentation'), |
2961 self.tr('PySide2 Documentation'), |
2946 self.tr('PySide&2 Documentation'), |
2962 self.tr('PySide2 Documentation'), |
2947 0, 0, self, 'pyside2_documentation') |
2963 0, 0, self, 'pyside2_documentation') |
2948 self.pyside2DocAct.setStatusTip(self.tr( |
2964 self.pyside2DocAct.setStatusTip(self.tr( |
2949 'Open PySide2 Documentation')) |
2965 'Open PySide2 Documentation')) |
2950 self.pyside2DocAct.setWhatsThis(self.tr( |
2966 self.pyside2DocAct.setWhatsThis(self.tr( |
2951 """<b>PySide2 Documentation</b>""" |
2967 """<b>PySide2 Documentation</b>""" |
2953 """ settings, this will either show the help in Eric's""" |
2969 """ settings, this will either show the help in Eric's""" |
2954 """ internal help viewer/web browser, or execute a web""" |
2970 """ internal help viewer/web browser, or execute a web""" |
2955 """ browser or Qt Assistant. </p>""" |
2971 """ browser or Qt Assistant. </p>""" |
2956 )) |
2972 )) |
2957 self.pyside2DocAct.triggered.connect( |
2973 self.pyside2DocAct.triggered.connect( |
2958 lambda: self.__showPySideDoc("2")) |
2974 lambda: self.__showPySideDoc(variant=2)) |
2959 self.actions.append(self.pyside2DocAct) |
2975 self.actions.append(self.pyside2DocAct) |
2960 else: |
2976 else: |
2961 self.pyside2DocAct = None |
2977 self.pyside2DocAct = None |
|
2978 |
|
2979 if Utilities.checkPyside(variant=6): |
|
2980 self.pyside6DocAct = E5Action( |
|
2981 self.tr('PySide6 Documentation'), |
|
2982 self.tr('PySide6 Documentation'), |
|
2983 0, 0, self, 'pyside6_documentation') |
|
2984 self.pyside6DocAct.setStatusTip(self.tr( |
|
2985 'Open PySide6 Documentation')) |
|
2986 self.pyside6DocAct.setWhatsThis(self.tr( |
|
2987 """<b>PySide6 Documentation</b>""" |
|
2988 """<p>Display the PySide6 Documentation. Dependent upon your""" |
|
2989 """ settings, this will either show the help in Eric's""" |
|
2990 """ internal help viewer/web browser, or execute a web""" |
|
2991 """ browser or Qt Assistant. </p>""" |
|
2992 )) |
|
2993 self.pyside6DocAct.triggered.connect( |
|
2994 lambda: self.__showPySideDoc(variant=6)) |
|
2995 self.actions.append(self.pyside6DocAct) |
|
2996 else: |
|
2997 self.pyside6DocAct = None |
2962 |
2998 |
2963 def __initMenus(self): |
2999 def __initMenus(self): |
2964 """ |
3000 """ |
2965 Private slot to create the menus. |
3001 Private slot to create the menus. |
2966 """ |
3002 """ |
3245 self.__menus["help"].addAction(self.helpviewerAct) |
3281 self.__menus["help"].addAction(self.helpviewerAct) |
3246 self.__menus["help"].addSeparator() |
3282 self.__menus["help"].addSeparator() |
3247 self.__menus["help"].addAction(self.ericDocAct) |
3283 self.__menus["help"].addAction(self.ericDocAct) |
3248 self.__menus["help"].addAction(self.pythonDocAct) |
3284 self.__menus["help"].addAction(self.pythonDocAct) |
3249 self.__menus["help"].addAction(self.qt5DocAct) |
3285 self.__menus["help"].addAction(self.qt5DocAct) |
3250 if self.pyqt5DocAct is not None: |
3286 self.__menus["help"].addAction(self.qt6DocAct) |
3251 self.__menus["help"].addAction(self.pyqt5DocAct) |
3287 self.__menus["help"].addAction(self.pyqt5DocAct) |
|
3288 self.__menus["help"].addAction(self.pyqt6DocAct) |
3252 if self.pyside2DocAct is not None: |
3289 if self.pyside2DocAct is not None: |
3253 self.__menus["help"].addAction(self.pyside2DocAct) |
3290 self.__menus["help"].addAction(self.pyside2DocAct) |
|
3291 if self.pyside6DocAct is not None: |
|
3292 self.__menus["help"].addAction(self.pyside6DocAct) |
3254 self.__menus["help"].addSeparator() |
3293 self.__menus["help"].addSeparator() |
3255 self.__menus["help"].addAction(self.versionAct) |
3294 self.__menus["help"].addAction(self.versionAct) |
3256 self.__menus["help"].addSeparator() |
3295 self.__menus["help"].addSeparator() |
3257 self.__menus["help"].addAction(self.checkUpdateAct) |
3296 self.__menus["help"].addAction(self.checkUpdateAct) |
3258 self.__menus["help"].addAction(self.showVersionsAct) |
3297 self.__menus["help"].addAction(self.showVersionsAct) |
5707 elif hvType == 3: |
5738 elif hvType == 3: |
5708 self.__webBrowser(home) |
5739 self.__webBrowser(home) |
5709 else: |
5740 else: |
5710 self.__customViewer(home) |
5741 self.__customViewer(home) |
5711 |
5742 |
5712 def __showPyQt5Doc(self): |
5743 def __showPyQtDoc(self, variant=5): |
5713 """ |
5744 """ |
5714 Private slot to show the PyQt5 documentation. |
5745 Private slot to show the PyQt5/6 documentation. |
5715 """ |
5746 |
5716 pyqt5DocDir = Preferences.getHelp("PyQt5DocDir") |
5747 @param variant PyQt variant to show documentation for (5 or 6) |
5717 if not pyqt5DocDir: |
5748 @type int or str |
5718 pyqt5DocDir = Utilities.getEnvironmentEntry("PYQT5DOCDIR", None) |
5749 """ |
5719 |
5750 pyqtDocDir = Preferences.getHelp("PyQt{0}DocDir".format(variant)) |
5720 if not pyqt5DocDir: |
5751 if not pyqtDocDir: |
|
5752 pyqtDocDir = Utilities.getEnvironmentEntry( |
|
5753 "PYQT{0}DOCDIR".format(variant), None) |
|
5754 |
|
5755 if not pyqtDocDir: |
5721 E5MessageBox.warning( |
5756 E5MessageBox.warning( |
5722 self, |
5757 self, |
5723 self.tr("Documentation"), |
5758 self.tr("Documentation"), |
5724 self.tr("""<p>The PyQt5 documentation starting point""" |
5759 self.tr("""<p>The PyQt{0} documentation starting point""" |
5725 """ has not been configured.</p>""")) |
5760 """ has not been configured.</p>""").format(variant)) |
5726 return |
5761 return |
5727 |
5762 |
5728 if not pyqt5DocDir.startswith(("http://", "https://", "qthelp://")): |
5763 if not pyqtDocDir.startswith(("http://", "https://", "qthelp://")): |
5729 home = "" |
5764 home = "" |
5730 if pyqt5DocDir: |
5765 if pyqtDocDir: |
5731 if pyqt5DocDir.startswith("file://"): |
5766 if pyqtDocDir.startswith("file://"): |
5732 pyqt5DocDir = pyqt5DocDir[7:] |
5767 pyqtDocDir = pyqtDocDir[7:] |
5733 if not os.path.splitext(pyqt5DocDir)[1]: |
5768 if not os.path.splitext(pyqtDocDir)[1]: |
5734 possibleHomes = [ |
5769 possibleHomes = [ |
5735 Utilities.normjoinpath( |
5770 Utilities.normjoinpath( |
5736 pyqt5DocDir, 'index.html'), |
5771 pyqtDocDir, 'index.html'), |
5737 Utilities.normjoinpath( |
5772 Utilities.normjoinpath( |
5738 pyqt5DocDir, 'class_reference.html'), |
5773 pyqtDocDir, 'class_reference.html'), |
5739 ] |
5774 ] |
5740 for possibleHome in possibleHomes: |
5775 for possibleHome in possibleHomes: |
5741 if os.path.exists(possibleHome): |
5776 if os.path.exists(possibleHome): |
5742 home = possibleHome |
5777 home = possibleHome |
5743 break |
5778 break |
5744 else: |
5779 else: |
5745 home = pyqt5DocDir |
5780 home = pyqtDocDir |
5746 |
5781 |
5747 if not home or not os.path.exists(home): |
5782 if not home or not os.path.exists(home): |
5748 E5MessageBox.warning( |
5783 E5MessageBox.warning( |
5749 self, |
5784 self, |
5750 self.tr("Documentation Missing"), |
5785 self.tr("Documentation Missing"), |
6946 self.__saveCurrentViewProfile(True) |
6980 self.__saveCurrentViewProfile(True) |
6947 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) |
6981 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) |
6948 Preferences.syncPreferences() |
6982 Preferences.syncPreferences() |
6949 self.shutdownCalled = True |
6983 self.shutdownCalled = True |
6950 return True |
6984 return True |
6951 |
|
6952 def isOnline(self): |
|
6953 """ |
|
6954 Public method to get the online state. |
|
6955 |
|
6956 @return online state |
|
6957 @rtype bool |
|
6958 """ |
|
6959 return self.networkIcon.isOnline() |
|
6960 |
|
6961 def __onlineStateChanged(self, online): |
|
6962 """ |
|
6963 Private slot handling changes in online state. |
|
6964 |
|
6965 @param online flag indicating the online state |
|
6966 @type bool |
|
6967 """ |
|
6968 if online: |
|
6969 self.performVersionCheck(False) |
|
6970 |
6985 |
6971 ############################################## |
6986 ############################################## |
6972 ## Below are methods to check for new versions |
6987 ## Below are methods to check for new versions |
6973 ############################################## |
6988 ############################################## |
6974 |
6989 |
6975 def showAvailableVersionsInfo(self): |
6990 def showAvailableVersionsInfo(self): |
6976 """ |
6991 """ |
6977 Public method to show the eric6 versions available for download. |
6992 Public method to show the eric versions available for download. |
6978 """ |
6993 """ |
6979 self.performVersionCheck(manual=True, showVersions=True) |
6994 self.performVersionCheck(manual=True, showVersions=True) |
6980 |
6995 |
6981 @pyqtSlot() |
6996 @pyqtSlot() |
6982 def performVersionCheck(self, manual=True, alternative=0, |
6997 def performVersionCheck(self, manual=True, alternative=0, |
6983 showVersions=False): |
6998 showVersions=False): |
6984 """ |
6999 """ |
6985 Public method to check the internet for an eric6 update. |
7000 Public method to check the internet for an eric update. |
6986 |
7001 |
6987 @param manual flag indicating an invocation via the menu (boolean) |
7002 @param manual flag indicating an invocation via the menu (boolean) |
6988 @param alternative index of server to download from (integer) |
7003 @param alternative index of server to download from (integer) |
6989 @keyparam showVersions flag indicating the show versions mode (boolean) |
7004 @param showVersions flag indicating the show versions mode (boolean) |
6990 """ |
7005 """ |
6991 if self.isOnline(): |
7006 if not manual: |
6992 if not manual: |
7007 if VersionOnly.startswith("@@"): |
6993 if VersionOnly.startswith("@@"): |
7008 return |
|
7009 else: |
|
7010 period = Preferences.getUI("PerformVersionCheck") |
|
7011 if period == 0: |
6994 return |
7012 return |
6995 else: |
7013 elif period in [2, 3, 4]: |
6996 period = Preferences.getUI("PerformVersionCheck") |
7014 lastCheck = Preferences.Prefs.settings.value( |
6997 if period == 0: |
7015 "Updates/LastCheckDate", QDate(1970, 1, 1)) |
6998 return |
7016 if lastCheck.isValid(): |
6999 elif period in [2, 3, 4]: |
7017 now = QDate.currentDate() |
7000 lastCheck = Preferences.Prefs.settings.value( |
7018 if period == 2 and lastCheck.day() == now.day(): |
7001 "Updates/LastCheckDate", QDate(1970, 1, 1)) |
7019 # daily |
7002 if lastCheck.isValid(): |
7020 return |
7003 now = QDate.currentDate() |
7021 elif period == 3 and lastCheck.daysTo(now) < 7: |
7004 if period == 2 and lastCheck.day() == now.day(): |
7022 # weekly |
7005 # daily |
7023 return |
7006 return |
7024 elif period == 4 and (lastCheck.daysTo(now) < |
7007 elif period == 3 and lastCheck.daysTo(now) < 7: |
7025 lastCheck.daysInMonth()): |
7008 # weekly |
7026 # monthly |
7009 return |
7027 return |
7010 elif period == 4 and (lastCheck.daysTo(now) < |
7028 |
7011 lastCheck.daysInMonth()): |
7029 self.__inVersionCheck = True |
7012 # monthly |
7030 self.manualUpdatesCheck = manual |
7013 return |
7031 self.showAvailableVersions = showVersions |
7014 |
7032 self.httpAlternative = alternative |
7015 self.__inVersionCheck = True |
7033 url = QUrl(self.__httpAlternatives[alternative]) |
7016 self.manualUpdatesCheck = manual |
7034 self.__versionCheckCanceled = False |
7017 self.showAvailableVersions = showVersions |
7035 if manual: |
7018 self.httpAlternative = alternative |
7036 if self.__versionCheckProgress is None: |
7019 url = QUrl(self.__httpAlternatives[alternative]) |
7037 self.__versionCheckProgress = E5ProgressDialog( |
7020 self.__versionCheckCanceled = False |
7038 "", self.tr("&Cancel"), |
7021 if manual: |
7039 0, len(self.__httpAlternatives), |
7022 if self.__versionCheckProgress is None: |
7040 self.tr("%v/%m"), self) |
7023 self.__versionCheckProgress = E5ProgressDialog( |
7041 self.__versionCheckProgress.setWindowTitle( |
7024 "", self.tr("&Cancel"), |
7042 self.tr("Version Check")) |
7025 0, len(self.__httpAlternatives), |
7043 self.__versionCheckProgress.setMinimumDuration(0) |
7026 self.tr("%v/%m"), self) |
7044 self.__versionCheckProgress.canceled.connect( |
7027 self.__versionCheckProgress.setWindowTitle( |
7045 self.__versionsDownloadCanceled) |
7028 self.tr("Version Check")) |
7046 self.__versionCheckProgress.setLabelText( |
7029 self.__versionCheckProgress.setMinimumDuration(0) |
7047 self.tr("Trying host {0}").format(url.host())) |
7030 self.__versionCheckProgress.canceled.connect( |
7048 self.__versionCheckProgress.setValue(alternative) |
7031 self.__versionsDownloadCanceled) |
7049 request = QNetworkRequest(url) |
7032 self.__versionCheckProgress.setLabelText( |
7050 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, |
7033 self.tr("Trying host {0}").format(url.host())) |
7051 QNetworkRequest.AlwaysNetwork) |
7034 self.__versionCheckProgress.setValue(alternative) |
7052 reply = self.__networkManager.get(request) |
7035 request = QNetworkRequest(url) |
7053 reply.finished.connect(lambda: self.__versionsDownloadDone(reply)) |
7036 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, |
7054 self.__replies.append(reply) |
7037 QNetworkRequest.AlwaysNetwork) |
7055 |
7038 reply = self.__networkManager.get(request) |
|
7039 reply.finished.connect(lambda: self.__versionsDownloadDone(reply)) |
|
7040 self.__replies.append(reply) |
|
7041 else: |
|
7042 if manual: |
|
7043 E5MessageBox.warning( |
|
7044 self, |
|
7045 self.tr("Error getting versions information"), |
|
7046 self.tr("""The versions information cannot not be""" |
|
7047 """ downloaded because you are <b>offline</b>.""" |
|
7048 """ Please go online and try again.""")) |
|
7049 |
|
7050 @pyqtSlot() |
7056 @pyqtSlot() |
7051 def __versionsDownloadDone(self, reply): |
7057 def __versionsDownloadDone(self, reply): |
7052 """ |
7058 """ |
7053 Private slot called, after the versions file has been downloaded |
7059 Private slot called, after the versions file has been downloaded |
7054 from the internet. |
7060 from the internet. |
7189 if availableVersionTuple > installedVersionTuple: |
7195 if availableVersionTuple > installedVersionTuple: |
7190 res = E5MessageBox.yesNo( |
7196 res = E5MessageBox.yesNo( |
7191 self, |
7197 self, |
7192 self.tr("Update available"), |
7198 self.tr("Update available"), |
7193 self.tr( |
7199 self.tr( |
7194 """The update to <b>{0}</b> of eric6 is""" |
7200 """The update to <b>{0}</b> of eric is""" |
7195 """ available at <b>{1}</b>. Would you like""" |
7201 """ available at <b>{1}</b>. Would you like""" |
7196 """ to get it?""") |
7202 """ to get it?""") |
7197 .format(versions[0], versions[1]), |
7203 .format(versions[0], versions[1]), |
7198 yesDefault=True) |
7204 yesDefault=True) |
7199 url = res and versions[1] or '' |
7205 url = res and versions[1] or '' |
7200 else: |
7206 else: |
7201 if self.manualUpdatesCheck: |
7207 if self.manualUpdatesCheck: |
7202 E5MessageBox.information( |
7208 E5MessageBox.information( |
7203 self, |
7209 self, |
7204 self.tr("Eric6 is up to date"), |
7210 self.tr("eric is up to date"), |
7205 self.tr( |
7211 self.tr( |
7206 """You are using the latest version of""" |
7212 """You are using the latest version of""" |
7207 """ eric6""")) |
7213 """ eric""")) |
7208 except (IndexError, TypeError): |
7214 except (IndexError, TypeError): |
7209 E5MessageBox.warning( |
7215 E5MessageBox.warning( |
7210 self, |
7216 self, |
7211 self.tr("Error during updates check"), |
7217 self.tr("Error during updates check"), |
7212 self.tr("""Could not perform updates check.""")) |
7218 self.tr("""Could not perform updates check.""")) |
7274 ## Below are methods for various checks |
7280 ## Below are methods for various checks |
7275 ####################################### |
7281 ####################################### |
7276 |
7282 |
7277 def checkConfigurationStatus(self): |
7283 def checkConfigurationStatus(self): |
7278 """ |
7284 """ |
7279 Public method to check, if eric6 has been configured. If it is not, |
7285 Public method to check, if eric has been configured. If it is not, |
7280 the configuration dialog is shown. |
7286 the configuration dialog is shown. |
7281 """ |
7287 """ |
7282 if not Preferences.isConfigured(): |
7288 if not Preferences.isConfigured(): |
7283 self.__initDebugToolbarsLayout() |
7289 self.__initDebugToolbarsLayout() |
7284 |
7290 |
7285 E5MessageBox.information( |
7291 E5MessageBox.information( |
7286 self, |
7292 self, |
7287 self.tr("First time usage"), |
7293 self.tr("First time usage"), |
7288 self.tr("""eric6 has not been configured yet. """ |
7294 self.tr("""eric has not been configured yet. """ |
7289 """The configuration dialog will be started.""")) |
7295 """The configuration dialog will be started.""")) |
7290 self.showPreferences() |
7296 self.showPreferences() |
7291 |
7297 |
7292 def checkProjectsWorkspace(self): |
7298 def checkProjectsWorkspace(self): |
7293 """ |
7299 """ |
7407 |
7413 |
7408 ########################################## |
7414 ########################################## |
7409 ## Support for desktop notifications below |
7415 ## Support for desktop notifications below |
7410 ########################################## |
7416 ########################################## |
7411 |
7417 |
7412 def showNotification(self, icon, heading, text, timeout=None): |
7418 def showNotification(self, icon, heading, text, |
|
7419 kind=NotificationTypes.Information, timeout=None): |
7413 """ |
7420 """ |
7414 Public method to show a desktop notification. |
7421 Public method to show a desktop notification. |
7415 |
7422 |
7416 @param icon icon to be shown in the notification |
7423 @param icon icon to be shown in the notification |
7417 @type QPixmap |
7424 @type QPixmap |
7418 @param heading heading of the notification |
7425 @param heading heading of the notification |
7419 @type str |
7426 @type str |
7420 @param text text of the notification |
7427 @param text text of the notification |
7421 @type str |
7428 @type str |
|
7429 @param kind kind of notification to be shown |
|
7430 @type NotificationTypes |
7422 @param timeout time in seconds the notification should be shown |
7431 @param timeout time in seconds the notification should be shown |
7423 (None = use configured timeout, 0 = indefinitely) |
7432 (None = use configured timeout, 0 = indefinitely) |
7424 @type int |
7433 @type int |
7425 """ |
7434 """ |
7426 if Preferences.getUI("NotificationsEnabled"): |
7435 if self.__notification is None: |
7427 if self.__notification is None: |
7436 from .NotificationWidget import NotificationWidget |
7428 from .NotificationWidget import NotificationWidget |
7437 self.__notification = NotificationWidget(parent=self) |
7429 self.__notification = NotificationWidget(parent=self) |
7438 if timeout is None: |
7430 self.__notification.setPixmap(icon) |
7439 timeout = Preferences.getUI("NotificationTimeout") |
7431 self.__notification.setHeading(heading) |
7440 self.__notification.showNotification(icon, heading, text, kind=kind, |
7432 self.__notification.setText(text) |
7441 timeout=timeout) |
7433 if timeout is None: |
|
7434 timeout = Preferences.getUI("NotificationTimeout") |
|
7435 self.__notification.setTimeout(timeout) |
|
7436 self.__notification.move(Preferences.getUI("NotificationPosition")) |
|
7437 self.__notification.show() |
|
7438 |
|
7439 def notificationsEnabled(self): |
|
7440 """ |
|
7441 Public method to check, if notifications are enabled. |
|
7442 |
|
7443 @return flag indicating, if notifications are enabled (boolean) |
|
7444 """ |
|
7445 return Preferences.getUI("NotificationsEnabled") |
|
7446 |
7442 |
7447 ######################### |
7443 ######################### |
7448 ## Support for IRC below |
7444 ## Support for IRC below |
7449 ######################### |
7445 ######################### |
7450 |
7446 |