Skip to content

Commit

Permalink
feat: add notify-mode-change to debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
kanru committed Aug 12, 2024
1 parent 072f807 commit 9eed0c2
Showing 1 changed file with 37 additions and 57 deletions.
94 changes: 37 additions & 57 deletions src/setup/ibus-setup-chewing-about.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,75 +33,56 @@ static char *generate_debug_info(void) {
g_string_append_printf(string, "ibus-chewing: %s\n\n", QUOTE_ME(PRJ_VER));
g_string_append(string, "Compiled against:\n");
g_string_append_printf(string, "- ibus: %s\n", QUOTE_ME(IBUS_VERSION));
g_string_append_printf(string, "- libchewing: %s\n",
QUOTE_ME(CHEWING_VERSION));
g_string_append_printf(string, "- libchewing: %s\n", QUOTE_ME(CHEWING_VERSION));

g_string_append(string, "\nRunning against:\n");
g_string_append_printf(string, "- libchewing: %s\n", chewing_version());

g_string_append(string, "\n");
{
g_autoptr(GSettings) settings =
g_settings_new("org.freedesktop.IBus.Chewing");
g_autoptr(GSettings) settings = g_settings_new("org.freedesktop.IBus.Chewing");
gchar *kb_type = g_settings_get_string(settings, "kb-type");
gchar *sel_keys = g_settings_get_string(settings, "sel-keys");
gchar *chi_eng_mode_toggle =
g_settings_get_string(settings, "chi-eng-mode-toggle");
gchar *sync_caps_lock =
g_settings_get_string(settings, "sync-caps-lock");
gchar *default_english_case =
g_settings_get_string(settings, "default-english-case");
gchar *chi_eng_mode_toggle = g_settings_get_string(settings, "chi-eng-mode-toggle");
gchar *sync_caps_lock = g_settings_get_string(settings, "sync-caps-lock");
gchar *default_english_case = g_settings_get_string(settings, "default-english-case");

g_string_append(string, "Settings:\n");
g_string_append_printf(string, "- kb-type: %s\n", kb_type);
g_string_append_printf(string, "- sel-keys: %s\n", sel_keys);
g_string_append_printf(
string, "- plain-zhuyin: %d\n",
g_settings_get_boolean(settings, "plain-zhuyin"));
g_string_append_printf(
string, "- conversion-engine: %d\n",
g_settings_get_enum(settings, "conversion-engine"));
g_string_append_printf(
string, "- auto-shift-cur: %d\n",
g_settings_get_boolean(settings, "auto-shift-cur"));
g_string_append_printf(
string, "- add-phrase-direction: %d\n",
g_settings_get_boolean(settings, "add-phrase-direction"));
g_string_append_printf(
string, "- clean-buffer-focus-out: %d\n",
g_settings_get_boolean(settings, "clean-buffer-focus-out"));
g_string_append_printf(
string, "- easy-symbol-input: %d\n",
g_settings_get_boolean(settings, "easy-symbol-input"));
g_string_append_printf(
string, "- esc-clean-all-buf: %d\n",
g_settings_get_boolean(settings, "esc-clean-all-buf"));
g_string_append_printf(
string, "- enable-fullwidth-toggle-key: %d\n",
g_settings_get_boolean(settings, "enable-fullwidth-toggle-key"));
g_string_append_printf(
string, "- max-chi-symbol-len: %d\n",
g_settings_get_int(settings, "max-chi-symbol-len"));
g_string_append_printf(string, "- chi-eng-mode-toggle: %s\n",
chi_eng_mode_toggle);
g_string_append_printf(string, "- sync-caps-lock: %s\n",
sync_caps_lock);
g_string_append_printf(string, "- default-english-case: %s\n",
default_english_case);
g_string_append_printf(string, "- plain-zhuyin: %d\n",
g_settings_get_boolean(settings, "plain-zhuyin"));
g_string_append_printf(string, "- conversion-engine: %d\n",
g_settings_get_enum(settings, "conversion-engine"));
g_string_append_printf(string, "- auto-shift-cur: %d\n",
g_settings_get_boolean(settings, "auto-shift-cur"));
g_string_append_printf(string, "- add-phrase-direction: %d\n",
g_settings_get_boolean(settings, "add-phrase-direction"));
g_string_append_printf(string, "- clean-buffer-focus-out: %d\n",
g_settings_get_boolean(settings, "clean-buffer-focus-out"));
g_string_append_printf(string, "- easy-symbol-input: %d\n",
g_settings_get_boolean(settings, "easy-symbol-input"));
g_string_append_printf(string, "- esc-clean-all-buf: %d\n",
g_settings_get_boolean(settings, "esc-clean-all-buf"));
g_string_append_printf(string, "- enable-fullwidth-toggle-key: %d\n",
g_settings_get_boolean(settings, "enable-fullwidth-toggle-key"));
g_string_append_printf(string, "- max-chi-symbol-len: %d\n",
g_settings_get_int(settings, "max-chi-symbol-len"));
g_string_append_printf(string, "- chi-eng-mode-toggle: %s\n", chi_eng_mode_toggle);
g_string_append_printf(string, "- sync-caps-lock: %s\n", sync_caps_lock);
g_string_append_printf(string, "- default-english-case: %s\n", default_english_case);
g_string_append_printf(string, "- cand-per-page: %d\n",
g_settings_get_uint(settings, "cand-per-page"));
g_string_append_printf(
string, "- show-page-number: %d\n",
g_settings_get_boolean(settings, "show-page-number"));
g_string_append_printf(
string, "- phrase-choice-from-last: %d\n",
g_settings_get_boolean(settings, "phrase-choice-from-last"));
g_string_append_printf(
string, "- space-as-selection: %d\n",
g_settings_get_boolean(settings, "space-as-selection"));
g_string_append_printf(
string, "- vertical-lookup-table: %d\n",
g_settings_get_boolean(settings, "vertical-lookup-table"));
g_string_append_printf(string, "- show-page-number: %d\n",
g_settings_get_boolean(settings, "show-page-number"));
g_string_append_printf(string, "- phrase-choice-from-last: %d\n",
g_settings_get_boolean(settings, "phrase-choice-from-last"));
g_string_append_printf(string, "- space-as-selection: %d\n",
g_settings_get_boolean(settings, "space-as-selection"));
g_string_append_printf(string, "- vertical-lookup-table: %d\n",
g_settings_get_boolean(settings, "vertical-lookup-table"));
g_string_append_printf(string, "- notify-mode-change: %d\n",
g_settings_get_boolean(settings, "notify-mode-change"));

g_free(kb_type);
g_free(sel_keys);
Expand All @@ -119,8 +100,7 @@ static char *generate_debug_info(void) {

g_string_append(string, "Environment:\n");
g_string_append_printf(string, "- Desktop: %s\n", desktop);
g_string_append_printf(string, "- Session: %s (%s)\n", session_desktop,
session_type);
g_string_append_printf(string, "- Session: %s (%s)\n", session_desktop, session_type);
g_string_append_printf(string, "- Language: %s\n", lang);
}

Expand Down

0 comments on commit 9eed0c2

Please sign in to comment.