From 2844eecb65501f7dafa4de15d7377bfb810e1158 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 18 Dec 2024 13:36:52 -0500 Subject: Make IPC opt-in and configurable --- src/tracker_frame.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/tracker_frame.h') diff --git a/src/tracker_frame.h b/src/tracker_frame.h index 9d18dc7..e9fec17 100644 --- a/src/tracker_frame.h +++ b/src/tracker_frame.h @@ -13,10 +13,34 @@ class TrackerPanel; class wxBookCtrlEvent; class wxNotebook; +class ApConnectEvent : public wxEvent { + public: + ApConnectEvent(wxEventType eventType, int winid, std::string server, + std::string user, std::string pass) + : wxEvent(winid, eventType), + ap_server_(std::move(server)), + ap_user_(std::move(user)), + ap_pass_(std::move(pass)) {} + + const std::string &GetServer() const { return ap_server_; } + + const std::string &GetUser() const { return ap_user_; } + + const std::string &GetPass() const { return ap_pass_; } + + virtual wxEvent *Clone() const { return new ApConnectEvent(*this); } + + private: + std::string ap_server_; + std::string ap_user_; + std::string ap_pass_; +}; + wxDECLARE_EVENT(STATE_RESET, wxCommandEvent); wxDECLARE_EVENT(STATE_CHANGED, wxCommandEvent); wxDECLARE_EVENT(STATUS_CHANGED, wxCommandEvent); wxDECLARE_EVENT(REDRAW_POSITION, wxCommandEvent); +wxDECLARE_EVENT(CONNECT_TO_AP, ApConnectEvent); enum UpdateIndicatorsMode { kUPDATE_ALL_INDICATORS = 0, @@ -27,6 +51,7 @@ class TrackerFrame : public wxFrame { public: TrackerFrame(); + void ConnectToAp(std::string server, std::string user, std::string pass); void UpdateStatusMessage(); void ResetIndicators(); @@ -36,7 +61,8 @@ class TrackerFrame : public wxFrame { private: void OnExit(wxCommandEvent &event); void OnAbout(wxCommandEvent &event); - void OnConnect(wxCommandEvent &event); + void OnApConnect(wxCommandEvent &event); + void OnIpcConnect(wxCommandEvent &event); void OnSettings(wxCommandEvent &event); void OnCheckForUpdates(wxCommandEvent &event); void OnZoomIn(wxCommandEvent &event); @@ -48,6 +74,7 @@ class TrackerFrame : public wxFrame { void OnStateChanged(wxCommandEvent &event); void OnStatusChanged(wxCommandEvent &event); void OnRedrawPosition(wxCommandEvent &event); + void OnConnectToAp(ApConnectEvent &event); void CheckForUpdates(bool manual); -- cgit 1.4.1