Add busy property to controller.
This commit is contained in:
@@ -122,6 +122,7 @@ void Controller::addConnection(Connection* c) {
|
|||||||
c->setLazyLoading(true);
|
c->setLazyLoading(true);
|
||||||
|
|
||||||
connect(c, &Connection::syncDone, this, [=] {
|
connect(c, &Connection::syncDone, this, [=] {
|
||||||
|
setBusy(false);
|
||||||
emit syncDone();
|
emit syncDone();
|
||||||
c->sync(30000);
|
c->sync(30000);
|
||||||
c->saveState();
|
c->saveState();
|
||||||
@@ -130,7 +131,9 @@ void Controller::addConnection(Connection* c) {
|
|||||||
|
|
||||||
using namespace QMatrixClient;
|
using namespace QMatrixClient;
|
||||||
|
|
||||||
c->sync(30000);
|
setBusy(true);
|
||||||
|
|
||||||
|
c->sync();
|
||||||
|
|
||||||
emit connectionAdded(c);
|
emit connectionAdded(c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Controller : public QObject {
|
|||||||
setQuitOnLastWindowClosed NOTIFY quitOnLastWindowClosedChanged)
|
setQuitOnLastWindowClosed NOTIFY quitOnLastWindowClosedChanged)
|
||||||
Q_PROPERTY(Connection* connection READ connection WRITE setConnection NOTIFY
|
Q_PROPERTY(Connection* connection READ connection WRITE setConnection NOTIFY
|
||||||
connectionChanged)
|
connectionChanged)
|
||||||
|
Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Controller(QObject* parent = nullptr);
|
explicit Controller(QObject* parent = nullptr);
|
||||||
@@ -53,6 +54,12 @@ class Controller : public QObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool busy() { return m_busy; }
|
||||||
|
void setBusy(bool busy) {
|
||||||
|
m_busy = busy;
|
||||||
|
emit busyChanged();
|
||||||
|
}
|
||||||
|
|
||||||
Connection* connection() {
|
Connection* connection() {
|
||||||
if (m_connection.isNull())
|
if (m_connection.isNull())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -69,6 +76,7 @@ class Controller : public QObject {
|
|||||||
private:
|
private:
|
||||||
QVector<Connection*> m_connections;
|
QVector<Connection*> m_connections;
|
||||||
QPointer<Connection> m_connection;
|
QPointer<Connection> m_connection;
|
||||||
|
bool m_busy = false;
|
||||||
|
|
||||||
QByteArray loadAccessTokenFromFile(const AccountSettings& account);
|
QByteArray loadAccessTokenFromFile(const AccountSettings& account);
|
||||||
QByteArray loadAccessTokenFromKeyChain(const AccountSettings& account);
|
QByteArray loadAccessTokenFromKeyChain(const AccountSettings& account);
|
||||||
|
|||||||
Reference in New Issue
Block a user