2017-01-15 16:38:30 +01:00
|
|
|
#ifndef WINDOWS_H
|
|
|
|
#define WINDOWS_H
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
#include "widgets/mainwindow.h"
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
#include <QMutex>
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
class Windows
|
|
|
|
{
|
|
|
|
public:
|
2017-01-16 15:06:12 +01:00
|
|
|
static void layoutVisibleChatWidgets(Channel *channel = NULL);
|
|
|
|
static void repaintVisibleChatWidgets(Channel *channel = NULL);
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-01-18 21:52:36 +01:00
|
|
|
static widgets::MainWindow &
|
2017-01-18 04:33:30 +01:00
|
|
|
getMainWindow()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2017-01-18 04:33:30 +01:00
|
|
|
windowMutex.lock();
|
|
|
|
if (mainWindow == NULL) {
|
2017-01-18 21:52:36 +01:00
|
|
|
mainWindow = new widgets::MainWindow();
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
2017-01-18 04:33:30 +01:00
|
|
|
windowMutex.unlock();
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
return *mainWindow;
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
2017-01-26 21:04:01 +01:00
|
|
|
static void load();
|
|
|
|
static void save();
|
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
private:
|
|
|
|
Windows()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
static QMutex windowMutex;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-01-18 21:52:36 +01:00
|
|
|
static widgets::MainWindow *mainWindow;
|
2017-01-15 16:38:30 +01:00
|
|
|
};
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
#endif // WINDOWS_H
|