mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-27 16:16:35 +03:00
committed by
GitHub
parent
108002248c
commit
9d21df8e1b
@@ -7,9 +7,9 @@
|
||||
GuildSettingsBansPane::GuildSettingsBansPane(Snowflake id)
|
||||
: Gtk::Box(Gtk::ORIENTATION_VERTICAL)
|
||||
, GuildID(id)
|
||||
, m_model(Gtk::ListStore::create(m_columns))
|
||||
, m_menu_unban("Unban")
|
||||
, m_menu_copy_id("Copy ID")
|
||||
, m_model(Gtk::ListStore::create(m_columns)) {
|
||||
, m_menu_copy_id("Copy ID") {
|
||||
signal_map().connect(sigc::mem_fun(*this, &GuildSettingsBansPane::OnMap));
|
||||
set_name("guild-bans-pane");
|
||||
set_hexpand(true);
|
||||
|
||||
@@ -7,8 +7,8 @@ GuildSettingsEmojisPane::GuildSettingsEmojisPane(Snowflake guild_id)
|
||||
, GuildID(guild_id)
|
||||
, m_model(Gtk::ListStore::create(m_columns))
|
||||
, m_filter(Gtk::TreeModelFilter::create(m_model))
|
||||
, m_menu_copy_id("Copy ID")
|
||||
, m_menu_delete("Delete")
|
||||
, m_menu_copy_id("Copy ID")
|
||||
, m_menu_copy_emoji_url("Copy Emoji URL")
|
||||
, m_menu_show_emoji("Open in Browser") {
|
||||
signal_map().connect(sigc::mem_fun(*this, &GuildSettingsEmojisPane::OnMap));
|
||||
@@ -31,7 +31,6 @@ GuildSettingsEmojisPane::GuildSettingsEmojisPane(Snowflake guild_id)
|
||||
m_menu.show_all();
|
||||
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
auto &img = Abaddon::Get().GetImageManager();
|
||||
|
||||
discord.signal_guild_emojis_update().connect(sigc::hide<0>(sigc::mem_fun(*this, &GuildSettingsEmojisPane::OnFetchEmojis)));
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
#include <filesystem>
|
||||
|
||||
GuildSettingsInfoPane::GuildSettingsInfoPane(Snowflake id)
|
||||
: GuildID(id)
|
||||
: m_guild_icon_label("Guild icon")
|
||||
, m_guild_name_label("Guild name")
|
||||
, m_guild_icon_label("Guild icon") {
|
||||
, GuildID(id) {
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
const auto guild = *discord.GetGuild(id);
|
||||
const auto self_id = discord.GetUserData().ID;
|
||||
|
||||
@@ -49,7 +49,6 @@ void GuildSettingsInvitesPane::OnMap() {
|
||||
}
|
||||
|
||||
void GuildSettingsInvitesPane::AppendInvite(const InviteData &invite) {
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
auto row = *m_model->append();
|
||||
row[m_columns.m_col_code] = invite.Code;
|
||||
if (invite.Inviter.has_value())
|
||||
@@ -77,7 +76,6 @@ void GuildSettingsInvitesPane::OnInviteFetch(const std::optional<InviteData> &in
|
||||
}
|
||||
|
||||
void GuildSettingsInvitesPane::OnInvitesFetch(const std::vector<InviteData> &invites) {
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
for (const auto &invite : invites)
|
||||
AppendInvite(invite);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
GuildSettingsMembersPane::GuildSettingsMembersPane(Snowflake id)
|
||||
: Gtk::Box(Gtk::ORIENTATION_VERTICAL)
|
||||
, GuildID(id)
|
||||
, m_layout(Gtk::ORIENTATION_HORIZONTAL)
|
||||
, m_member_list(id)
|
||||
, m_member_info(id)
|
||||
, GuildID(id) {
|
||||
, m_member_info(id) {
|
||||
set_name("guild-members-pane");
|
||||
set_hexpand(true);
|
||||
set_vexpand(true);
|
||||
@@ -158,9 +158,9 @@ void GuildSettingsMembersListItem::UpdateColor() {
|
||||
}
|
||||
|
||||
GuildSettingsMembersPaneInfo::GuildSettingsMembersPaneInfo(Snowflake guild_id)
|
||||
: m_box(Gtk::ORIENTATION_VERTICAL)
|
||||
, GuildID(guild_id)
|
||||
, m_roles(guild_id) {
|
||||
: GuildID(guild_id)
|
||||
, m_roles(guild_id)
|
||||
, m_box(Gtk::ORIENTATION_VERTICAL) {
|
||||
get_style_context()->add_class("guild-members-pane-info");
|
||||
|
||||
const auto label = [](Gtk::Label &lbl) {
|
||||
|
||||
@@ -57,8 +57,8 @@ GuildSettingsRolesPaneRoles::GuildSettingsRolesPaneRoles(Snowflake guild_id)
|
||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||
const auto num_rows = m_list.get_children().size();
|
||||
const auto new_pos = num_rows - new_index - 1;
|
||||
if (row->RoleID == GuildID) return true; // moving role @everyone
|
||||
if (new_index == num_rows) return true; // trying to move row below @everyone
|
||||
if (row->RoleID == GuildID) return true; // moving role @everyone
|
||||
if (static_cast<size_t>(new_index) == num_rows) return true; // trying to move row below @everyone
|
||||
// make sure it wont modify a neighbor role u dont have perms to modify
|
||||
if (!discord.CanModifyRole(GuildID, row->RoleID)) return false;
|
||||
const auto cb = [this](DiscordError code) {
|
||||
|
||||
Reference in New Issue
Block a user