File tree 15 files changed +106
-11
lines changed
15 files changed +106
-11
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,14 @@ msgstr ""
60
60
msgid "Half Shape is enabled."
61
61
msgstr ""
62
62
63
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
63
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
64
64
msgid "Latin Mode"
65
65
msgstr ""
66
66
67
+ #: src/rimeengine.cpp:858
68
+ msgid "Next Schema"
69
+ msgstr ""
70
+
67
71
#: src/rimeengine.h:77
68
72
msgid "Load available plugins automatically"
69
73
msgstr ""
Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ msgstr ""
59
59
msgid "Half Shape is enabled."
60
60
msgstr ""
61
61
62
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
62
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
63
63
msgid "Latin Mode"
64
64
msgstr "Latinsk tilstand"
65
65
66
+ #: src/rimeengine.cpp:858
67
+ msgid "Next Schema"
68
+ msgstr ""
69
+
66
70
#: src/rimeengine.h:77
67
71
msgid "Load available plugins automatically"
68
72
msgstr ""
Original file line number Diff line number Diff line change @@ -61,10 +61,14 @@ msgstr ""
61
61
msgid "Half Shape is enabled."
62
62
msgstr ""
63
63
64
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
64
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
65
65
msgid "Latin Mode"
66
66
msgstr "Lateinischer Modus"
67
67
68
+ #: src/rimeengine.cpp:858
69
+ msgid "Next Schema"
70
+ msgstr ""
71
+
68
72
#: src/rimeengine.h:77
69
73
msgid "Load available plugins automatically"
70
74
msgstr ""
Original file line number Diff line number Diff line change @@ -55,10 +55,14 @@ msgstr ""
55
55
msgid "Half Shape is enabled."
56
56
msgstr ""
57
57
58
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
58
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
59
59
msgid "Latin Mode"
60
60
msgstr ""
61
61
62
+ #: src/rimeengine.cpp:858
63
+ msgid "Next Schema"
64
+ msgstr ""
65
+
62
66
#: src/rimeengine.h:77
63
67
msgid "Load available plugins automatically"
64
68
msgstr ""
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ msgstr ""
65
65
msgid "Latin Mode"
66
66
msgstr ""
67
67
68
+ #: src/rimeengine.cpp:858
69
+ msgid "Next Schema"
70
+ msgstr ""
71
+
68
72
#: src/rimeengine.h:78
69
73
msgid "Load available plugins automatically"
70
74
msgstr ""
Original file line number Diff line number Diff line change @@ -62,10 +62,14 @@ msgstr "全角は有効です。"
62
62
msgid "Half Shape is enabled."
63
63
msgstr "半角は有効です。"
64
64
65
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
65
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
66
66
msgid "Latin Mode"
67
67
msgstr "ラテンモード"
68
68
69
+ #: src/rimeengine.cpp:858
70
+ msgid "Next Schema"
71
+ msgstr ""
72
+
69
73
#: src/rimeengine.h:77
70
74
msgid "Load available plugins automatically"
71
75
msgstr "利用可能なプラグインを自動的にロードする"
Original file line number Diff line number Diff line change @@ -60,10 +60,14 @@ msgstr "전각이 활성화되었습니다."
60
60
msgid "Half Shape is enabled."
61
61
msgstr "반각이 활성화되었습니다."
62
62
63
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
63
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
64
64
msgid "Latin Mode"
65
65
msgstr "로마자 모드"
66
66
67
+ #: src/rimeengine.cpp:858
68
+ msgid "Next Schema"
69
+ msgstr ""
70
+
67
71
#: src/rimeengine.h:77
68
72
msgid "Load available plugins automatically"
69
73
msgstr "사용 가능한 플러그인 자동으로 불러오기"
Original file line number Diff line number Diff line change @@ -63,10 +63,14 @@ msgstr "Полноширинная форма включена."
63
63
msgid "Half Shape is enabled."
64
64
msgstr "Полуширинная форма включена."
65
65
66
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
66
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
67
67
msgid "Latin Mode"
68
68
msgstr "Режим Латиницы"
69
69
70
+ #: src/rimeengine.cpp:858
71
+ msgid "Next Schema"
72
+ msgstr ""
73
+
70
74
#: src/rimeengine.h:77
71
75
msgid "Load available plugins automatically"
72
76
msgstr "Автоматически загружать доступные плагины"
Original file line number Diff line number Diff line change @@ -60,10 +60,14 @@ msgstr ""
60
60
msgid "Half Shape is enabled."
61
61
msgstr ""
62
62
63
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
63
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
64
64
msgid "Latin Mode"
65
65
msgstr "Latin Modu"
66
66
67
+ #: src/rimeengine.cpp:858
68
+ msgid "Next Schema"
69
+ msgstr ""
70
+
67
71
#: src/rimeengine.h:77
68
72
msgid "Load available plugins automatically"
69
73
msgstr "Kullanılabilir eklentileri otomatikmen yükle"
Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ msgstr ""
59
59
msgid "Half Shape is enabled."
60
60
msgstr ""
61
61
62
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
62
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
63
63
msgid "Latin Mode"
64
64
msgstr ""
65
65
66
+ #: src/rimeengine.cpp:858
67
+ msgid "Next Schema"
68
+ msgstr ""
69
+
66
70
#: src/rimeengine.h:77
67
71
msgid "Load available plugins automatically"
68
72
msgstr ""
Original file line number Diff line number Diff line change @@ -61,10 +61,14 @@ msgstr "已启用全角字符。 "
61
61
msgid "Half Shape is enabled."
62
62
msgstr "已启用半角字符。"
63
63
64
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
64
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
65
65
msgid "Latin Mode"
66
66
msgstr "英文模式"
67
67
68
+ #: src/rimeengine.cpp:858
69
+ msgid "Next Schema"
70
+ msgstr "下一个方案"
71
+
68
72
#: src/rimeengine.h:77
69
73
msgid "Load available plugins automatically"
70
74
msgstr "自动加载可用插件"
Original file line number Diff line number Diff line change @@ -65,10 +65,14 @@ msgstr "已啟用全形字符。"
65
65
msgid "Half Shape is enabled."
66
66
msgstr "已啟用半形字符。"
67
67
68
- #: src/rimestate.cpp:67 src/rimeengine.cpp:822
68
+ #: src/rimestate.cpp:67 src/rimeengine.cpp:828
69
69
msgid "Latin Mode"
70
70
msgstr "羅馬拼音模式"
71
71
72
+ #: src/rimeengine.cpp:858
73
+ msgid "Next Schema"
74
+ msgstr "下一个方案"
75
+
72
76
#: src/rimeengine.h:77
73
77
msgid "Load available plugins automatically"
74
78
msgstr "自動載入可用插件"
Original file line number Diff line number Diff line change @@ -852,6 +852,19 @@ void RimeEngine::updateSchemaMenu() {
852
852
schemas_.insert (schemaId);
853
853
}
854
854
api_->free_schema_list (&list);
855
+
856
+ schemActions_.emplace_back ();
857
+ auto &schemaAction = schemActions_.back ();
858
+ schemaAction.setShortText (_ (" Next Schema" ));
859
+ schemaAction.connect <SimpleAction::Activated>(
860
+ [this ](InputContext *ic) {
861
+ auto state = ic->propertyFor (&factory_);
862
+ blockNotificationFor (30000 );
863
+ state->switchNextSchema ();
864
+ imAction_->update (ic);
865
+ });
866
+ instance_->userInterfaceManager ().registerAction (&schemaAction);
867
+ schemaMenu_.insertAction (&separatorAction_, &schemaAction);
855
868
}
856
869
}
857
870
Original file line number Diff line number Diff line change @@ -120,6 +120,39 @@ void RimeState::selectSchema(const std::string &schema) {
120
120
api->select_schema (session (), schema.data ());
121
121
}
122
122
123
+ void RimeState::switchNextSchema () {
124
+ std::string currentSchemaId;
125
+ std::string targetSchemaId;
126
+ const auto & schemas = engine_->schemas ();
127
+ auto api = engine_->api ();
128
+ if (api->is_maintenance_mode ()) {
129
+ return ;
130
+ }
131
+ getStatus ([¤tSchemaId](const RimeStatus &status) {
132
+ currentSchemaId = status.schema_id ? status.schema_id : " " ;
133
+ });
134
+ if (currentSchemaId.empty ()) {
135
+ return ;
136
+ }
137
+ targetSchemaId = *schemas.begin ();
138
+ if (schemas.count (currentSchemaId)) {
139
+ auto it = schemas.find (currentSchemaId);
140
+ if (it != schemas.end ()) {
141
+ ++it;
142
+ if (it != schemas.end ()) {
143
+ targetSchemaId = *it;
144
+ }
145
+ }
146
+ }
147
+ if (targetSchemaId.empty ()) {
148
+ return ;
149
+ }
150
+ engine_->blockNotificationFor (30000 );
151
+ api->set_option (session (), RIME_ASCII_MODE, false );
152
+ api->select_schema (session (), targetSchemaId.data ());
153
+ return ;
154
+ }
155
+
123
156
void RimeState::keyEvent (KeyEvent &event) {
124
157
auto api = engine_->api ();
125
158
if (api->is_maintenance_mode ()) {
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class RimeState : public InputContextProperty {
39
39
std::string subModeLabel ();
40
40
void toggleLatinMode ();
41
41
void setLatinMode (bool latin);
42
+ void switchNextSchema ();
42
43
void selectSchema (const std::string &schemaId);
43
44
RimeSessionId session (bool requestNewSession = true );
44
45
You can’t perform that action at this time.
0 commit comments