From 65943b4bd74ae52e6f6ffbff0e9ba619053172d6 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 17 Mar 2021 02:19:15 -0400 Subject: reduce concurrent requests in guild settings + profile disable gtk's treeview search in bans+invites --- windows/profilewindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'windows/profilewindow.cpp') diff --git a/windows/profilewindow.cpp b/windows/profilewindow.cpp index 9e8c798..d6ce320 100644 --- a/windows/profilewindow.cpp +++ b/windows/profilewindow.cpp @@ -1,5 +1,6 @@ #include "profilewindow.hpp" #include "../abaddon.hpp" +#include "../components/inotifyswitched.hpp" ProfileWindow::ProfileWindow(Snowflake user_id) : ID(user_id) @@ -13,7 +14,6 @@ ProfileWindow::ProfileWindow(Snowflake user_id) auto user = *discord.GetUser(ID); discord.FetchUserProfile(user_id, sigc::mem_fun(*this, &ProfileWindow::OnFetchProfile)); - discord.FetchUserRelationships(user_id, sigc::mem_fun(*this, &ProfileWindow::OnFetchRelationships)); set_name("user-profile"); set_default_size(450, 375); @@ -72,6 +72,11 @@ ProfileWindow::ProfileWindow(Snowflake user_id) m_switcher.set_halign(Gtk::ALIGN_START); m_switcher.set_hexpand(true); + m_stack.property_visible_child().signal_changed().connect([this]() { + if (auto *w = dynamic_cast(m_stack.property_visible_child().get_value())) + w->on_switched_to(); + }); + m_stack.add(m_pane_info, "info", "User Info"); m_stack.add(m_pane_guilds, "guilds", "Mutual Servers"); m_stack.add(m_pane_friends, "friends", "Mutual Friends"); @@ -127,7 +132,3 @@ void ProfileWindow::OnFetchProfile(const UserProfileData &data) { m_badges.add(*image); } } - -void ProfileWindow::OnFetchRelationships(const std::vector &data) { - m_pane_friends.SetMutualFriends(data); -} -- cgit v1.2.3