Auto update now works

This commit is contained in:
Yusarina
2024-10-22 00:18:19 +01:00
parent 1b908a4200
commit fd87d1d5d7
3 changed files with 15 additions and 10 deletions
+5
View File
@@ -7,6 +7,7 @@ if "bpy" not in locals():
from .core.register import __bl_ordered_classes
from .core import properties
from .core import addon_preferences
from .core.updater import check_for_update_on_start
else:
import importlib
importlib.reload(ui)
@@ -33,6 +34,8 @@ def register():
#finally register properties that may use some classes.
core.register.register_properties()
bpy.app.handlers.load_post.append(check_for_update_on_start)
from .functions.mesh_tools import AvatarToolkit_OT_ApplyShapeKey
bpy.types.MESH_MT_shape_key_context_menu.append((lambda self, context: self.layout.separator()))
@@ -41,6 +44,8 @@ def register():
def unregister():
print("Unregistering Avatar Toolkit")
# Unregister the UI classes
if check_for_update_on_start in bpy.app.handlers.load_post:
bpy.app.handlers.load_post.remove(check_for_update_on_start)
# Iterate over the classes to unregister in reverse order and unregister them
for cls in reversed(list(__bl_ordered_classes)):
+2 -8
View File
@@ -6,6 +6,7 @@ import urllib
import shutil
import pathlib
import zipfile
import time
from threading import Thread
from bpy.app.handlers import persistent
from ..functions.translations import t
@@ -13,7 +14,7 @@ from .addon_preferences import get_preference, get_current_version, save_prefere
from .register import register_wrap
from ..ui.panel import AvatarToolKit_PT_AvatarToolkitPanel, CATEGORY_NAME
GITHUB_REPO = "teamneoneko/Avatar-Toolkit"
GITHUB_REPO = "Yusarina/avito"
is_checking_for_update = False
update_needed = False
@@ -292,10 +293,3 @@ def ui_refresh():
for window in windowManager.windows:
for area in window.screen.areas:
area.tag_redraw()
def register():
bpy.app.handlers.load_post.append(check_for_update_on_start)
def unregister():
if check_for_update_on_start in bpy.app.handlers.load_post:
bpy.app.handlers.load_post.remove(check_for_update_on_start)
+8 -2
View File
@@ -256,8 +256,14 @@
"Updater.UpdateToLatestButton.label": "Update to {name}",
"Updater.UpdateToSelectedButton.label": "Update",
"Updater.currentVersion": "Current Version: {name}",
"Scene.avatar_toolkit_updater_version_list.name": "Available Versions",
"Scene.avatar_toolkit_updater_version_list.description": "List of available versions to update to",
"Updater.CheckForUpdateButton.desc": "Check for available updates",
"UpdateToLatestButton.desc": "Update to the latest version",
"UpdateNotificationPopup.label": "Update Notification",
"UpdateNotificationPopup.desc": "Notification about available updates",
"UpdateNotificationPopup.newUpdate": "New update available: {version}",
"RestartBlenderPopup.label": "Restart Blender",
"RestartBlenderPopup.desc": "Restart Blender to complete the update",
"RestartBlenderPopup.message": "Update successful! Please restart Blender.",
"check_for_update.cantCheck": "Unable to check for updates",
"download_file.cantConnect": "Cannot connect to update server",
"download_file.cantFindZip": "Update file not found",