Inform user about Drone version incompatibility

This commit is contained in:
Srivats P 2017-09-25 21:26:57 +05:30
parent f01bdd257f
commit a2b349e5b7
2 changed files with 14 additions and 1 deletions

View File

@ -200,6 +200,19 @@ void PortGroup::processVersionCompatibility(PbRpcController *controller)
qPrintable(QString::fromStdString(verCompat->notes()))); qPrintable(QString::fromStdString(verCompat->notes())));
compat = kIncompatible; compat = kIncompatible;
emit portGroupDataChanged(mPortGroupId); emit portGroupDataChanged(mPortGroupId);
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setTextFormat(Qt::RichText);
msgBox.setStyleSheet("messagebox-text-interaction-flags: 5");
msgBox.setText(tr("The Drone agent at %1:%2 is incompatible with this "
"Ostinato version - %3")
.arg(serverName())
.arg(int(serverPort()))
.arg(version));
msgBox.setInformativeText(QString::fromStdString(verCompat->notes()));
msgBox.exec();
goto _error_exit; goto _error_exit;
} }

View File

@ -590,7 +590,7 @@ void MyService::checkVersion(::google::protobuf::RpcController* controller,
} }
else { else {
response->set_result(OstProto::VersionCompatibility::kIncompatible); response->set_result(OstProto::VersionCompatibility::kIncompatible);
response->set_notes(QString("Drone needs client version %1.%2.x") response->set_notes(QString("Drone needs controller version %1.%2.x")
.arg(my[0], my[1]).toStdString()); .arg(my[0], my[1]).toStdString());
static_cast<PbRpcController*>(controller)->TriggerDisconnect(); static_cast<PbRpcController*>(controller)->TriggerDisconnect();
} }