add active chat to main window title

This commit is contained in:
ouwou 2020-09-03 02:32:28 -04:00
parent 2fab0c3e0d
commit 5e8489d219
2 changed files with 6 additions and 1 deletions

View File

@ -32,7 +32,7 @@ int Abaddon::StartGTK() {
m_main_window = std::make_unique<MainWindow>();
m_main_window->SetAbaddon(this);
m_main_window->set_title("Abaddon");
m_main_window->set_title(APP_TITLE);
m_main_window->show();
m_main_window->UpdateComponents();
@ -106,6 +106,7 @@ void Abaddon::ActionConnect() {
void Abaddon::ActionDisconnect() {
if (m_discord.IsStarted())
StopDiscord();
m_main_window->set_title(APP_TITLE);
m_main_window->UpdateComponents();
}
@ -167,6 +168,8 @@ void Abaddon::ActionCopyGuildID(Snowflake id) {
}
void Abaddon::ActionListChannelItemClick(Snowflake id) {
auto *channel = m_discord.GetChannel(id);
m_main_window->set_title(std::string(APP_TITLE) + " - #" + channel->Name);
m_main_window->UpdateChatActiveChannel(id);
if (m_channels_requested.find(id) == m_channels_requested.end()) {
m_discord.FetchMessagesInChannel(id, [this, id](const std::vector<MessageData> &msgs) {

View File

@ -7,6 +7,8 @@
#include "windows/mainwindow.hpp"
#include "settings.hpp"
#define APP_TITLE "Abaddon"
class Abaddon {
public:
Abaddon();