2019-03-29 14:54:34 +00:00
|
|
|
#include "ui/squawk.h"
|
|
|
|
#include "core/squawk.h"
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
#include <QtCore/QThread>
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QApplication app(argc, argv);
|
|
|
|
Squawk w;
|
|
|
|
w.show();
|
|
|
|
|
|
|
|
Core::Squawk* squawk = new Core::Squawk();
|
|
|
|
QThread* coreThread = new QThread();
|
|
|
|
squawk->moveToThread(coreThread);
|
|
|
|
|
|
|
|
QObject::connect(coreThread, SIGNAL(finished()), squawk, SLOT(deleteLater()));
|
2019-03-30 20:13:13 +00:00
|
|
|
QObject::connect(coreThread, SIGNAL(started()), squawk, SLOT(start()));
|
|
|
|
|
|
|
|
QObject::connect(&w, SIGNAL(newAccountRequest(const QMap<QString, QVariant>&)), squawk, SLOT(newAccountRequest(const QMap<QString, QVariant>&)));
|
2019-03-31 21:05:09 +00:00
|
|
|
QObject::connect(&w, SIGNAL(connectAccount(const QString&)), squawk, SLOT(connectAccount(const QString&)));
|
|
|
|
QObject::connect(&w, SIGNAL(disconnectAccount(const QString&)), squawk, SLOT(disconnectAccount(const QString&)));
|
2019-03-30 20:13:13 +00:00
|
|
|
|
|
|
|
QObject::connect(squawk, SIGNAL(newAccount(const QMap<QString, QVariant>&)), &w, SLOT(newAccount(const QMap<QString, QVariant>&)));
|
2019-03-31 21:05:09 +00:00
|
|
|
QObject::connect(squawk, SIGNAL(accountConnectionStateChanged(const QString&, int)), &w, SLOT(accountConnectionStateChanged(const QString&, int)));
|
2019-03-30 20:13:13 +00:00
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
//QObject::connect(this, &Controller::operate, worker, &Worker::doWork);
|
|
|
|
//QObject::connect(worker, &Worker::resultReady, this, &Controller::handleResults);
|
|
|
|
coreThread->start();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|
|
|
|
|