feat(ui): 添加软件临时主页

This commit is contained in:
DLmaster
2025-02-21 15:54:28 +08:00
parent 5fc6e74cd6
commit 1367daf1b7
8 changed files with 77 additions and 25 deletions

View File

@@ -52,10 +52,7 @@ from .Widget import StatefulItemCard, QuantifiedItemCard
class History(QWidget): class History(QWidget):
def __init__( def __init__(self, parent=None):
self,
parent=None,
):
super().__init__(parent) super().__init__(parent)
self.setObjectName("历史记录") self.setObjectName("历史记录")

52
app/ui/home.py Normal file
View File

@@ -0,0 +1,52 @@
# <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 qfluentwidgets import TitleLabel
from qframelesswindow.webengine import FramelessWebEngineView
from PySide6.QtCore import QUrl
class Home(QFrame):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setObjectName("主界面")
# self.webView = FramelessWebEngineView(self)
# self.webView.load(QUrl("https://github.com/DLmaster361/AUTO_MAA"))
self.Lable = TitleLabel(" 正在施工中~")
self.vBoxLayout = QVBoxLayout(self)
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
# self.vBoxLayout.addWidget(self.webView)
self.vBoxLayout.addWidget(self.Lable)
self.vBoxLayout.addStretch(1)

View File

@@ -51,11 +51,12 @@ import shutil
from app.core import Config, TaskManager, MainTimer, MainInfoBar from app.core import Config, TaskManager, MainTimer, MainInfoBar
from app.services import Notify, Crypto, System from app.services import Notify, Crypto, System
from .setting import Setting from .home import Home
from .member_manager import MemberManager from .member_manager import MemberManager
from .queue_manager import QueueManager from .queue_manager import QueueManager
from .dispatch_center import DispatchCenter from .dispatch_center import DispatchCenter
from .history import History from .history import History
from .setting import Setting
class AUTO_MAA(MSFluentWindow): class AUTO_MAA(MSFluentWindow):
@@ -75,18 +76,19 @@ class AUTO_MAA(MSFluentWindow):
System.main_window = self.window() System.main_window = self.window()
# 创建主窗口 # 创建主窗口
self.setting = Setting(self) self.home = Home(self)
self.member_manager = MemberManager(self) self.member_manager = MemberManager(self)
self.queue_manager = QueueManager(self) self.queue_manager = QueueManager(self)
self.dispatch_center = DispatchCenter(self) self.dispatch_center = DispatchCenter(self)
self.history = History(self) self.history = History(self)
self.setting = Setting(self)
self.addSubInterface( self.addSubInterface(
self.setting, self.home,
FluentIcon.SETTING, FluentIcon.HOME,
"设置", "主页",
FluentIcon.SETTING, FluentIcon.HOME,
NavigationItemPosition.BOTTOM, NavigationItemPosition.TOP,
) )
self.addSubInterface( self.addSubInterface(
self.member_manager, self.member_manager,
@@ -116,6 +118,13 @@ class AUTO_MAA(MSFluentWindow):
FluentIcon.HISTORY, FluentIcon.HISTORY,
NavigationItemPosition.BOTTOM, NavigationItemPosition.BOTTOM,
) )
self.addSubInterface(
self.setting,
FluentIcon.SETTING,
"设置",
FluentIcon.SETTING,
NavigationItemPosition.BOTTOM,
)
self.stackedWidget.currentChanged.connect( self.stackedWidget.currentChanged.connect(
lambda index: (self.member_manager.refresh() if index == 1 else None) lambda index: (self.member_manager.refresh() if index == 1 else None)
) )
@@ -347,6 +356,8 @@ class AUTO_MAA(MSFluentWindow):
) )
self.window().setGeometry(location[0], location[1], size[0], size[1]) self.window().setGeometry(location[0], location[1], size[0], size[1])
self.window().show() self.window().show()
self.window().raise_()
self.window().activateWindow()
if not if_quick: if not if_quick:
if Config.global_config.get(Config.global_config.ui_maximized): if Config.global_config.get(Config.global_config.ui_maximized):
self.window().showMaximized() self.window().showMaximized()

View File

@@ -72,10 +72,7 @@ from .Widget import (
class MemberManager(QWidget): class MemberManager(QWidget):
def __init__( def __init__(self, parent=None):
self,
parent=None,
):
super().__init__(parent) super().__init__(parent)
self.setObjectName("脚本管理") self.setObjectName("脚本管理")

View File

@@ -60,10 +60,7 @@ from .Widget import (
class QueueManager(QWidget): class QueueManager(QWidget):
def __init__( def __init__(self, parent=None):
self,
parent=None,
):
super().__init__(parent) super().__init__(parent)
self.setObjectName("调度队列") self.setObjectName("调度队列")

View File

@@ -58,10 +58,7 @@ from .Widget import LineEditMessageBox, LineEditSettingCard, PasswordLineEditSet
class Setting(QWidget): class Setting(QWidget):
def __init__( def __init__(self, parent=None):
self,
parent=None,
):
super().__init__(parent) super().__init__(parent)
self.setObjectName("设置") self.setObjectName("设置")

View File

@@ -45,6 +45,7 @@ def main():
window = AUTO_MAA() window = AUTO_MAA()
window.show_ui("显示主窗口") window.show_ui("显示主窗口")
window.setMicaEffectEnabled(True)
window.start_up_task() window.start_up_task()
sys.exit(application.exec()) sys.exit(application.exec())

View File

@@ -1,7 +1,7 @@
{ {
"main_version": "4.2.4.2", "main_version": "4.2.4.3",
"updater_version": "1.1.2.0", "updater_version": "1.1.2.0",
"announcement": "\n## 新增功能\n- 历史记录统计功能上线\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段`未检测到任何模拟器`\n- 取消MAA运行中自动更新", "announcement": "\n## 新增功能\n- 历史记录统计功能上线\n- 添加软件主页\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段`未检测到任何模拟器`\n- 取消MAA运行中自动更新",
"proxy_list": [ "proxy_list": [
"", "",
"https://gitproxy.click/", "https://gitproxy.click/",