forked from Silverfish/proton-bridge
feat(GODT-3121): QML request suggestions.
This commit is contained in:
@ -247,6 +247,22 @@ SPStreamEvent newCertificateInstallFailedEvent() {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] suggestions the suggestions
|
||||
/// \return The event.
|
||||
//****************************************************************************************************************************************************
|
||||
SPStreamEvent newKnowledgeBaseSuggestionsEvent(QList<KnowledgeBaseSuggestion> const& suggestions) {
|
||||
auto event = new grpc::KnowledgeBaseSuggestionsEvent;
|
||||
for (KnowledgeBaseSuggestion const &suggestion: suggestions) {
|
||||
grpc::KnowledgeBaseSuggestion *s = event->add_suggestions();
|
||||
s->set_url(suggestion.url.toStdString());
|
||||
s->set_title(suggestion.title.toStdString());
|
||||
}
|
||||
auto appEvent = new grpc::AppEvent;
|
||||
appEvent->set_allocated_knowledgebasesuggestions(event);
|
||||
return wrapAppEvent(appEvent);
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The event.
|
||||
//****************************************************************************************************************************************************
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
|
||||
#include "bridge.grpc.pb.h"
|
||||
#include "GRPCUtils.h"
|
||||
#include <bridgepp/GRPC/GRPCClient.h>
|
||||
|
||||
|
||||
namespace bridgepp {
|
||||
@ -39,6 +40,7 @@ SPStreamEvent newCertificateInstallSuccessEvent(); ///< Create a new Certificate
|
||||
SPStreamEvent newCertificateInstallCanceledEvent(); ///< Create a new CertificateInstallCanceledEvent event.
|
||||
SPStreamEvent newCertificateInstallFailedEvent(); ///< Create anew CertificateInstallFailedEvent event.
|
||||
SPStreamEvent newShowMainWindowEvent(); ///< Create a new ShowMainWindowEvent event.
|
||||
SPStreamEvent newKnowledgeBaseSuggestionsEvent(QList<KnowledgeBaseSuggestion> const& suggestions); ///< Create a new KnowledgeBaseSuggestions event.
|
||||
|
||||
// Login events
|
||||
SPStreamEvent newLoginError(grpc::LoginErrorType error, QString const &message); ///< Create a new LoginError event.
|
||||
|
||||
@ -571,7 +571,7 @@ grpc::Status GRPCClient::hostname(QString &outHostname) {
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] input The user input to analyze.
|
||||
//****************************************************************************************************************************************************
|
||||
grpc::Status GRPCClient::RequestKnowledgeBaseSuggestions(QString const &input) {
|
||||
grpc::Status GRPCClient::requestKnowledgeBaseSuggestions(QString const &input) {
|
||||
return this->logGRPCCallStatus(this->setString(&Bridge::Stub::RequestKnowledgeBaseSuggestions, input), __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ public: // member functions.
|
||||
grpc::Status releaseNotesPageLink(QUrl &outUrl); ///< Performs the 'releaseNotesPageLink' call.
|
||||
grpc::Status landingPageLink(QUrl &outUrl); ///< Performs the 'landingPageLink' call.
|
||||
grpc::Status hostname(QString &outHostname); ///< Performs the 'Hostname' call.
|
||||
grpc::Status RequestKnowledgeBaseSuggestions(QString const &input); ///< Performs the 'RequestKnowledgeBaseSuggestions' call.
|
||||
grpc::Status requestKnowledgeBaseSuggestions(QString const &input); ///< Performs the 'RequestKnowledgeBaseSuggestions' call.
|
||||
|
||||
signals: // app related signals
|
||||
void internetStatus(bool isOn);
|
||||
|
||||
Reference in New Issue
Block a user