void FcitxRimeUpdateStatus(FcitxRime* rime) { if (rime->api->is_maintenance_mode()) { return; } if (!rime->api->find_session(rime->session_id)) { rime->session_id = rime->api->create_session(); } RIME_STRUCT(RimeStatus, status); if (rime->api->get_status(rime->session_id, &status)) { char* text = ""; if (status.is_disabled) { text = "\xe2\x8c\x9b"; } else if (status.is_ascii_mode) { text = "A"; } else if (status.schema_name && status.schema_name[0] != '.') { text = status.schema_name; } else { text = "中"; } FcitxUISetStatusString(rime->owner, "rime-enzh", text, text); rime->api->free_status(&status); } else { FcitxUISetStatusString(rime->owner, "rime-enzh", "\xe2\x8c\x9b", "\xe2\x8c\x9b"); } }
void FcitxKkcUpdateInputMode(FcitxKkc* kkc) { KkcInputMode mode = kkc_context_get_input_mode(kkc->context); FcitxUISetStatusString(kkc->owner, "kkc-input-mode", _(input_mode_status[mode].label), _(input_mode_status[mode].description)); }
void ToggleRemindState(void* arg) { FcitxInstance* instance = (FcitxInstance*) arg; instance->profile->bUseRemind = !instance->profile->bUseRemind; FcitxUISetStatusString(instance, "remind", instance->profile->bUseRemind ? _("Use remind") : _("No remind"), _("Toggle Remind")); FcitxProfileSave(instance->profile); }
void ToggleChttransState(void* arg) { FcitxChttrans* transState = (FcitxChttrans*) arg; transState->enabled = !transState->enabled; FcitxUISetStatusString(transState->owner, "chttrans", transState->enabled ? _("Convert to Traditional Chinese") : _("Convert to Simplified Chinese"), _("Toggle Simp/Trad Chinese Conversion")); FcitxUIUpdateInputWindow(transState->owner); SaveChttransConfig(transState); }
void ToggleFullWidthState(void* arg) { FcitxFullWidthChar* fwchar = (FcitxFullWidthChar*)arg; FcitxProfile* profile = FcitxInstanceGetProfile(fwchar->owner); profile->bUseFullWidthChar = !profile->bUseFullWidthChar; FcitxUISetStatusString(fwchar->owner, "fullwidth", profile->bUseFullWidthChar ? _("Full width Character") : _("Half width Character"), _("Toggle Half/Full width Character")); FcitxProfileSave(profile); }
void TogglePuncState(void* arg) { FcitxPuncState* puncState = (FcitxPuncState*)arg; FcitxInstance* instance = puncState->owner; FcitxProfile* profile = FcitxInstanceGetProfile(instance); profile->bUseWidePunc = !profile->bUseWidePunc; FcitxUISetStatusString(puncState->owner, "punc", profile->bUseWidePunc ? _("Full width punct") : _("Latin punct"), _("Toggle Full Width Punctuation")); FcitxProfileSave(profile); }
void ToggleChttransState(void* arg) { FcitxChttrans* transState = (FcitxChttrans*) arg; FcitxIM* im = FcitxInstanceGetCurrentIM(transState->owner); if (!im) return; boolean enabled = !ChttransEnabled(transState); fcitx_string_map_set(transState->enableIM, im->uniqueName, enabled); FcitxUISetStatusString(transState->owner, "chttrans", enabled ? _("Traditional Chinese") : _("Simplified Chinese"), _("Toggle Simp/Trad Chinese Conversion")); FcitxUIUpdateInputWindow(transState->owner); SaveChttransConfig(transState); }