Skip to content

Commit 6155908

Browse files
committed
- 优化 **通知渠道选择**,新增ClassIsland使用提示
1 parent 7e3f228 commit 6155908

5 files changed

Lines changed: 127 additions & 18 deletions

File tree

CHANGELOG/v2.2.0/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ v2.0 - Koharu(小鸟游星野) release 3
77

88
## 💡 功能优化
99

10+
- 优化 **通知渠道选择**,新增ClassIsland使用提示
1011
- 优化 **浮窗点击识别**,减少误识别为拖动
1112
- 优化 **安全验证逻辑**,统一使用项目验证系统
1213
- 优化 **软件退出**,解决退出缓慢问题

app/Language/modules/notification_settings.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
"description": "点名完成后不抢占焦点,保持原有顶层软件焦点",
115115
"switchbutton_name": {"enable": "", "disable": ""},
116116
},
117+
"classisland_notification_hint": {
118+
"title": "ClassIsland通知服务",
119+
"content": "请确保已安装.NET 8运行时,并在ClassIsland中安装SecRandom-Ci插件",
120+
},
117121
},
118122
"EN_US": {
119123
"title": {
@@ -200,6 +204,10 @@
200204
"name": "Focusless Mode",
201205
"description": "Do not steal focus after Quick Pick, keep focus on original top-level software",
202206
},
207+
"classisland_notification_hint": {
208+
"title": "ClassIsland Notification Service",
209+
"content": "Please ensure .NET 8 runtime is installed and SecRandom-Ci plugin is installed in ClassIsland",
210+
},
203211
},
204212
}
205213

@@ -271,6 +279,10 @@
271279
"name": "通知显示时长",
272280
"description": "设置ClassIsland通知显示时长(秒)",
273281
},
282+
"classisland_notification_hint": {
283+
"title": "ClassIsland通知服务",
284+
"content": "请确保已安装.NET 8运行时,并在ClassIsland中安装SecRandom-Ci插件",
285+
},
274286
},
275287
"EN_US": {
276288
"title": {
@@ -341,6 +353,10 @@
341353
"name": "Notification display duration",
342354
"description": "Set notification display duration (seconds)",
343355
},
356+
"classisland_notification_hint": {
357+
"title": "ClassIsland Notification Service",
358+
"content": "Please ensure .NET 8 runtime is installed and SecRandom-Ci plugin is installed in ClassIsland",
359+
},
344360
},
345361
}
346362

@@ -430,6 +446,10 @@
430446
"name": "通知显示时长",
431447
"description": "设置ClassIsland通知显示时长(秒)",
432448
},
449+
"classisland_notification_hint": {
450+
"title": "ClassIsland通知服务",
451+
"content": "请确保已安装.NET 8运行时,并在ClassIsland中安装SecRandom-Ci插件",
452+
},
433453
},
434454
"EN_US": {
435455
"title": {
@@ -512,5 +532,9 @@
512532
"name": "Notification display duration",
513533
"description": "Set notification display duration (seconds)",
514534
},
535+
"classisland_notification_hint": {
536+
"title": "ClassIsland Notification Service",
537+
"content": "Please ensure .NET 8 runtime is installed and SecRandom-Ci plugin is installed in ClassIsland",
538+
},
515539
},
516540
}

app/view/settings/notification_settings/lottery_notification_settings.py

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,8 @@ def __init__(self, parent=None):
156156
"lottery_notification_settings", "notification_service_type"
157157
)
158158
)
159-
self.notification_service_type_combo_box.currentTextChanged.connect(
160-
lambda: update_settings(
161-
"lottery_notification_settings",
162-
"notification_service_type",
163-
self.notification_service_type_combo_box.currentIndex(),
164-
)
159+
self.notification_service_type_combo_box.currentIndexChanged.connect(
160+
self.on_notification_service_type_changed
165161
)
166162

167163
# 添加设置项到分组
@@ -212,6 +208,38 @@ def __init__(self, parent=None):
212208
self.notification_service_type_combo_box,
213209
)
214210

