-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Option Update Display #447
Conversation
(cherry picked from commit f42b68a6fe10c0ab6663d4a41efc588979f853e9)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me try to simplify the solution.
updating option states is generally inefficient.
Check after anniversary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisiting this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我打算这么改:
option update notifier 不变,继续传有更新的option name。
增加一个API函数让前端查询option name对应的状态及说明文字;查询时访问初始化时拿到的states
配置列表。
enable the frontend to display a message when an arbitrary option defined in the schema is updated. Closes rime#447 the option name eg. ascii_mode is passed to the notification handler function, there, get_state_label gives IME frontend the access to the human readable label for the current state of the option defined in *.schema:/switches/@*/states. when selection is changed in a radio group, more than one option in the group is updated so it only returns a non-empty label while querying the selected option.
enable the frontend to display a message when an arbitrary option defined in the schema is updated. Closes rime#447 the option name eg. ascii_mode is passed to the notification handler function, there, get_state_label gives IME frontend the access to the human readable label for the current state of the option defined in *.schema:/switches/@*/states. when selection is changed in a radio group, more than one option in the group is updated so it only returns a non-empty label while querying the selected option.
enable the frontend to display a message when an arbitrary option defined in the schema is updated. Closes rime#447 the option name eg. ascii_mode is passed to the notification handler function, there, get_state_label gives IME frontend the access to the human readable label for the current state of the option defined in *.schema:/switches/@*/states. when selection is changed in a radio group, more than one option in the group is updated so it only returns a non-empty label while querying the selected option.
做出来了。请过目。 新的接口函数读取状态文字的逻辑是: 按快捷键或者程序自动触发状态改变时会返回方案里定义的文字。 |
創建session和消session可以經常操作嗎,每次查狀態文字的時候創建一次session如何? |
有开销的,只能尽力减小开销。另外还可能丢失状态。 应该区分几个不同的作用域,这个session对应着与一个输入法客户端的连接;比他更小的范围有(加载、切换)输入方案的生命周期;再小是以清空输入串为界的一次输入过程,而有些上下文数据是持续记录的,比如上屏历史、状态等;更小的还有一次按键处理的过程~ |
enable the frontend to display a message when an arbitrary option defined in the schema is updated. Closes #447 the option name eg. ascii_mode is passed to the notification handler function, there, get_state_label gives IME frontend the access to the human readable label for the current state of the option defined in *.schema:/switches/@*/states. when selection is changed in a radio group, more than one option in the group is updated so it only returns a non-empty label while querying the selected option.
Option updates will use the
states
string as display string. Thus users who customize switches can see the proper switch message.Also eliminates localization need.
Known issue: the message will start with a "!", since I couldn't find the source of it, currently I handle it in frontend.