From 5f7069d480022b115bee585724d41ff827f80f2f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 20 Apr 2024 12:36:22 -0400 Subject: Replaced about box --- src/tracker_frame.cpp | 24 +++++++++++++++--------- src/version.h | 12 +++++++----- 2 files changed, 22 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index d64e0d3..8a0c764 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp @@ -1,5 +1,6 @@ #include "tracker_frame.h" +#include #include #include @@ -101,12 +102,14 @@ void TrackerFrame::UpdateIndicators() { } void TrackerFrame::OnAbout(wxCommandEvent &event) { - std::ostringstream message_text; - message_text << "Lingo Archipelago Tracker " << kTrackerVersion - << " by hatkirby"; - - wxMessageBox(message_text.str(), "About lingo-ap-tracker", - wxOK | wxICON_INFORMATION); + wxAboutDialogInfo about_info; + about_info.SetName("Lingo Archipelago Tracker"); + about_info.SetVersion(kTrackerVersion.ToString()); + about_info.AddDeveloper("hatkirby"); + about_info.AddArtist("Brenton Wildes"); + about_info.AddArtist("kinrah"); + + wxAboutBox(about_info); } void TrackerFrame::OnExit(wxCommandEvent &event) { Close(true); } @@ -122,7 +125,8 @@ void TrackerFrame::OnConnect(wxCommandEvent &event) { std::deque new_history; new_history.push_back(GetTrackerConfig().connection_details); - for (const ConnectionDetails& details : GetTrackerConfig().connection_history) { + for (const ConnectionDetails &details : + GetTrackerConfig().connection_history) { if (details != GetTrackerConfig().connection_details) { new_history.push_back(details); } @@ -192,8 +196,10 @@ void TrackerFrame::CheckForUpdates(bool manual) { std::ostringstream message_text; message_text << "There is a newer version of Lingo AP Tracker " "available. You have " - << kTrackerVersion << ", and the latest version is " - << latest_version << ". Would you like to update?"; + << kTrackerVersion.ToString() + << ", and the latest version is " + << latest_version.ToString() + << ". Would you like to update?"; if (wxMessageBox(message_text.str(), "Update available", wxYES_NO) == wxYES) { diff --git a/src/version.h b/src/version.h index 8c567e9..7b9aebc 100644 --- a/src/version.h +++ b/src/version.h @@ -1,7 +1,7 @@ #ifndef VERSION_H_C757E53C #define VERSION_H_C757E53C -#include +#include #include struct Version { @@ -23,6 +23,12 @@ struct Version { } } + std::string ToString() const { + std::ostringstream output; + output << "v" << major << "." << minor << "." << revision; + return output.str(); + } + bool operator<(const Version& rhs) const { return (major < rhs.major) || (major == rhs.major && @@ -31,10 +37,6 @@ struct Version { } }; -std::ostream& operator<<(std::ostream& out, const Version& ver) { - return out << "v" << ver.major << "." << ver.minor << "." << ver.revision; -} - constexpr const Version kTrackerVersion = Version(0, 8, 0); #endif /* end of include guard: VERSION_H_C757E53C */ \ No newline at end of file -- cgit 1.4.1