From 5e244e5cb8d633e83b34a09ef560375931dd6092 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:55:50 -0400 Subject: update connections (#239) --- res/res/crunchyroll.png | Bin 0 -> 44496 bytes res/res/e1e96d89e192de1997f73730db26e94f.png | Bin 0 -> 8262 bytes res/res/ebay.png | Bin 0 -> 9633 bytes res/res/instagram.png | Bin 0 -> 28690 bytes res/res/paypal.png | Bin 0 -> 6928 bytes res/res/playstation.png | Bin 0 -> 6873 bytes res/res/riotgames.png | Bin 0 -> 6245 bytes res/res/tiktok.png | Bin 0 -> 10125 bytes res/res/twitter.png | Bin 3713 -> 5230 bytes src/windows/profile/userinfopane.cpp | 55 ++++++++++++++++++--------- 10 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 res/res/crunchyroll.png create mode 100644 res/res/e1e96d89e192de1997f73730db26e94f.png create mode 100644 res/res/ebay.png create mode 100644 res/res/instagram.png create mode 100644 res/res/paypal.png create mode 100644 res/res/playstation.png create mode 100644 res/res/riotgames.png create mode 100644 res/res/tiktok.png diff --git a/res/res/crunchyroll.png b/res/res/crunchyroll.png new file mode 100644 index 0000000..6cbbaeb Binary files /dev/null and b/res/res/crunchyroll.png differ diff --git a/res/res/e1e96d89e192de1997f73730db26e94f.png b/res/res/e1e96d89e192de1997f73730db26e94f.png new file mode 100644 index 0000000..76fec43 Binary files /dev/null and b/res/res/e1e96d89e192de1997f73730db26e94f.png differ diff --git a/res/res/ebay.png b/res/res/ebay.png new file mode 100644 index 0000000..2710a97 Binary files /dev/null and b/res/res/ebay.png differ diff --git a/res/res/instagram.png b/res/res/instagram.png new file mode 100644 index 0000000..e124966 Binary files /dev/null and b/res/res/instagram.png differ diff --git a/res/res/paypal.png b/res/res/paypal.png new file mode 100644 index 0000000..28718f1 Binary files /dev/null and b/res/res/paypal.png differ diff --git a/res/res/playstation.png b/res/res/playstation.png new file mode 100644 index 0000000..92bc8e1 Binary files /dev/null and b/res/res/playstation.png differ diff --git a/res/res/riotgames.png b/res/res/riotgames.png new file mode 100644 index 0000000..436ec17 Binary files /dev/null and b/res/res/riotgames.png differ diff --git a/res/res/tiktok.png b/res/res/tiktok.png new file mode 100644 index 0000000..7245cf6 Binary files /dev/null and b/res/res/tiktok.png differ diff --git a/res/res/twitter.png b/res/res/twitter.png index 610ae24..24ebc93 100644 Binary files a/res/res/twitter.png and b/res/res/twitter.png differ diff --git a/src/windows/profile/userinfopane.cpp b/src/windows/profile/userinfopane.cpp index 8c1605a..ab4f50f 100644 --- a/src/windows/profile/userinfopane.cpp +++ b/src/windows/profile/userinfopane.cpp @@ -1,6 +1,34 @@ #include "userinfopane.hpp" #include +static std::string GetConnectionURL(const ConnectionData &conn) { + if (conn.Type == "github") { + return "https://github.com/" + conn.Name; + } else if (conn.Type == "steam") { + return "https://steamcommunity.com/profiles/" + conn.ID; + } else if (conn.Type == "twitch") { + return "https://twitch.tv/" + conn.Name; + } else if (conn.Type == "twitter") { + return "https://twitter.com/i/user/" + conn.ID; + } else if (conn.Type == "spotify") { + return "https://open.spotify.com/user/" + conn.ID; + } else if (conn.Type == "reddit") { + return "https://reddit.com/u/" + conn.Name; + } else if (conn.Type == "youtube") { + return "https://www.youtube.com/channel/" + conn.ID; + } else if (conn.Type == "facebook") { + return "https://www.facebook.com/" + conn.ID; + } else if (conn.Type == "ebay") { + return "https://www.ebay.com/usr/" + conn.Name; + } else if (conn.Type == "instagram") { + return "https://www.instagram.com/" + conn.Name; + } else if (conn.Type == "tiktok") { + return "https://www.tiktok.com/@" + conn.Name; + } + + return ""; +} + ConnectionItem::ConnectionItem(const ConnectionData &conn) : m_box(Gtk::ORIENTATION_HORIZONTAL) , m_name(conn.Name) { @@ -8,23 +36,7 @@ ConnectionItem::ConnectionItem(const ConnectionData &conn) try { pixbuf = Gdk::Pixbuf::create_from_file(Abaddon::GetResPath("/" + conn.Type + ".png"), 32, 32); } catch (const Glib::Exception &e) {} - std::string url; - if (conn.Type == "github") - url = "https://github.com/" + conn.Name; - else if (conn.Type == "steam") - url = "https://steamcommunity.com/profiles/" + conn.ID; - else if (conn.Type == "twitch") - url = "https://twitch.tv/" + conn.Name; - else if (conn.Type == "twitter") - url = "https://twitter.com/i/user/" + conn.ID; - else if (conn.Type == "spotify") - url = "https://open.spotify.com/user/" + conn.ID; - else if (conn.Type == "reddit") - url = "https://reddit.com/u/" + conn.Name; - else if (conn.Type == "youtube") - url = "https://www.youtube.com/channel/" + conn.ID; - else if (conn.Type == "facebook") - url = "https://www.facebook.com/" + conn.ID; + std::string url = GetConnectionURL(conn); if (pixbuf) { m_image = Gtk::manage(new Gtk::Image(pixbuf)); m_image->get_style_context()->add_class("profile-connection-image"); @@ -83,17 +95,24 @@ void ConnectionsContainer::SetConnections(const std::vector &con static const std::unordered_set supported_services = { "battlenet", + "ebay", + "epicgames", + "facebook", "github", + "instagram", "leagueoflegends", + "paypal", + "playstation", "reddit", + "riotgames", "skype", "spotify", "steam", + "tiktok", "twitch", "twitter", "xbox", "youtube", - "facebook" }; int i = 0; -- cgit v1.2.3