bool show() { label(Far::get_msg(MSG_SFX_OPTIONS_DLG_PROFILE)); vector<wstring> profile_names; profile_names.reserve(profiles.size()); for (unsigned i = 0; i < profiles.size(); i++) { profile_names.push_back(profiles[i].name); } profile_names.push_back(wstring()); profile_ctrl_id = combo_box(profile_names, profiles.size(), 30, DIF_DROPDOWNLIST); new_line(); separator(); new_line(); label(Far::get_msg(MSG_SFX_OPTIONS_DLG_MODULE)); vector<wstring> module_names; const SfxModules& sfx_modules = ArcAPI::sfx(); module_names.reserve(sfx_modules.size() + 1); unsigned name_width = 0; for_each(sfx_modules.begin(), sfx_modules.end(), [&] (const SfxModule& sfx_module) { wstring name = sfx_module.description(); module_names.push_back(name); if (name_width < name.size()) name_width = name.size(); }); module_names.push_back(wstring()); module_ctrl_id = combo_box(module_names, sfx_modules.find_by_name(options.name), name_width + 6, DIF_DROPDOWNLIST); new_line(); replace_icon_ctrl_id = check_box(Far::get_msg(MSG_SFX_OPTIONS_DLG_REPLACE_ICON), options.replace_icon); new_line(); spacer(2); label(Far::get_msg(MSG_SFX_OPTIONS_DLG_ICON_PATH)); icon_path_ctrl_id = history_edit_box(options.icon_path, L"arclite.icon_path", AUTO_SIZE, DIF_EDITPATH | DIF_SELECTONENTRY); new_line(); unsigned label_len = 0; vector<wstring> labels; labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_PRODUCT_NAME)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_VERSION)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_COMPANY_NAME)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_FILE_DESCRIPTION)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_COMMENTS)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_VER_INFO_LEGAL_COPYRIGHT)); for (unsigned i = 0; i < labels.size(); i++) if (label_len < labels[i].size()) label_len = labels[i].size(); label_len += 2; vector<wstring>::const_iterator label_text = labels.cbegin(); replace_version_ctrl_id = check_box(Far::get_msg(MSG_SFX_OPTIONS_DLG_REPLACE_VERSION), options.replace_version); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_product_name_ctrl_id = edit_box(options.ver_info.product_name, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_version_ctrl_id = edit_box(options.ver_info.version, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_company_name_ctrl_id = edit_box(options.ver_info.company_name, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_file_description_ctrl_id = edit_box(options.ver_info.file_description, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_comments_ctrl_id = edit_box(options.ver_info.comments, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); ver_info_legal_copyright_ctrl_id = edit_box(options.ver_info.legal_copyright, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); label_len = 0; labels.clear(); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_TITLE)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_BEGIN_PROMPT)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_PROGRESS)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_RUN_PROGRAM)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_DIRECTORY)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_EXECUTE_FILE)); labels.push_back(Far::get_msg(MSG_SFX_OPTIONS_DLG_INSTALL_CONFIG_EXECUTE_PARAMETERS)); for (unsigned i = 0; i < labels.size(); i++) if (label_len < labels[i].size()) label_len = labels[i].size(); label_len += 2; label_text = labels.cbegin(); append_install_config_ctrl_id = check_box(Far::get_msg(MSG_SFX_OPTIONS_DLG_APPEND_INSTALL_CONFIG), options.append_install_config); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_title_ctrl_id = edit_box(options.install_config.title, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_begin_prompt_ctrl_id = edit_box(options.install_config.begin_prompt, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); TriState value; if (options.install_config.progress == L"yes") value = triTrue; else if (options.install_config.progress == L"no") value = triFalse; else value = triUndef; install_config_progress_ctrl_id = check_box3(wstring(), value); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_run_program_ctrl_id = edit_box(options.install_config.run_program, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_directory_ctrl_id = edit_box(options.install_config.directory, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_execute_file_ctrl_id = edit_box(options.install_config.execute_file, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); spacer(2); label(*label_text++); pad(label_len); install_config_execute_parameters_ctrl_id = edit_box(options.install_config.execute_parameters, AUTO_SIZE, DIF_SELECTONENTRY); new_line(); separator(); new_line(); ok_ctrl_id = def_button(Far::get_msg(MSG_BUTTON_OK), DIF_CENTERGROUP); cancel_ctrl_id = button(Far::get_msg(MSG_BUTTON_CANCEL), DIF_CENTERGROUP); new_line(); int item = Far::Dialog::show(); return (item != -1) && (item != cancel_ctrl_id); }
bool show() { use_full_install_ui_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_USE_FULL_INSTALL_UI), options.use_full_install_ui); new_line(); update_stable_builds_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_UPDATE_STABLE_BUILDS), options.update_stable_builds); new_line(); logged_install_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_LOGGED_INSTALL), options.logged_install); new_line(); open_changelog_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_OPEN_CHANGELOG), options.open_changelog); new_line(); label(Far::get_msg(MSG_CONFIG_INSTALL_PROPERTIES)); install_properties_ctrl_id = edit_box(options.install_properties, 30); new_line(); separator(); new_line(); use_proxy_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_USE_PROXY), options.http.use_proxy); new_line(); spacer(2); label(Far::get_msg(MSG_CONFIG_PROXY_SERVER)); proxy_server_ctrl_id = edit_box(options.http.proxy_server, 20); spacer(2); label(Far::get_msg(MSG_CONFIG_PROXY_PORT)); proxy_port_ctrl_id = edit_box(options.http.proxy_port ? int_to_str(options.http.proxy_port) : wstring(), 6); new_line(); spacer(2); label(Far::get_msg(MSG_CONFIG_PROXY_AUTH_SCHEME)); vector<wstring> auth_scheme_list; auth_scheme_list.push_back(Far::get_msg(MSG_CONFIG_PROXY_AUTH_BASIC)); auth_scheme_list.push_back(Far::get_msg(MSG_CONFIG_PROXY_AUTH_NTLM)); auth_scheme_list.push_back(Far::get_msg(MSG_CONFIG_PROXY_AUTH_PASSPORT)); auth_scheme_list.push_back(Far::get_msg(MSG_CONFIG_PROXY_AUTH_DIGEST)); auth_scheme_list.push_back(Far::get_msg(MSG_CONFIG_PROXY_AUTH_NEGOTIATE)); proxy_auth_scheme_ctrl_id = combo_box(auth_scheme_list, options.http.proxy_auth_scheme, AUTO_SIZE, DIF_DROPDOWNLIST); new_line(); spacer(2); label(Far::get_msg(MSG_CONFIG_PROXY_USER_NAME)); proxy_user_name_ctrl_id = edit_box(options.http.proxy_user_name, 15); spacer(2); label(Far::get_msg(MSG_CONFIG_PROXY_PASSWORD)); proxy_password_ctrl_id = edit_box(options.http.proxy_password, 15); new_line(); separator(); new_line(); cache_enabled_ctrl_id = check_box(Far::get_msg(MSG_CONFIG_CACHE_ENABLED), options.cache_enabled); new_line(); spacer(2); label(Far::get_msg(MSG_CONFIG_CACHE_MAX_SIZE)); cache_max_size_ctrl_id = edit_box(int_to_str(options.cache_max_size), 2); new_line(); spacer(2); label(Far::get_msg(MSG_CONFIG_CACHE_DIR)); cache_dir_ctrl_id = edit_box(options.cache_dir, 30); new_line(); separator(); new_line(); ok_ctrl_id = def_button(Far::get_msg(MSG_BUTTON_OK), DIF_CENTERGROUP); cancel_ctrl_id = button(Far::get_msg(MSG_BUTTON_CANCEL), DIF_CENTERGROUP); new_line(); int item = Far::Dialog::show(); return (item != -1) && (item != cancel_ctrl_id); }