mirror-chatterino2/src/application.cpp

54 lines
1.2 KiB
C++
Raw Normal View History

#include "application.hpp"
#include "logging/loggingmanager.hpp"
2017-12-31 00:50:07 +01:00
#include "singletons/accountmanager.hpp"
#include "singletons/emotemanager.hpp"
#include "singletons/settingsmanager.hpp"
#include "singletons/thememanager.hpp"
#include "singletons/windowmanager.hpp"
namespace chatterino {
// this class is responsible for handling the workflow of Chatterino
// It will create the instances of the major classes, and connect their signals to each other
Application::Application()
{
logging::init();
SettingsManager::getInstance().load();
2017-12-31 00:50:07 +01:00
WindowManager::getInstance().initMainWindow();
2017-12-14 00:25:06 +01:00
// Initialize everything we need
2017-12-17 02:18:13 +01:00
EmoteManager::getInstance().loadGlobalEmotes();
AccountManager::getInstance().load();
// XXX
SettingsManager::getInstance().updateWordTypeMask();
}
Application::~Application()
{
this->save();
chatterino::SettingsManager::getInstance().save();
}
int Application::run(QApplication &qtApp)
{
// Start connecting to the IRC Servers (Twitch only for now)
2017-12-31 00:50:07 +01:00
IrcManager::getInstance().connect();
// Show main window
2017-12-31 00:50:07 +01:00
WindowManager::getInstance().getMainWindow().show();
return qtApp.exec();
}
void Application::save()
{
2017-12-31 00:50:07 +01:00
WindowManager::getInstance().save();
}
} // namespace chatterino