示例#1
0
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");
    }
}
示例#2
0
文件: kkc.c 项目: fcitx/fcitx-kkc
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));
}
示例#3
0
文件: instance.c 项目: vx13/fcitx
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);
}
示例#4
0
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);
}
示例#5
0
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);
}
示例#6
0
文件: punc.c 项目: adaptee/fcitx
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);
}
示例#7
0
文件: chttrans.c 项目: haobug/fcitx
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);
}