summaryrefslogtreecommitdiff
path: root/windows/profilewindow.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-03-17 02:19:15 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-03-17 02:19:15 -0400
commit65943b4bd74ae52e6f6ffbff0e9ba619053172d6 (patch)
tree2dccda0581fab9379bde1586aa1c63079f555099 /windows/profilewindow.cpp
parent72d771d88b625cf29913ab02497aa8f331c247e5 (diff)
downloadabaddon-portaudio-65943b4bd74ae52e6f6ffbff0e9ba619053172d6.tar.gz
abaddon-portaudio-65943b4bd74ae52e6f6ffbff0e9ba619053172d6.zip
reduce concurrent requests in guild settings + profile
disable gtk's treeview search in bans+invites
Diffstat (limited to 'windows/profilewindow.cpp')
-rw-r--r--windows/profilewindow.cpp11
1 files changed, 6 insertions, 5 deletions
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<INotifySwitched *>(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<UserData> &data) {
- m_pane_friends.SetMutualFriends(data);
-}