| 86 | } |
| 87 | |
| 88 | void SimpleSettingsTab::apply_settings(Settings &settings, const SpellerContainer &speller_container) { |
| 89 | int lang_count = m_language_cmb.count(); |
| 90 | int cur_sel = m_language_cmb.current_index(); |
| 91 | |
| 92 | if (m_language_cmb.is_enabled()) { |
| 93 | std::wstring new_lang = (cur_sel == lang_count - 1 ? multiple_language_alias : speller_container.get_available_languages()[cur_sel].orig_name.c_str()); |
| 94 | settings.get_active_language() = new_lang; |
| 95 | m_parent.m_selected_language_name = new_lang; |
| 96 | } |
| 97 | settings.data.suggestion_count = (_wtoi(WinApi::get_edit_text(m_h_suggestions_num).c_str())); |
| 98 | switch (settings.data.active_speller_lib_id) { |
| 99 | case SpellerId::aspell: |
| 100 | settings.data.aspell_dll_path = WinApi::get_edit_text(m_h_lib_path); |
| 101 | break; |
| 102 | case SpellerId::hunspell: |
| 103 | settings.data.hunspell_user_path = WinApi::get_edit_text(m_h_lib_path); |
| 104 | settings.data.hunspell_system_path = WinApi::get_edit_text(m_h_system_path); |
| 105 | break; |
| 106 | case SpellerId::native: |
| 107 | break; |
| 108 | case SpellerId::COUNT: |
| 109 | break; |
| 110 | default: ; |
| 111 | } |
| 112 | |
| 113 | settings.data.check_those = Button_GetCheck(m_h_check_only_those) == BST_CHECKED; |
| 114 | settings.data.file_types = WinApi::get_edit_text(m_h_file_types); |
| 115 | settings.data.suggestions_mode = m_suggestion_mode_cmb.current_data(); |
| 116 | settings.data.check_comments = Button_GetCheck(m_h_check_comments) == BST_CHECKED; |
| 117 | settings.data.check_strings = Button_GetCheck(m_h_check_strings) == BST_CHECKED; |
| 118 | settings.data.check_variable_functions = Button_GetCheck(m_h_check_varfunc) == BST_CHECKED; |
| 119 | settings.data.use_unified_dictionary = Button_GetCheck(m_h_one_user_dic) == BST_CHECKED; |
| 120 | settings.data.select_word_on_context_menu_click = Button_GetCheck(m_h_select_misspelled_on_menu_cb) == BST_CHECKED; |
| 121 | settings.data.language_name_style = m_language_name_style_cmb.current_data(); |
| 122 | } |
| 123 | |
| 124 | void SimpleSettingsTab::fill_lib_info(AspellStatus aspell_status, const Settings &settings) { |
| 125 |
nothing calls this directly
no test coverage detected