2450 """<p>Display version information.</p>""" |
2450 """<p>Display version information.</p>""" |
2451 )) |
2451 )) |
2452 self.versionAct.triggered.connect(self.__showVersions) |
2452 self.versionAct.triggered.connect(self.__showVersions) |
2453 self.actions.append(self.versionAct) |
2453 self.actions.append(self.versionAct) |
2454 |
2454 |
2455 self.checkUpdateAct = EricAction( |
|
2456 self.tr('Check for Updates'), |
|
2457 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates') |
|
2458 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates')) |
|
2459 self.checkUpdateAct.setWhatsThis(self.tr( |
|
2460 """<b>Check for Updates...</b>""" |
|
2461 """<p>Checks the internet for updates of eric.</p>""" |
|
2462 )) |
|
2463 self.checkUpdateAct.triggered.connect(self.performVersionCheck) |
|
2464 self.actions.append(self.checkUpdateAct) |
|
2465 |
|
2466 self.showVersionsAct = EricAction( |
|
2467 self.tr('Show downloadable versions'), |
|
2468 self.tr('Show &downloadable versions...'), |
|
2469 0, 0, self, 'show_downloadable_versions') |
|
2470 self.showVersionsAct.setStatusTip( |
|
2471 self.tr('Show the versions available for download')) |
|
2472 self.showVersionsAct.setWhatsThis(self.tr( |
|
2473 """<b>Show downloadable versions...</b>""" |
|
2474 """<p>Shows the eric versions available for download """ |
|
2475 """from the internet.</p>""" |
|
2476 )) |
|
2477 self.showVersionsAct.triggered.connect( |
|
2478 self.showAvailableVersionsInfo) |
|
2479 self.actions.append(self.showVersionsAct) |
|
2480 |
|
2481 self.upgradePyQtAct = EricAction( |
|
2482 self.tr('Upgrade PyQt6'), |
|
2483 self.tr('Upgrade PyQt6...'), |
|
2484 0, 0, self, 'upgrade_pyqt6') |
|
2485 self.upgradePyQtAct.setStatusTip( |
|
2486 self.tr('Upgrade PyQt6 and restart eric')) |
|
2487 self.upgradePyQtAct.setWhatsThis(self.tr( |
|
2488 """<b>Upgrade PyQt6...</b>""" |
|
2489 """<p>Upgrade the PyQt6 packages eric depends on and restart""" |
|
2490 """ eric.</p>""" |
|
2491 )) |
|
2492 self.upgradePyQtAct.triggered.connect(self.upgradePyQt) |
|
2493 self.actions.append(self.upgradePyQtAct) |
|
2494 |
|
2495 self.showErrorLogAct = EricAction( |
2455 self.showErrorLogAct = EricAction( |
2496 self.tr('Show Error Log'), |
2456 self.tr('Show Error Log'), |
2497 self.tr('Show Error &Log...'), |
2457 self.tr('Show Error &Log...'), |
2498 0, 0, self, 'show_error_log') |
2458 0, 0, self, 'show_error_log') |
2499 self.showErrorLogAct.setStatusTip(self.tr('Show Error Log')) |
2459 self.showErrorLogAct.setStatusTip(self.tr('Show Error Log')) |
3597 if self.pyside6DocAct is not None: |
3557 if self.pyside6DocAct is not None: |
3598 self.__menus["help"].addAction(self.pyside6DocAct) |
3558 self.__menus["help"].addAction(self.pyside6DocAct) |
3599 self.__menus["help"].addSeparator() |
3559 self.__menus["help"].addSeparator() |
3600 self.__menus["help"].addAction(self.versionAct) |
3560 self.__menus["help"].addAction(self.versionAct) |
3601 self.__menus["help"].addSeparator() |
3561 self.__menus["help"].addSeparator() |
3602 self.__menus["help"].addAction(self.checkUpdateAct) |
|
3603 self.__menus["help"].addAction(self.showVersionsAct) |
|
3604 self.__menus["help"].addSeparator() |
|
3605 self.__menus["help"].addAction(self.upgradePyQtAct) |
|
3606 self.__menus["help"].addSeparator() |
|
3607 self.__menus["help"].addAction(self.showInstallInfoAct) |
3562 self.__menus["help"].addAction(self.showInstallInfoAct) |
3608 self.__menus["help"].addSeparator() |
3563 self.__menus["help"].addSeparator() |
3609 self.__menus["help"].addAction(self.showErrorLogAct) |
3564 self.__menus["help"].addAction(self.showErrorLogAct) |
3610 self.__menus["help"].addAction(self.reportBugAct) |
3565 self.__menus["help"].addAction(self.reportBugAct) |
3611 self.__menus["help"].addAction(self.requestFeatureAct) |
3566 self.__menus["help"].addAction(self.requestFeatureAct) |
3969 |
3924 |
3970 def __showHelpMenu(self): |
3925 def __showHelpMenu(self): |
3971 """ |
3926 """ |
3972 Private slot to display the Help menu. |
3927 Private slot to display the Help menu. |
3973 """ |
3928 """ |
3974 self.checkUpdateAct.setEnabled(not self.__inVersionCheck) |
|
3975 self.showVersionsAct.setEnabled(not self.__inVersionCheck) |
|
3976 self.showErrorLogAct.setEnabled(self.__hasErrorLog()) |
3929 self.showErrorLogAct.setEnabled(self.__hasErrorLog()) |
3977 |
3930 |
3978 infoFileName = Globals.getInstallInfoFilePath() |
3931 infoFileName = Globals.getInstallInfoFilePath() |
3979 self.showInstallInfoAct.setEnabled(os.path.exists(infoFileName)) |
3932 self.showInstallInfoAct.setEnabled(os.path.exists(infoFileName)) |
3980 |
3933 |
4456 ) |
4409 ) |
4457 |
4410 |
4458 if res and self.__shutdown(): |
4411 if res and self.__shutdown(): |
4459 ericApp().closeAllWindows() |
4412 ericApp().closeAllWindows() |
4460 program = sys.executable |
4413 program = sys.executable |
4461 eric7 = os.path.join(getConfig("ericDir"), "eric7.py") |
4414 args = ["-m", "eric7", "--start-session"] |
4462 args = [eric7] |
|
4463 args.append("--start-session") |
|
4464 args.extend(self.__restartArgs) |
4415 args.extend(self.__restartArgs) |
4465 QProcess.startDetached(program, args) |
4416 QProcess.startDetached(program, args) |
4466 |
4417 |
4467 @pyqtSlot() |
4418 @pyqtSlot() |
4468 def upgradePyQt(self): |
4419 def upgradePyQt(self): |
4473 @rtype bool |
4424 @rtype bool |
4474 """ |
4425 """ |
4475 yes = EricMessageBox.yesNo( |
4426 yes = EricMessageBox.yesNo( |
4476 self, |
4427 self, |
4477 self.tr("Upgrade PyQt"), |
4428 self.tr("Upgrade PyQt"), |
4478 self.tr("""In order to upgrade PyQt eric needs to be closed. It""" |
4429 self.tr("""eric needs to be closed in order to upgrade PyQt. It""" |
4479 """ will be restarted once the upgrade process has""" |
4430 """ will be restarted once the upgrade process has""" |
4480 """ finished. This may take some time.\n\nShall the""" |
4431 """ finished. This may take some time.\n\nShall the""" |
4481 """ upgrade be done now?""") |
4432 """ upgrade be done now?""") |
4482 ) |
4433 ) |
4483 |
4434 |
4485 self.__performUpgrade("pyqt") |
4436 self.__performUpgrade("pyqt") |
4486 return True |
4437 return True |
4487 |
4438 |
4488 return False |
4439 return False |
4489 |
4440 |
|
4441 @pyqtSlot() |
|
4442 def upgradeEric(self): |
|
4443 """ |
|
4444 Public slot to upgrade the eric-ide package of the eric7 environment. |
|
4445 |
|
4446 @return flag indicating a successful upgrade |
|
4447 @rtype bool |
|
4448 """ |
|
4449 yes = EricMessageBox.yesNo( |
|
4450 self, |
|
4451 self.tr("Upgrade Eric"), |
|
4452 self.tr("""eric needs to be closed in order to be upgraded. It""" |
|
4453 """ will be restarted once the upgrade process has""" |
|
4454 """ finished. This may take some time.\n\nShall the""" |
|
4455 """ upgrade be done now?""") |
|
4456 ) |
|
4457 |
|
4458 if yes and self.__shutdown(): |
|
4459 self.__performUpgrade("eric") |
|
4460 return True |
|
4461 |
|
4462 return False |
|
4463 |
|
4464 @pyqtSlot() |
|
4465 def upgradeEricPyQt(self): |
|
4466 """ |
|
4467 Public slot to upgrade the eric-ide and Pyqt packages of the eric7 |
|
4468 environment. |
|
4469 |
|
4470 @return flag indicating a successful upgrade |
|
4471 @rtype bool |
|
4472 """ |
|
4473 yes = EricMessageBox.yesNo( |
|
4474 self, |
|
4475 self.tr("Upgrade Eric"), |
|
4476 self.tr("""eric needs to be closed in order to upgrade eric and""" |
|
4477 """ PyQt. It will be restarted once the upgrade process""" |
|
4478 """ has finished. This may take some time.\n\n Shall""" |
|
4479 """ the upgrade be done now?""") |
|
4480 ) |
|
4481 |
|
4482 if yes and self.__shutdown(): |
|
4483 self.__performUpgrade("ericpyqt") |
|
4484 return True |
|
4485 |
|
4486 return False |
|
4487 |
4490 def __performUpgrade(self, upgradeType): |
4488 def __performUpgrade(self, upgradeType): |
4491 """ |
4489 """ |
4492 Private method to perform the requested upgrade operation. |
4490 Private method to perform the requested upgrade operation. |
4493 |
4491 |
4494 This action needs to shut down eric first, start a non-PyQt application |
4492 This action needs to shut down eric first, start a non-PyQt application |
4495 performing the upgrade of the PyQt packages via pip and restart eric |
4493 performing the upgrade of the PyQt packages via pip and restart eric |
4496 with the passed arguments. The upgrade process is not visible. |
4494 with the passed arguments. The upgrade process is not visible. |
4497 |
4495 |
4498 @param upgradeType upgrade operation (one of 'pyqt') |
4496 @param upgradeType upgrade operation (one of 'eric', 'ericpyqt', |
|
4497 'pyqt') |
4499 @type str |
4498 @type str |
4500 """ |
4499 """ |
4501 ericApp().closeAllWindows() |
4500 ericApp().closeAllWindows() |
4502 program = sys.executable |
4501 program = sys.executable |
4503 ericStartArgs = [ |
4502 ericStartArgs = ["-m", "eric7", "--start-session"] |
4504 os.path.join(getConfig("ericDir"), "eric7.py"), |
|
4505 "--start-session", |
|
4506 ] |
|
4507 ericStartArgs.extend(self.__restartArgs) |
4503 ericStartArgs.extend(self.__restartArgs) |
4508 |
4504 |
4509 upgrader = os.path.join( |
4505 upgrader = os.path.join( |
4510 os.path.dirname(__file__), "upgrader.py" |
4506 os.path.dirname(__file__), "upgrader.py" |
4511 ) |
4507 ) |
7564 self.performVersionCheck(False) |
7560 self.performVersionCheck(False) |
7565 |
7561 |
7566 ############################################## |
7562 ############################################## |
7567 ## Below are methods to check for new versions |
7563 ## Below are methods to check for new versions |
7568 ############################################## |
7564 ############################################## |
7569 |
7565 |
7570 def showAvailableVersionsInfo(self): |
7566 # TODO: change performVersionCheck to check against PyPI and do that |
7571 """ |
7567 # only for the automatic check |
7572 Public method to show the eric versions available for download. |
|
7573 """ |
|
7574 self.performVersionCheck(manual=True, showVersions=True) |
|
7575 |
|
7576 @pyqtSlot() |
7568 @pyqtSlot() |
7577 def performVersionCheck(self, manual=True, alternative=0, |
7569 def performVersionCheck(self, manual=True, alternative=0, |
7578 showVersions=False): |
7570 showVersions=False): |
7579 """ |
7571 """ |
7580 Public method to check the internet for an eric update. |
7572 Public method to check the internet for an eric update. |