From 4e4986f6709cfc7f8e4cae734e8579695f3c07b4 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 31 Jul 2022 17:23:00 -0400 Subject: grey out leave button if user owns the guild --- src/components/channels.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/channels.cpp b/src/components/channels.cpp index 0a49701..497c021 100644 --- a/src/components/channels.cpp +++ b/src/components/channels.cpp @@ -911,10 +911,15 @@ void ChannelList::OnGuildSubmenuPopup() { const auto iter = m_model->get_iter(m_path_for_menu); if (!iter) return; const auto id = static_cast((*iter)[m_columns.m_id]); - if (Abaddon::Get().GetDiscordClient().IsGuildMuted(id)) + auto &discord = Abaddon::Get().GetDiscordClient(); + if (discord.IsGuildMuted(id)) m_menu_guild_toggle_mute.set_label("Unmute"); else m_menu_guild_toggle_mute.set_label("Mute"); + + const auto guild = discord.GetGuild(id); + const auto self_id = discord.GetUserData().ID; + m_menu_guild_leave.set_sensitive(!(guild.has_value() && guild->OwnerID == self_id)); } void ChannelList::OnCategorySubmenuPopup() { -- cgit v1.2.3 From a61a630ee675e18f12e8725cca731cbe8aa429ce Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 3 Aug 2022 02:27:43 -0400 Subject: handle null from std::locale::locale (fixes #88) --- src/abaddon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/abaddon.cpp b/src/abaddon.cpp index 2e8ecaa..c849fd6 100644 --- a/src/abaddon.cpp +++ b/src/abaddon.cpp @@ -898,11 +898,15 @@ int main(int argc, char **argv) { char *systemLocale = std::setlocale(LC_ALL, ""); try { - std::locale::global(std::locale(systemLocale)); + if (systemLocale != nullptr) { + std::locale::global(std::locale(systemLocale)); + } } catch (...) { try { std::locale::global(std::locale::classic()); - std::setlocale(LC_ALL, systemLocale); + if (systemLocale != nullptr) { + std::setlocale(LC_ALL, systemLocale); + } } catch (...) {} } -- cgit v1.2.3 From 319f9c392c008b4474b88ba3757105892b0e3020 Mon Sep 17 00:00:00 2001 From: dragontamer8740 Date: Fri, 5 Aug 2022 00:22:59 -0400 Subject: fixed text input box to not resize when typing (#89) --- src/components/chatinput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index c3eca32..3e1db15 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -5,7 +5,7 @@ ChatInput::ChatInput() { set_propagate_natural_height(true); set_min_content_height(20); set_max_content_height(250); - set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + set_policy(Gtk::POLICY_EXTERNAL, Gtk::POLICY_AUTOMATIC); // hack auto cb = [this](GdkEventKey *e) -> bool { -- cgit v1.2.3 From d99d8443ee8cd06caee2e1daa7c0efa93085c200 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 6 Aug 2022 02:23:08 -0400 Subject: dont override expansion state because of active channel --- src/abaddon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abaddon.cpp b/src/abaddon.cpp index c849fd6..14e43af 100644 --- a/src/abaddon.cpp +++ b/src/abaddon.cpp @@ -543,7 +543,7 @@ void Abaddon::LoadState() { #ifdef WITH_LIBHANDY m_main_window->GetChatWindow()->UseTabsState(state.Tabs); #endif - ActionChannelOpened(state.ActiveChannel); + ActionChannelOpened(state.ActiveChannel, false); } catch (const std::exception &e) { printf("failed to load application state: %s\n", e.what()); } -- cgit v1.2.3