diff --git a/qml/main.qml b/qml/main.qml index 62062fd..1325faf 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -39,6 +39,10 @@ ApplicationWindow { window.requestActivate() } onHideWindow: window.hide() + onErrorOccured: { + errorLabel.text = error + errorDialog.open() + } } AccountListModel { @@ -46,22 +50,15 @@ ApplicationWindow { controller: spectralController } - Popup { - property bool busy: spectralController.busy - + Dialog { x: (window.width - width) / 2 y: (window.height - height) / 2 - id: busyPopup - - modal: true - focus: true - - closePolicy: Popup.NoAutoClose - - BusyIndicator { running: true } - - onBusyChanged: busyPopup.busy ? busyPopup.open() : busyPopup.close() + id: errorDialog + title: "Error" + contentItem: Label { + id: errorLabel + } } Component { diff --git a/src/controller.cpp b/src/controller.cpp index 5d6e884..6f32de9 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -73,6 +73,9 @@ void Controller::loginWithCredentials(QString serverAddr, QString user, account.sync(); addConnection(m_connection); }); + connect(m_connection, &Connection::loginError, [=] (QString error, QByteArray detail) { + emit errorOccured(error); + }); } }