#include <VpnPage.hpp>
Public Member Functions | |
| VpnPage () | |
| ~VpnPage () override | |
Private Types | |
| enum class | IpSlot { Before , After , Auto } |
Private Member Functions | |
| void | build_ui () |
| Gtk::Widget * | build_tab_connection () |
| Gtk::Widget * | build_tab_config () |
| Gtk::Widget * | build_tab_killswitch () |
| void | append_log (const std::string &line) |
| void | set_busy (bool b) |
| void | refresh_state_ui (const BastionGuard::WgStatus &st) |
| void | on_connect_clicked () |
| void | on_disconnect_clicked () |
| void | on_refresh_ip_clicked () |
| void | refresh_public_ip (IpSlot slot) |
| void | on_generate_keys_clicked () |
| void | on_generate_config_clicked () |
| void | on_browse_clicked () |
| void | on_import_clicked () |
| void | on_killswitch_toggled () |
| void | run_async (std::function< BastionGuard::OpResult()> work, std::function< void(BastionGuard::OpResult)> done) |
| bool | on_poll_status () |
Static Private Member Functions | |
| static Gtk::Box * | labeled_row (const std::string &label, Gtk::Widget &field) |
Private Attributes | |
| Gtk::Label | lbl_title_ |
| Gtk::Label | lbl_subtitle_ |
| Gtk::Notebook | notebook_ |
| Gtk::Box | tab_conn_ {Gtk::Orientation::VERTICAL, 12} |
| Gtk::Button | btn_connect_ |
| Gtk::Button | btn_disconnect_ |
| Gtk::Label | lbl_state_ |
| Gtk::Label | lbl_endpoint_ |
| Gtk::Spinner | spinner_ |
| Gtk::Label | lbl_ip_before_ |
| Gtk::Label | lbl_ip_after_ |
| Gtk::Button | btn_refresh_ip_ |
| Gtk::Box | tab_config_ {Gtk::Orientation::VERTICAL, 10} |
| Gtk::Entry | entry_client_priv_ |
| Gtk::Entry | entry_client_pub_ |
| Gtk::Button | btn_gen_keys_ |
| Gtk::Entry | entry_server_pub_ |
| Gtk::Entry | entry_endpoint_ |
| Gtk::Entry | entry_address_ |
| Gtk::Entry | entry_dns_ |
| Gtk::Entry | entry_allowed_ |
| Gtk::Button | btn_generate_ |
| Gtk::Entry | entry_conf_path_ |
| Gtk::Button | btn_browse_ |
| Gtk::Button | btn_import_ |
| Gtk::Box | tab_ks_ {Gtk::Orientation::VERTICAL, 10} |
| Gtk::Switch | switch_ks_ |
| Gtk::ScrolledWindow | log_scroller_ |
| Gtk::TextView | txt_log_ |
| std::unique_ptr< BastionGuard::WireguardBackend > | backend_ |
| std::atomic< bool > | busy_ {false} |
| std::string | ip_before_ |
| sigc::connection | poll_conn_ |
| BastionGuard::AliveFlag | alive_ = BastionGuard::make_alive_flag() |
Definition at line 43 of file VpnPage.hpp.
|
strongprivate |
| VpnPage::VpnPage | ( | ) |
Definition at line 30 of file VpnPage.cpp.
References _, append_log(), backend_, btn_connect_, btn_gen_keys_, btn_generate_, build_ui(), on_poll_status(), on_refresh_ip_clicked(), and poll_conn_.
|
override |
|
private |
Definition at line 292 of file VpnPage.cpp.
References txt_log_.
Referenced by on_connect_clicked(), on_disconnect_clicked(), on_generate_config_clicked(), on_generate_keys_clicked(), on_import_clicked(), on_killswitch_toggled(), refresh_public_ip(), and VpnPage().
|
private |
Definition at line 178 of file VpnPage.cpp.
References _, btn_browse_, btn_gen_keys_, btn_generate_, btn_import_, entry_address_, entry_allowed_, entry_client_priv_, entry_client_pub_, entry_conf_path_, entry_dns_, entry_endpoint_, entry_server_pub_, labeled_row(), on_browse_clicked(), on_generate_config_clicked(), on_generate_keys_clicked(), on_import_clicked(), and tab_config_.
Referenced by build_ui().
|
private |
Definition at line 129 of file VpnPage.cpp.
References _, btn_connect_, btn_disconnect_, btn_refresh_ip_, lbl_endpoint_, lbl_ip_after_, lbl_ip_before_, lbl_state_, on_connect_clicked(), on_disconnect_clicked(), on_refresh_ip_clicked(), spinner_, and tab_conn_.
Referenced by build_ui().
|
private |
Definition at line 262 of file VpnPage.cpp.
References _, on_killswitch_toggled(), switch_ks_, and tab_ks_.
Referenced by build_ui().
|
private |
Definition at line 76 of file VpnPage.cpp.
References _, build_tab_config(), build_tab_connection(), build_tab_killswitch(), lbl_subtitle_, lbl_title_, log_scroller_, notebook_, and txt_log_.
Referenced by VpnPage().
|
staticprivate |
Definition at line 61 of file VpnPage.cpp.
Referenced by build_tab_config().
|
private |
Definition at line 414 of file VpnPage.cpp.
References _, alive_, and entry_conf_path_.
Referenced by build_tab_config().
|
private |
Definition at line 456 of file VpnPage.cpp.
References _, After, alive_, append_log(), backend_, notebook_, refresh_public_ip(), refresh_state_ui(), and run_async().
Referenced by build_tab_connection().
|
private |
Definition at line 489 of file VpnPage.cpp.
References _, append_log(), backend_, lbl_ip_after_, refresh_state_ui(), and run_async().
Referenced by build_tab_connection().
|
private |
Definition at line 391 of file VpnPage.cpp.
References _, BastionGuard::WgConfigParams::address, BastionGuard::WgConfigParams::allowed_ips, append_log(), backend_, BastionGuard::WgConfigParams::dns, BastionGuard::WgConfigParams::endpoint, entry_address_, entry_allowed_, entry_client_priv_, entry_dns_, entry_endpoint_, entry_server_pub_, BastionGuard::WgConfigParams::private_key, and BastionGuard::WgConfigParams::server_public_key.
Referenced by build_tab_config().
|
private |
Definition at line 363 of file VpnPage.cpp.
References _, append_log(), backend_, entry_client_priv_, entry_client_pub_, and run_async().
Referenced by build_tab_config().
|
private |
Definition at line 440 of file VpnPage.cpp.
References _, append_log(), backend_, and entry_conf_path_.
Referenced by build_tab_config().
|
private |
Definition at line 546 of file VpnPage.cpp.
References _, append_log(), backend_, run_async(), and switch_ks_.
Referenced by build_tab_killswitch().
|
private |
Definition at line 570 of file VpnPage.cpp.
References alive_, backend_, busy_, and refresh_state_ui().
Referenced by VpnPage().
|
private |
Definition at line 505 of file VpnPage.cpp.
References Auto, and refresh_public_ip().
Referenced by build_tab_connection(), and VpnPage().
|
private |
Definition at line 509 of file VpnPage.cpp.
References _, After, append_log(), Auto, backend_, Before, ip_before_, lbl_ip_after_, lbl_ip_before_, and run_async().
Referenced by on_connect_clicked(), and on_refresh_ip_clicked().
|
private |
Definition at line 316 of file VpnPage.cpp.
References _, backend_, btn_connect_, btn_disconnect_, busy_, BastionGuard::WgStatus::endpoint, lbl_endpoint_, lbl_state_, and BastionGuard::WgStatus::up.
Referenced by on_connect_clicked(), on_disconnect_clicked(), and on_poll_status().
|
private |
Definition at line 346 of file VpnPage.cpp.
References alive_, and set_busy().
Referenced by on_connect_clicked(), on_disconnect_clicked(), on_generate_keys_clicked(), on_killswitch_toggled(), and refresh_public_ip().
|
private |
Definition at line 300 of file VpnPage.cpp.
References btn_browse_, btn_connect_, btn_disconnect_, btn_gen_keys_, btn_generate_, btn_import_, btn_refresh_ip_, busy_, and spinner_.
Referenced by run_async().
|
private |
Definition at line 126 of file VpnPage.hpp.
Referenced by on_browse_clicked(), on_connect_clicked(), on_poll_status(), run_async(), and ~VpnPage().
|
private |
Definition at line 90 of file VpnPage.hpp.
Referenced by on_connect_clicked(), on_disconnect_clicked(), on_generate_config_clicked(), on_generate_keys_clicked(), on_import_clicked(), on_killswitch_toggled(), on_poll_status(), refresh_public_ip(), refresh_state_ui(), and VpnPage().
|
private |
Definition at line 78 of file VpnPage.hpp.
Referenced by build_tab_config(), and set_busy().
|
private |
Definition at line 57 of file VpnPage.hpp.
Referenced by build_tab_connection(), refresh_state_ui(), set_busy(), and VpnPage().
|
private |
Definition at line 58 of file VpnPage.hpp.
Referenced by build_tab_connection(), refresh_state_ui(), and set_busy().
|
private |
Definition at line 70 of file VpnPage.hpp.
Referenced by build_tab_config(), set_busy(), and VpnPage().
|
private |
Definition at line 76 of file VpnPage.hpp.
Referenced by build_tab_config(), set_busy(), and VpnPage().
|
private |
Definition at line 79 of file VpnPage.hpp.
Referenced by build_tab_config(), and set_busy().
|
private |
Definition at line 64 of file VpnPage.hpp.
Referenced by build_tab_connection(), and set_busy().
|
private |
Definition at line 91 of file VpnPage.hpp.
Referenced by on_poll_status(), refresh_state_ui(), and set_busy().
|
private |
Definition at line 73 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_config_clicked().
|
private |
Definition at line 75 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_config_clicked().
|
private |
Definition at line 68 of file VpnPage.hpp.
Referenced by build_tab_config(), on_generate_config_clicked(), and on_generate_keys_clicked().
|
private |
Definition at line 69 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_keys_clicked().
|
private |
Definition at line 77 of file VpnPage.hpp.
Referenced by build_tab_config(), on_browse_clicked(), and on_import_clicked().
|
private |
Definition at line 74 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_config_clicked().
|
private |
Definition at line 72 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_config_clicked().
|
private |
Definition at line 71 of file VpnPage.hpp.
Referenced by build_tab_config(), and on_generate_config_clicked().
|
private |
Definition at line 92 of file VpnPage.hpp.
Referenced by refresh_public_ip().
|
private |
Definition at line 60 of file VpnPage.hpp.
Referenced by build_tab_connection(), and refresh_state_ui().
|
private |
Definition at line 63 of file VpnPage.hpp.
Referenced by build_tab_connection(), on_disconnect_clicked(), and refresh_public_ip().
|
private |
Definition at line 62 of file VpnPage.hpp.
Referenced by build_tab_connection(), and refresh_public_ip().
|
private |
Definition at line 59 of file VpnPage.hpp.
Referenced by build_tab_connection(), and refresh_state_ui().
|
private |
Definition at line 51 of file VpnPage.hpp.
Referenced by build_ui().
|
private |
Definition at line 50 of file VpnPage.hpp.
Referenced by build_ui().
|
private |
Definition at line 86 of file VpnPage.hpp.
Referenced by build_ui().
|
private |
Definition at line 53 of file VpnPage.hpp.
Referenced by build_ui(), and on_connect_clicked().
|
private |
Definition at line 93 of file VpnPage.hpp.
Referenced by VpnPage(), and ~VpnPage().
|
private |
Definition at line 61 of file VpnPage.hpp.
Referenced by build_tab_connection(), and set_busy().
|
private |
Definition at line 83 of file VpnPage.hpp.
Referenced by build_tab_killswitch(), and on_killswitch_toggled().
|
private |
Definition at line 67 of file VpnPage.hpp.
Referenced by build_tab_config().
|
private |
Definition at line 56 of file VpnPage.hpp.
Referenced by build_tab_connection().
|
private |
Definition at line 82 of file VpnPage.hpp.
Referenced by build_tab_killswitch().
|
private |
Definition at line 87 of file VpnPage.hpp.
Referenced by append_log(), and build_ui().