mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2026-04-07 09:16:52 +00:00
feat(core): 更新配置管理和文件忽略规则
- 修改.gitignore文件,添加对Python缓存文件、虚拟环境和系统文件的忽略规则,提升项目整洁性。 - 更新主窗口和相关模块的导入路径,确保从新的配置模块中正确导入配置项,增强代码结构的清晰度。 - 删除不再使用的图片和模块,优化项目资源,减少冗余文件,提升维护效率。
This commit is contained in:
@@ -112,7 +112,7 @@ class CloudflareOptimizer:
|
||||
ipv6_warning.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
|
||||
# 设置图标
|
||||
icon_path = resource_path(os.path.join("IMG", "ICO", "icon.png"))
|
||||
icon_path = resource_path(os.path.join("assets", "images", "ICO", "icon.png"))
|
||||
if os.path.exists(icon_path):
|
||||
pixmap = QPixmap(icon_path)
|
||||
if not pixmap.isNull():
|
||||
@@ -150,7 +150,7 @@ class CloudflareOptimizer:
|
||||
optimization_msg
|
||||
)
|
||||
# 设置Cloudflare图标
|
||||
cf_icon_path = resource_path("IMG/ICO/cloudflare_logo_icon.ico")
|
||||
cf_icon_path = resource_path("assets/images/ICO/cloudflare_logo_icon.ico")
|
||||
if os.path.exists(cf_icon_path):
|
||||
cf_pixmap = QPixmap(cf_icon_path)
|
||||
if not cf_pixmap.isNull():
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
from PySide6 import QtWidgets
|
||||
from data.config import LOG_FILE
|
||||
from config.config import LOG_FILE
|
||||
from utils.logger import setup_logger
|
||||
from utils import Logger
|
||||
import datetime
|
||||
from data.config import APP_NAME
|
||||
from config.config import APP_NAME
|
||||
|
||||
# 初始化logger
|
||||
logger = setup_logger("debug_manager")
|
||||
@@ -64,7 +64,7 @@ class DebugManager:
|
||||
|
||||
# 创建或删除debug_mode.txt标记文件
|
||||
try:
|
||||
from data.config import CACHE
|
||||
from config.config import CACHE
|
||||
debug_file = os.path.join(os.path.dirname(CACHE), "debug_mode.txt")
|
||||
|
||||
if checked:
|
||||
|
||||
@@ -11,11 +11,11 @@ from PySide6.QtGui import QIcon, QPixmap, QFont
|
||||
from PySide6.QtWidgets import QPushButton, QDialog, QHBoxLayout
|
||||
|
||||
from utils import msgbox_frame, HostsManager, resource_path
|
||||
from data.config import APP_NAME, PLUGIN, GAME_INFO, UA, CONFIG_URL, DOWNLOAD_THREADS, DEFAULT_DOWNLOAD_THREAD_LEVEL
|
||||
from config.config import APP_NAME, PLUGIN, GAME_INFO, UA, CONFIG_URL, DOWNLOAD_THREADS, DEFAULT_DOWNLOAD_THREAD_LEVEL
|
||||
from workers import IpOptimizerThread
|
||||
from core.cloudflare_optimizer import CloudflareOptimizer
|
||||
from core.download_task_manager import DownloadTaskManager
|
||||
from core.extraction_handler import ExtractionHandler
|
||||
from core.managers.cloudflare_optimizer import CloudflareOptimizer
|
||||
from core.managers.download_task_manager import DownloadTaskManager
|
||||
from core.handlers.extraction_handler import ExtractionHandler
|
||||
from utils.logger import setup_logger
|
||||
|
||||
# 初始化logger
|
||||
@@ -629,7 +629,7 @@ class DownloadManager:
|
||||
msg_box.setWindowTitle(f"下载优化 - {APP_NAME}")
|
||||
msg_box.setText("是否愿意通过Cloudflare加速来优化下载速度?\n\n这将临时修改系统的hosts文件,并需要管理员权限。\n如您的杀毒软件提醒有软件正在修改hosts文件,请注意放行。")
|
||||
|
||||
cf_icon_path = resource_path("IMG/ICO/cloudflare_logo_icon.ico")
|
||||
cf_icon_path = resource_path("assets/images/ICO/cloudflare_logo_icon.ico")
|
||||
if os.path.exists(cf_icon_path):
|
||||
cf_pixmap = QPixmap(cf_icon_path)
|
||||
if not cf_pixmap.isNull():
|
||||
|
||||
@@ -3,7 +3,7 @@ from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QDialog, QVBoxLayout, QRadioButton, QPushButton, QLabel, QButtonGroup, QHBoxLayout
|
||||
from PySide6.QtGui import QFont
|
||||
|
||||
from data.config import DOWNLOAD_THREADS
|
||||
from config.config import DOWNLOAD_THREADS
|
||||
|
||||
|
||||
class DownloadTaskManager:
|
||||
|
||||
@@ -8,7 +8,7 @@ import threading
|
||||
from PySide6.QtCore import QObject, Signal
|
||||
from PySide6.QtWidgets import QDialog, QVBoxLayout, QLabel, QPushButton, QTextEdit, QProgressBar, QMessageBox
|
||||
|
||||
from data.config import APP_NAME
|
||||
from config.config import APP_NAME
|
||||
from utils import msgbox_frame
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from PySide6 import QtWidgets, QtCore
|
||||
from PySide6.QtCore import QTimer
|
||||
from PySide6.QtWidgets import QMessageBox
|
||||
|
||||
from data.config import PLUGIN, PLUGIN_HASH, GAME_INFO
|
||||
from config.config import PLUGIN, PLUGIN_HASH, GAME_INFO
|
||||
from utils import msgbox_frame
|
||||
from utils.logger import setup_logger
|
||||
|
||||
@@ -140,7 +140,7 @@ class OfflineModeManager:
|
||||
|
||||
# 更新窗口标题
|
||||
if hasattr(self.main_window, 'setWindowTitle'):
|
||||
from data.config import APP_NAME, APP_VERSION
|
||||
from config.config import APP_NAME, APP_VERSION
|
||||
mode_indicator = "[离线模式]" if enabled else "[在线模式]"
|
||||
self.main_window.setWindowTitle(f"{APP_NAME} v{APP_VERSION} {mode_indicator}")
|
||||
|
||||
@@ -245,7 +245,7 @@ class OfflineModeManager:
|
||||
|
||||
# 创建进度对话框
|
||||
from utils.helpers import ProgressHashVerifyDialog
|
||||
from data.config import PLUGIN_HASH
|
||||
from config.config import PLUGIN_HASH
|
||||
from workers.hash_thread import OfflineHashVerifyThread
|
||||
|
||||
# 创建并显示进度对话框
|
||||
@@ -327,7 +327,7 @@ class OfflineModeManager:
|
||||
debug_mode = self._is_debug_mode()
|
||||
|
||||
# 导入所需模块
|
||||
from data.config import GAME_INFO, PLUGIN
|
||||
from config.config import GAME_INFO, PLUGIN
|
||||
|
||||
# 存储结果到对话框,以便在exec()返回后获取
|
||||
dialog.hash_result = result
|
||||
@@ -476,7 +476,7 @@ class OfflineModeManager:
|
||||
debug_mode = self._is_debug_mode()
|
||||
|
||||
# 导入所需模块
|
||||
from data.config import GAME_INFO, PLUGIN_HASH
|
||||
from config.config import GAME_INFO, PLUGIN_HASH
|
||||
from workers.hash_thread import HashThread
|
||||
|
||||
# 获取安装路径
|
||||
@@ -557,7 +557,7 @@ class OfflineModeManager:
|
||||
self.main_window.download_manager.selected_folder
|
||||
)
|
||||
|
||||
from data.config import GAME_INFO
|
||||
from config.config import GAME_INFO
|
||||
if game_version in game_dirs and game_version in GAME_INFO:
|
||||
game_dir = game_dirs[game_version]
|
||||
install_path = os.path.join(game_dir, os.path.basename(GAME_INFO[game_version]["install_path"]))
|
||||
|
||||
@@ -6,7 +6,7 @@ import traceback
|
||||
from utils.logger import setup_logger
|
||||
from PySide6.QtWidgets import QMessageBox
|
||||
from PySide6.QtCore import QTimer, QThread, Signal
|
||||
from data.config import PLUGIN_HASH, APP_NAME
|
||||
from config.config import PLUGIN_HASH, APP_NAME
|
||||
|
||||
# 初始化logger
|
||||
logger = setup_logger("patch_detector")
|
||||
@@ -43,7 +43,7 @@ class PatchDetector:
|
||||
def _load_game_info(self):
|
||||
"""从配置中加载游戏信息和补丁哈希值"""
|
||||
try:
|
||||
from data.config import GAME_INFO, PLUGIN_HASH
|
||||
from config.config import GAME_INFO, PLUGIN_HASH
|
||||
self.game_info = GAME_INFO
|
||||
self.plugin_hash = PLUGIN_HASH
|
||||
except ImportError:
|
||||
|
||||
@@ -3,7 +3,7 @@ import shutil
|
||||
import traceback
|
||||
from PySide6.QtWidgets import QMessageBox
|
||||
from utils.logger import setup_logger
|
||||
from data.config import APP_NAME
|
||||
from config.config import APP_NAME
|
||||
from utils import msgbox_frame
|
||||
|
||||
class PatchManager:
|
||||
|
||||
@@ -6,8 +6,8 @@ import json
|
||||
from PySide6.QtWidgets import QDialog, QVBoxLayout, QHBoxLayout, QTextBrowser, QPushButton, QCheckBox, QLabel, QMessageBox
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from data.privacy_policy import PRIVACY_POLICY_BRIEF, get_local_privacy_policy, PRIVACY_POLICY_VERSION
|
||||
from data.config import CACHE, APP_NAME, APP_VERSION
|
||||
from config.privacy_policy import PRIVACY_POLICY_BRIEF, get_local_privacy_policy, PRIVACY_POLICY_VERSION
|
||||
from config.config import CACHE, APP_NAME, APP_VERSION
|
||||
from utils import msgbox_frame
|
||||
from utils.logger import setup_logger
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import webbrowser
|
||||
import os
|
||||
|
||||
from utils import load_base64_image, msgbox_frame, resource_path
|
||||
from data.config import APP_NAME, APP_VERSION, LOG_FILE
|
||||
from core.ipv6_manager import IPv6Manager # 导入新的IPv6Manager类
|
||||
from config.config import APP_NAME, APP_VERSION, LOG_FILE
|
||||
from core.managers.ipv6_manager import IPv6Manager # 导入新的IPv6Manager类
|
||||
|
||||
class UIManager:
|
||||
def __init__(self, main_window):
|
||||
@@ -33,7 +33,7 @@ class UIManager:
|
||||
# 设置窗口图标
|
||||
import os
|
||||
from utils import resource_path
|
||||
icon_path = resource_path(os.path.join("IMG", "ICO", "icon.png"))
|
||||
icon_path = resource_path(os.path.join("assets", "images", "ICO", "icon.png"))
|
||||
if os.path.exists(icon_path):
|
||||
self.main_window.setWindowIcon(QIcon(icon_path))
|
||||
|
||||
@@ -572,7 +572,7 @@ class UIManager:
|
||||
# 用户确认撤回
|
||||
try:
|
||||
# 导入隐私管理器
|
||||
from core.privacy_manager import PrivacyManager
|
||||
from core.managers.privacy_manager import PrivacyManager
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
Reference in New Issue
Block a user