Merge branch 'DLMS_dev' into dev
This commit is contained in:
@@ -82,7 +82,7 @@ MAA多账号管理与自动化软件
|
||||
|
||||

|
||||
|
||||
感谢 @ClozyA 为本项目提供的下载服务器
|
||||
感谢 [AoXuan (@ClozyA)](https://github.com/ClozyA) 为本项目提供的下载服务器
|
||||
|
||||
## Star History
|
||||
|
||||
|
||||
@@ -745,8 +745,21 @@ class AppConfig:
|
||||
class GlobalConfig(QConfig):
|
||||
"""全局配置"""
|
||||
|
||||
function_HomePage = OptionsConfigItem(
|
||||
"Function",
|
||||
"HomePage",
|
||||
"https://ak.hypergryph.com/#information",
|
||||
OptionsValidator(
|
||||
[
|
||||
"https://ak.hypergryph.com/#information",
|
||||
"https://ak-webview.hypergryph.com/gameBulletin",
|
||||
"https://ak.hypergryph.com/user/home",
|
||||
"https://prts.wiki/w/%E9%A6%96%E9%A1%B5",
|
||||
]
|
||||
),
|
||||
)
|
||||
function_HistoryRetentionTime = OptionsConfigItem(
|
||||
"Function", "HistoryRetentionTime", 7, OptionsValidator([7, 15, 30, 60, 0])
|
||||
"Function", "HistoryRetentionTime", 0, OptionsValidator([7, 15, 30, 60, 0])
|
||||
)
|
||||
function_IfAllowSleep = ConfigItem(
|
||||
"Function", "IfAllowSleep", False, BoolValidator()
|
||||
@@ -759,6 +772,9 @@ class GlobalConfig(QConfig):
|
||||
|
||||
start_IfSelfStart = ConfigItem("Start", "IfSelfStart", False, BoolValidator())
|
||||
start_IfRunDirectly = ConfigItem("Start", "IfRunDirectly", False, BoolValidator())
|
||||
start_IfMinimizeDirectly = ConfigItem(
|
||||
"Start", "IfMinimizeDirectly", False, BoolValidator()
|
||||
)
|
||||
|
||||
ui_IfShowTray = ConfigItem("UI", "IfShowTray", False, BoolValidator())
|
||||
ui_IfToTray = ConfigItem("UI", "IfToTray", False, BoolValidator())
|
||||
|
||||
@@ -52,10 +52,7 @@ from .Widget import StatefulItemCard, QuantifiedItemCard
|
||||
|
||||
class History(QWidget):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setObjectName("历史记录")
|
||||
|
||||
|
||||
67
app/ui/home.py
Normal file
67
app/ui/home.py
Normal file
@@ -0,0 +1,67 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主界面
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
from loguru import logger
|
||||
from PySide6.QtWidgets import (
|
||||
QFrame,
|
||||
QVBoxLayout,
|
||||
)
|
||||
from qframelesswindow.webengine import FramelessWebEngineView
|
||||
from PySide6.QtCore import QUrl
|
||||
|
||||
from app.core import Config
|
||||
|
||||
|
||||
class Home(QFrame):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setObjectName("主界面")
|
||||
|
||||
self.webView = FramelessWebEngineView(self)
|
||||
|
||||
self.vBoxLayout = QVBoxLayout(self)
|
||||
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.vBoxLayout.addWidget(self.webView)
|
||||
|
||||
self.current_url = None
|
||||
|
||||
self.refresh()
|
||||
|
||||
def refresh(self):
|
||||
|
||||
if (
|
||||
Config.global_config.get(Config.global_config.function_HomePage)
|
||||
!= self.current_url
|
||||
):
|
||||
|
||||
self.webView.load(
|
||||
QUrl(Config.global_config.get(Config.global_config.function_HomePage))
|
||||
)
|
||||
self.current_url = Config.global_config.get(
|
||||
Config.global_config.function_HomePage
|
||||
)
|
||||
@@ -51,11 +51,12 @@ import shutil
|
||||
|
||||
from app.core import Config, TaskManager, MainTimer, MainInfoBar
|
||||
from app.services import Notify, Crypto, System
|
||||
from .setting import Setting
|
||||
from .home import Home
|
||||
from .member_manager import MemberManager
|
||||
from .queue_manager import QueueManager
|
||||
from .dispatch_center import DispatchCenter
|
||||
from .history import History
|
||||
from .setting import Setting
|
||||
|
||||
|
||||
class AUTO_MAA(MSFluentWindow):
|
||||
@@ -75,18 +76,19 @@ class AUTO_MAA(MSFluentWindow):
|
||||
System.main_window = self.window()
|
||||
|
||||
# 创建主窗口
|
||||
self.setting = Setting(self)
|
||||
self.home = Home(self)
|
||||
self.member_manager = MemberManager(self)
|
||||
self.queue_manager = QueueManager(self)
|
||||
self.dispatch_center = DispatchCenter(self)
|
||||
self.history = History(self)
|
||||
self.setting = Setting(self)
|
||||
|
||||
self.addSubInterface(
|
||||
self.setting,
|
||||
FluentIcon.SETTING,
|
||||
"设置",
|
||||
FluentIcon.SETTING,
|
||||
NavigationItemPosition.BOTTOM,
|
||||
self.home,
|
||||
FluentIcon.HOME,
|
||||
"主页",
|
||||
FluentIcon.HOME,
|
||||
NavigationItemPosition.TOP,
|
||||
)
|
||||
self.addSubInterface(
|
||||
self.member_manager,
|
||||
@@ -116,6 +118,16 @@ class AUTO_MAA(MSFluentWindow):
|
||||
FluentIcon.HISTORY,
|
||||
NavigationItemPosition.BOTTOM,
|
||||
)
|
||||
self.addSubInterface(
|
||||
self.setting,
|
||||
FluentIcon.SETTING,
|
||||
"设置",
|
||||
FluentIcon.SETTING,
|
||||
NavigationItemPosition.BOTTOM,
|
||||
)
|
||||
self.stackedWidget.currentChanged.connect(
|
||||
lambda index: (self.home.refresh() if index == 0 else None)
|
||||
)
|
||||
self.stackedWidget.currentChanged.connect(
|
||||
lambda index: (self.member_manager.refresh() if index == 1 else None)
|
||||
)
|
||||
@@ -246,6 +258,11 @@ class AUTO_MAA(MSFluentWindow):
|
||||
|
||||
self.start_main_task()
|
||||
|
||||
# 直接最小化
|
||||
if Config.global_config.get(Config.global_config.start_IfMinimizeDirectly):
|
||||
|
||||
self.titleBar.minBtn.click()
|
||||
|
||||
def set_min_method(self) -> None:
|
||||
"""设置最小化方法"""
|
||||
|
||||
@@ -347,6 +364,8 @@ class AUTO_MAA(MSFluentWindow):
|
||||
)
|
||||
self.window().setGeometry(location[0], location[1], size[0], size[1])
|
||||
self.window().show()
|
||||
self.window().raise_()
|
||||
self.window().activateWindow()
|
||||
if not if_quick:
|
||||
if Config.global_config.get(Config.global_config.ui_maximized):
|
||||
self.window().showMaximized()
|
||||
|
||||
@@ -72,10 +72,7 @@ from .Widget import (
|
||||
|
||||
class MemberManager(QWidget):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.setObjectName("脚本管理")
|
||||
|
||||
@@ -60,10 +60,7 @@ from .Widget import (
|
||||
|
||||
class QueueManager(QWidget):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.setObjectName("调度队列")
|
||||
|
||||
@@ -58,10 +58,7 @@ from .Widget import LineEditMessageBox, LineEditSettingCard, PasswordLineEditSet
|
||||
|
||||
class Setting(QWidget):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.setObjectName("设置")
|
||||
@@ -417,6 +414,18 @@ class FunctionSettingCard(HeaderCardWidget):
|
||||
super().__init__(parent)
|
||||
self.setTitle("功能")
|
||||
|
||||
self.card_HomePage = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.function_HomePage,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="主页内容",
|
||||
content="选择AUTO_MAA主页展示的内容",
|
||||
texts=[
|
||||
"明日方舟官网情报",
|
||||
"明日方舟游戏公告",
|
||||
"明日方舟个人中心",
|
||||
"PRTS百科网站首页",
|
||||
],
|
||||
)
|
||||
self.card_HistoryRetentionTime = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.function_HistoryRetentionTime,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
@@ -439,6 +448,7 @@ class FunctionSettingCard(HeaderCardWidget):
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
Layout.addWidget(self.card_HomePage)
|
||||
Layout.addWidget(self.card_HistoryRetentionTime)
|
||||
Layout.addWidget(self.card_IfAllowSleep)
|
||||
Layout.addWidget(self.card_IfSilence)
|
||||
@@ -496,10 +506,17 @@ class StartSettingCard(HeaderCardWidget):
|
||||
content="启动AUTO_MAA后自动运行自动代理任务,优先级:调度队列 1 > 脚本 1",
|
||||
configItem=Config.global_config.start_IfRunDirectly,
|
||||
)
|
||||
self.card_IfMinimizeDirectly = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="启动后直接最小化",
|
||||
content="启动AUTO_MAA后直接最小化",
|
||||
configItem=Config.global_config.start_IfMinimizeDirectly,
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
Layout.addWidget(self.card_IfSelfStart)
|
||||
Layout.addWidget(self.card_IfRunDirectly)
|
||||
Layout.addWidget(self.card_IfMinimizeDirectly)
|
||||
self.viewLayout.addLayout(Layout)
|
||||
|
||||
|
||||
|
||||
3
main.py
3
main.py
@@ -32,7 +32,7 @@ from qfluentwidgets import FluentTranslator
|
||||
import sys
|
||||
|
||||
|
||||
# @logger.catch
|
||||
@logger.catch
|
||||
def main():
|
||||
|
||||
application = QApplication(sys.argv)
|
||||
@@ -45,6 +45,7 @@ def main():
|
||||
|
||||
window = AUTO_MAA()
|
||||
window.show_ui("显示主窗口")
|
||||
window.setMicaEffectEnabled(True)
|
||||
window.start_up_task()
|
||||
sys.exit(application.exec())
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"main_version": "4.2.4.2",
|
||||
"main_version": "4.2.4.3",
|
||||
"updater_version": "1.1.2.0",
|
||||
"announcement": "\n## 新增功能\n- 历史记录统计功能上线\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新",
|
||||
"announcement": "\n## 新增功能\n- 历史记录统计功能上线\n- 添加软件主页\n- 添加启动时直接最小化功能\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新",
|
||||
"proxy_list": [
|
||||
"",
|
||||
"https://gitproxy.click/",
|
||||
|
||||
Reference in New Issue
Block a user