整合子模块
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
from textual.app import ComposeResult
|
||||
from textual.widgets import (
|
||||
Header,
|
||||
Footer,
|
||||
Label,
|
||||
Static,
|
||||
Button,
|
||||
Markdown,
|
||||
)
|
||||
from textual.containers import Container
|
||||
from textual.screen import Screen
|
||||
|
||||
import heurams.services.version as version
|
||||
from heurams.context import *
|
||||
|
||||
class AboutScreen(Screen):
|
||||
BINDINGS = [
|
||||
("q", "go_back", "返回"),
|
||||
("escape", "quit_app", "退出"),
|
||||
]
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
with Container(id="about_container"):
|
||||
yield Label("关于 '潜进' 启发式先进记忆调度器", classes="title-label")
|
||||
yield Static(f"\n版本: {version.ver} {version.codename.capitalize()}")
|
||||
yield Static(f"开发者名单: Wang Zhiyu") # TODO: 取消硬编码, 和 git/vcs 集成
|
||||
yield Static(f"Copyright 2025")
|
||||
yield Static("\n")
|
||||
|
||||
about_text = f"""
|
||||
## 关于 "潜进"
|
||||
|
||||
版本 {version.ver} {version.stage}
|
||||
|
||||
开发代号: {version.codename}
|
||||
|
||||
一个基于启发式算法的开放源代码记忆调度器, 旨在帮助用户更高效地进行记忆工作与学习规划.
|
||||
|
||||
以 AGPL-3.0 开放源代码
|
||||
|
||||
## 参与贡献
|
||||
|
||||
我们是一个年轻且包容的社区, 由技术人员, 设计师, 文书工作者, 以及创意人员共同构成,
|
||||
|
||||
通过我们协力开发的软件为所有人谋取福祉.
|
||||
|
||||
此项目不是 KDE 软件, 但上述工作不可避免地让我们确立了和 KDE 宣言相同的下列价值观:
|
||||
|
||||
- 开放治理 确保更多人能参与我们的领导和决策进程;
|
||||
|
||||
- 自由软件 确保我们的工作成果随时能为所有人所用;
|
||||
|
||||
- 多样包容 确保所有人都能加入社区并参加工作;
|
||||
|
||||
- 创新精神 确保新思路能不断涌现并服务于所有人;
|
||||
|
||||
- 共同产权 确保我们能团结一致;
|
||||
|
||||
- 迎合用户 确保我们的成果对所有人有用.
|
||||
|
||||
综上所述, 在为我们共同目标奋斗的过程中, 我们认为上述价值观反映了我们社区的本质, 是我们始终如一地保持初心的关键所在.
|
||||
|
||||
这是一项立足于协作精神的事业, 它的运作和产出不受任何单一个人或者机构的操纵.
|
||||
|
||||
我们的共同目标是为人人带来高品质的辅助记忆 & 学习软件.
|
||||
|
||||
不管您来自何方, 我们都欢迎您加入社区并做出贡献.
|
||||
|
||||
"""
|
||||
yield Markdown(about_text, classes="about-markdown")
|
||||
|
||||
yield Button(
|
||||
"返回主界面",
|
||||
id="back_button",
|
||||
variant="primary",
|
||||
classes="back-button",
|
||||
)
|
||||
yield Footer()
|
||||
|
||||
def action_go_back(self):
|
||||
self.app.pop_screen()
|
||||
|
||||
def action_quit_app(self):
|
||||
self.app.exit()
|
||||
|
||||
def on_button_pressed(self, event) -> None:
|
||||
if event.button.id == "back_button":
|
||||
self.action_go_back()
|
||||
@@ -23,7 +23,7 @@ class DashboardScreen(Screen):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
yield Container(
|
||||
Label(f'欢迎使用 "潜进" 启发式辅助记忆调度器', classes="title-label"),
|
||||
Label(f'欢迎使用 "潜进" 启发式先进记忆调度器', classes="title-label"),
|
||||
Label(f"当前的 UNIX 日时间戳: {timer.get_daystamp()}"),
|
||||
Label(f'时区修正: UTC+{config_var.get()["timezone_offset"] / 3600}'),
|
||||
Label("选择待学习或待修改的记忆单元集:", classes="title-label"),
|
||||
|
||||
0
src/heurams/interface/screens/intelinote.py
Normal file
0
src/heurams/interface/screens/intelinote.py
Normal file
@@ -33,9 +33,11 @@ class MemScreen(Screen):
|
||||
|
||||
def current_widget(self):
|
||||
self.fission = Fission(self.procession.current_atom, self.phaser.state)
|
||||
puzzle: pz.BasePuzzle = next(self.fission.generate())
|
||||
print(shim.puzzle2widget[puzzle])
|
||||
return shim.puzzle2widget[puzzle](atom = self.procession.current_atom)
|
||||
puzzle_info = next(self.fission.generate())
|
||||
#print(puzzle_info)
|
||||
#print(shim.puzzle2widget[puzzle_info["puzzle"]])
|
||||
print(puzzle_info)
|
||||
return shim.puzzle2widget[puzzle_info["puzzle"]](atom = self.procession.current_atom, alia = puzzle_info["alia"])
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
@@ -57,9 +59,9 @@ class MemScreen(Screen):
|
||||
|
||||
def action_precache_current(self):
|
||||
"""预缓存当前单元集的音频"""
|
||||
from .precache import PrecachingScreen
|
||||
precache_screen = PrecachingScreen(self.nucleon_file)
|
||||
self.app.push_screen(precache_screen)
|
||||
#from .precache import PrecachingScreen
|
||||
#precache_screen = PrecachingScreen(self.nucleon_file)
|
||||
#self.app.push_screen(precache_screen)
|
||||
|
||||
def action_toggle_dark(self):
|
||||
self.app.action_toggle_dark()
|
||||
|
||||
Reference in New Issue
Block a user