feat(ui): 用户仪表盘支持直接控制用户状态
优化仪表盘排版
This commit is contained in:
@@ -563,7 +563,7 @@ class MaaPlanConfig(LQConfig):
|
||||
|
||||
class AppConfig(GlobalConfig):
|
||||
|
||||
VERSION = "4.3.8.2"
|
||||
VERSION = "4.3.8.3"
|
||||
|
||||
gameid_refreshed = Signal()
|
||||
PASSWORD_refreshed = Signal()
|
||||
|
||||
@@ -933,6 +933,38 @@ class TimeEditSettingCard(SettingCard):
|
||||
self.TimeEdit.setTime(QTime.fromString(value, "HH:mm"))
|
||||
|
||||
|
||||
class StatusSwitchSetting(SwitchButton):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
qconfig: QConfig,
|
||||
configItem_check: ConfigItem,
|
||||
configItem_enable: ConfigItem,
|
||||
parent=None,
|
||||
):
|
||||
super().__init__(parent)
|
||||
self.qconfig = qconfig
|
||||
self.configItem_check = configItem_check
|
||||
self.configItem_enable = configItem_enable
|
||||
self.setOffText("")
|
||||
self.setOnText("")
|
||||
|
||||
if configItem_check:
|
||||
self.setValue(self.qconfig.get(configItem_check))
|
||||
configItem_check.valueChanged.connect(self.setValue)
|
||||
if configItem_enable:
|
||||
self.setEnabled(self.qconfig.get(configItem_enable))
|
||||
configItem_enable.valueChanged.connect(self.setEnabled)
|
||||
|
||||
self.checkedChanged.connect(self.setValue)
|
||||
|
||||
def setValue(self, isChecked: bool):
|
||||
if self.configItem_check:
|
||||
self.qconfig.set(self.configItem_check, isChecked)
|
||||
|
||||
self.setChecked(isChecked)
|
||||
|
||||
|
||||
class HistoryCard(HeaderCardWidget):
|
||||
|
||||
def __init__(self, qconfig: QConfig, configItem: ConfigItem, parent=None):
|
||||
|
||||
@@ -71,6 +71,7 @@ from .Widget import (
|
||||
SwitchSettingCard,
|
||||
PushAndSwitchButtonSettingCard,
|
||||
PushAndComboBoxSettingCard,
|
||||
StatusSwitchSetting,
|
||||
PivotArea,
|
||||
)
|
||||
|
||||
@@ -1230,14 +1231,14 @@ class MemberManager(QWidget):
|
||||
else "******"
|
||||
),
|
||||
)
|
||||
self.dashboard.setItem(
|
||||
self.dashboard.setCellWidget(
|
||||
int(name[3:]) - 1,
|
||||
3,
|
||||
QTableWidgetItem(
|
||||
"启用"
|
||||
if config.get(config.Info_Status)
|
||||
and config.get(config.Info_RemainedDay) != 0
|
||||
else "禁用"
|
||||
StatusSwitchSetting(
|
||||
qconfig=config,
|
||||
configItem_check=config.Info_Status,
|
||||
configItem_enable=config.Info_RemainedDay,
|
||||
parent=self,
|
||||
),
|
||||
)
|
||||
self.dashboard.setItem(
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"main_version": "4.3.8.2",
|
||||
"main_version": "4.3.8.3",
|
||||
"version_info": {
|
||||
"4.3.8.3": {
|
||||
"新增功能": [
|
||||
"用户仪表盘支持直接控制用户状态"
|
||||
]
|
||||
},
|
||||
"4.3.8.2": {
|
||||
"新增功能": [
|
||||
"添加ADB端口号宽幅适配能力"
|
||||
|
||||
Reference in New Issue
Block a user