Addon Manager: Remove restart need for pref packs

The actual need to restart was removed by 7a566ea4d, this commit
updates the Addon Manager user interface to stop telling the user
they need to restart. Now restarting is only required for addons
that contain workbenches. Macros and pref packs to not need a
restart.
This commit is contained in:
Chris Hennes
2022-02-24 09:49:15 -06:00
parent af8890df69
commit 189bec3e5a
2 changed files with 24 additions and 15 deletions

View File

@@ -260,7 +260,6 @@ class CommandAddonManager:
self.macro_repo_dir = FreeCAD.getUserMacroDir(True)
self.packages_with_updates = []
self.startup_sequence = []
self.addon_removed = False
self.cleanup_workers()
# restore window geometry from stored state
@@ -1315,7 +1314,7 @@ class CommandAddonManager:
)
for installed_repo in self.subupdates_succeeded:
if not installed_repo.repo_type == AddonManagerRepo.RepoType.MACRO:
if installed_repo.contains_workbench():
self.restart_required = True
installed_repo.set_status(AddonManagerRepo.UpdateStatus.PENDING_RESTART)
else:
@@ -1393,7 +1392,7 @@ class CommandAddonManager:
message,
QtWidgets.QMessageBox.Close,
)
if repo.repo_type != AddonManagerRepo.RepoType.MACRO:
if repo.contains_workbench():
repo.set_status(AddonManagerRepo.UpdateStatus.PENDING_RESTART)
self.restart_required = True
else:
@@ -1513,11 +1512,9 @@ class CommandAddonManager:
self.item_model.update_item_status(
repo.name, AddonManagerRepo.UpdateStatus.NOT_INSTALLED
)
self.addon_removed = (
True # A value to trigger the restart message on dialog close
)
if repo.contains_workbench():
self.restart_required = True
self.packageDetails.show_repo(repo)
self.restart_required = True
else:
self.dialog.textBrowserReadMe.setText(
translate(

View File

@@ -1003,10 +1003,16 @@ class InstallWorkbenchWorker(QtCore.QThread):
repo = git.Git(clonedir)
try:
repo.pull("--ff-only") # Refuses to take a progress object?
answer = translate(
"AddonsInstaller",
"Workbench successfully updated. Please restart FreeCAD to apply the changes.",
)
if self.repo.contains_workbench():
answer = translate(
"AddonsInstaller",
"Workbench successfully updated. Please restart FreeCAD to apply the changes.",
)
else:
answer = translate(
"AddonsInstaller",
"Workbench successfully updated.",
)
except Exception as e:
answer = (
translate("AddonsInstaller", "Error updating module")
@@ -1077,10 +1083,16 @@ class InstallWorkbenchWorker(QtCore.QThread):
FreeCAD.Console.PrintMessage("Clone complete\n")
answer = translate(
"AddonsInstaller",
"Workbench successfully installed. Please restart FreeCAD to apply the changes.",
)
if self.repo.contains_workbench():
answer = translate(
"AddonsInstaller",
"Workbench successfully installed. Please restart FreeCAD to apply the changes.",
)
else:
answer = translate(
"AddonsInstaller",
"Addon successfully installed.",
)
if self.repo.repo_type == AddonManagerRepo.RepoType.WORKBENCH:
# symlink any macro contained in the module to the macros folder