mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-12 11:58:33 +00:00
GODT-1714: Add version check between bridge-GUI and bridge
GODT-1714: link the update check mecanism [skip-ci] GODT-1714: bind update check notification [skip-ci] GODT-1714: Send the CheckFinishEvent in defer to be sure it never loop for eternity GODT-1714: simplify the BRIDGE_APP_VERSION configuration [skip-ci] GODT-1714: Fix CheckUpdateAndNotify based on what already exists GODT-1714: Restore LandingPage and ReleaseNotesPage links [skip-ci] Other: Cactch case in CMake where BRIDGE_APP_VERSION is not filled [skip-ci]
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "GRPC/GRPCClient.h"
|
||||
#include "Worker/Overseer.h"
|
||||
#include "EventStreamWorker.h"
|
||||
#include "Version.h"
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
@ -46,6 +47,10 @@ void QMLBackend::init()
|
||||
app().log().info("Connected to backend via gRPC service.");
|
||||
else
|
||||
throw Exception(QString("Cannot connectToServer to go backend via gRPC: %1").arg(error));
|
||||
QString bridgeVer;
|
||||
app().grpc().version(bridgeVer);
|
||||
if (bridgeVer != PROJECT_VER)
|
||||
throw Exception(QString("Version Mismatched from Bridge (%1) and Bridge-GUI (%2)").arg(bridgeVer).arg(PROJECT_VER));
|
||||
|
||||
eventStreamOverseer_ = std::make_unique<Overseer>(new EventStreamReader(nullptr), nullptr);
|
||||
eventStreamOverseer_->startWorker(true);
|
||||
@ -98,6 +103,17 @@ void QMLBackend::connectGrpcEvents()
|
||||
connect(client, &GRPCClient::loginAlreadyLoggedIn, this, [&](QString const &userID) {
|
||||
qint32 const index = users_->rowOfUserID(userID); emit loginAlreadyLoggedIn(index); });
|
||||
|
||||
// update events
|
||||
connect(client, &GRPCClient::updateManualError, this, &QMLBackend::updateManualError);
|
||||
connect(client, &GRPCClient::updateForceError, this, &QMLBackend::updateForceError);
|
||||
connect(client, &GRPCClient::updateSilentError, this, &QMLBackend::updateSilentError);
|
||||
connect(client, &GRPCClient::updateManualReady, this, &QMLBackend::updateManualReady);
|
||||
connect(client, &GRPCClient::updateManualRestartNeeded, this, &QMLBackend::updateManualRestartNeeded);
|
||||
connect(client, &GRPCClient::updateForce, this, &QMLBackend::updateForce);
|
||||
connect(client, &GRPCClient::updateSilentRestartNeeded, this, &QMLBackend::updateSilentRestartNeeded);
|
||||
connect(client, &GRPCClient::updateIsLatestVersion, this, &QMLBackend::updateIsLatestVersion);
|
||||
connect(client, &GRPCClient::checkUpdatesFinished, this, &QMLBackend::checkUpdatesFinished);
|
||||
|
||||
// mail settings events
|
||||
connect(client, &GRPCClient::portIssueIMAP, this, &QMLBackend::portIssueIMAP);
|
||||
connect(client, &GRPCClient::portIssueSMTP, this, &QMLBackend::portIssueSMTP);
|
||||
@ -289,11 +305,10 @@ void QMLBackend::toggleAutomaticUpdate(bool active)
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::checkUpdates()
|
||||
{
|
||||
app().log().error(QString("%1() is not implemented.").arg(__FUNCTION__));
|
||||
app().grpc().checkUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user