211+
def on_notification_service_type_changed(self, index):
212+
"""通知服务类型变化时的处理"""
213+
update_settings(
214+
"lottery_notification_settings",
215+
"notification_service_type",
216+
index,
217+
)
218+
# 如果选择了ClassIsland或内置+ClassIsland,显示提示信息
219+
if index == 1 or index == 2:
220+
from qfluentwidgets import InfoBar, InfoBarPosition
221+
222+
hint_title = get_any_position_value_async(
223+
"lottery_notification_settings",
224+
"classisland_notification_hint",
225+
"title",
226+
)
227+
hint_content = get_any_position_value_async(
228+
"lottery_notification_settings",
229+
"classisland_notification_hint",
230+
"content",
231+
)
232+
233+
InfoBar.success(
234+
title=hint_title,
235+
content=hint_content,
236+
orient=Qt.Horizontal,
237+
isClosable=True,
238+
position=InfoBarPosition.TOP,
239+
duration=5000,
240+
parent=self,
241+
)
242+
215243

216244
class floating_window_settings(GroupHeaderCardWidget):
217245
def __init__(self, parent=None):

app/view/settings/notification_settings/quick_draw_notification_settings.py

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,8 @@ def __init__(self, parent=None):
8989
"quick_draw_notification_settings", "notification_service_type"
9090
)
9191
)
92-
self.notification_service_type_combo_box.currentTextChanged.connect(
93-
lambda: update_settings(
94-
"quick_draw_notification_settings",
95-
"notification_service_type",
96-
self.notification_service_type_combo_box.currentIndex(),
97-
)
92+
self.notification_service_type_combo_box.currentIndexChanged.connect(
93+
self.on_notification_service_type_changed
9894
)
9995

10096
# 添加设置项到分组
@@ -117,6 +113,38 @@ def __init__(self, parent=None):
117113
self.notification_service_type_combo_box,
118114
)
119115

116+
def on_notification_service_type_changed(self, index):
117+
"""通知服务类型变化时的处理"""
118+
update_settings(
119+
"quick_draw_notification_settings",
120+
"notification_service_type",
121+
index,
122+
)
123+
# 如果选择了ClassIsland或内置+ClassIsland,显示提示信息
124+
if index == 1 or index == 2:
125+
from qfluentwidgets import InfoBar, InfoBarPosition
126+
127+
hint_title = get_any_position_value_async(
128+
"quick_draw_notification_settings",
129+
"classisland_notification_hint",
130+
"title",
131+
)
132+
hint_content = get_any_position_value_async(
133+
"quick_draw_notification_settings",
134+
"classisland_notification_hint",
135+
"content",
136+
)
137+
138+
InfoBar.success(
139+
title=hint_title,
140+
content=hint_content,
141+
orient=Qt.Horizontal,
142+
isClosable=True,
143+
position=InfoBarPosition.TOP,
144+
duration=5000,
145+
parent=self,
146+
)
147+
120148

121149
class floating_window_settings(GroupHeaderCardWidget):
122150
def __init__(self, parent=None):

app/view/settings/notification_settings/roll_call_notification_settings.py

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,8 @@ def __init__(self, parent=None):
142142
"roll_call_notification_settings", "notification_service_type"
143143
)
144144
)
145-
self.notification_service_type_combo_box.currentTextChanged.connect(
146-
lambda: update_settings(
147-
"roll_call_notification_settings",
148-
"notification_service_type",
149-
self.notification_service_type_combo_box.currentIndex(),
150-
)
145+
self.notification_service_type_combo_box.currentIndexChanged.connect(
146+
self.on_notification_service_type_changed
151147
)
152148

153149
# 主窗口显示阈值
@@ -219,6 +215,38 @@ def __init__(self, parent=None):
219215
self.main_window_threshold_spinbox,
220216
)
221217

218+
def on_notification_service_type_changed(self, index):
219+
"""通知服务类型变化时的处理"""
220+
update_settings(
221+
"roll_call_notification_settings",
222+
"notification_service_type",
223+
index,
224+
)
225+
# 如果选择了ClassIsland或内置+ClassIsland,显示提示信息
226+
if index == 1 or index == 2:
227+
from qfluentwidgets import InfoBar, InfoBarPosition
228+
229+
hint_title = get_any_position_value_async(
230+
"roll_call_notification_settings",
231+
"classisland_notification_hint",
232+
"title",
233+
)
234+
hint_content = get_any_position_value_async(
235+
"roll_call_notification_settings",
236+
"classisland_notification_hint",
237+
"content",
238+
)
239+
240+
InfoBar.success(
241+
title=hint_title,
242+
content=hint_content,
243+
orient=Qt.Horizontal,
244+
isClosable=True,
245+
position=InfoBarPosition.TOP,
246+
duration=5000,
247+
parent=self,
248+
)
249+
222250

223251
class floating_window_settings(GroupHeaderCardWidget):
224252
def __init__(self, parent=None):

0 commit comments

Comments
 (0)