/* * Copyright (c) 2022, Maciej * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace NetworkSettings { class NetworkSettingsWidget : public GUI::SettingsWindow::Tab { C_OBJECT(NetworkSettingsWidget) public: virtual void apply_settings() override; void switch_adapter(DeprecatedString const& adapter); private: NetworkSettingsWidget(); struct NetworkAdapterData { bool enabled = false; bool dhcp = false; DeprecatedString ip_address; int cidr = 0; DeprecatedString default_gateway; }; void on_switch_adapter(DeprecatedString const& adapter); void on_switch_enabled_or_dhcp(); HashMap m_network_adapters; Vector m_adapter_names; NetworkAdapterData* m_current_adapter_data = nullptr; RefPtr m_enabled_checkbox; RefPtr m_dhcp_checkbox; RefPtr m_adapters_combobox; RefPtr m_ip_address_textbox; RefPtr m_cidr_spinbox; RefPtr m_default_gateway_textbox; }; }