MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / disable_controls

Method disable_controls

src/ui/ConnectionSettingsDialog.cpp:51–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void ConnectionSettingsDialog::disable_controls() {
52 bool proxy_is_used = Button_GetCheck(m_use_proxy);
53 auto show = proxy_is_used ? TRUE : FALSE;
54 EnableWindow(m_proxy_anonymous, show);
55 EnableWindow(m_user_name, show);
56 EnableWindow(m_host_name, show);
57 EnableWindow(m_password, show);
58 EnableWindow(m_port, show);
59 m_proxy_type_cmb.set_enabled(proxy_is_used);
60
61 if (proxy_is_used) {
62 auto login_used = Button_GetCheck(m_proxy_anonymous) ? FALSE : TRUE;
63 bool anonymous_type =
64 (m_proxy_type_cmb.current_data() == ProxyType::ftp_gateway);
65 if (anonymous_type) {
66 login_used = FALSE;
67 EnableWindow(m_proxy_anonymous, FALSE);
68 }
69 EnableWindow(m_user_name, login_used);
70 EnableWindow(m_password, login_used);
71 }
72}
73
74void ConnectionSettingsDialog::update_controls() {
75 Button_SetCheck(m_use_proxy,

Callers

nothing calls this directly

Calls 2

set_enabledMethod · 0.80
current_dataMethod · 0.45

Tested by

no test coverage detected