17 template<
typename ZyppContextRef>
22 template<
typename ZyppContextRef>
25 if constexpr ( async() ) {
28 this->
_ctx->sendUserRequest( req );
29 return req->choice ();
31 return _report->askUserToAcceptNoDigest(file);
35 template<
typename ZyppContextRef>
38 if constexpr ( async() ) {
41 this->
_ctx->sendUserRequest( req );
42 return req->choice ();
44 return _report->askUserToAccepUnknownDigest( file, name );
48 template<
typename ZyppContextRef>
51 if constexpr ( async() ) {
54 this->
_ctx->sendUserRequest( req );
55 return req->choice ();
57 return _report->askUserToAcceptWrongDigest( file, requested, found );
61 template<
typename ZyppContextRef>
64 if constexpr ( async() ) {
66 if (keycontext.
empty())
69 _(
"File '%s' is unsigned, continue?")) % file;
73 _(
"File '%s' from repository '%s' is unsigned, continue?"))
78 this->
_ctx->sendUserRequest ( req );
79 return req->choice ();
81 return _report->askUserToAcceptUnsignedFile( file, keycontext );
85 template<
typename ZyppContextRef>
88 if constexpr ( async() ) {
89 auto req = TrustKeyRequest::create(
90 _(
"Do you want to reject the key, trust temporarily, or trust always?"),
91 TrustKeyRequest::KEY_DONT_TRUST,
94 this->
_ctx->sendUserRequest ( req );
97 return _report->askUserToAcceptKey( key, keycontext );
101 template<
typename ZyppContextRef>
104 if constexpr ( async() ) {
105 ERR <<
"Not implemented yet" << std::endl;
108 return _report->askUserToAcceptPackageKey ( key_r, keycontext_r );
112 template<
typename ZyppContextRef>
115 if constexpr ( async() ) {
117 auto req = ShowMessageRequest::create( label, ShowMessageRequest::MType::Info,
VerifyInfoEvent::makeData ( file_r, keyData_r, keycontext) );
118 this->
_ctx->sendUserRequest ( req );
120 return _report->infoVerify( file_r, keyData_r, keycontext );
124 template<
typename ZyppContextRef>
127 if constexpr ( async() ) {
128 const std::string &lbl =
zypp::str::Format(
PL_(
"Received %1% new package signing key from repository \"%2%\":",
129 "Received %1% new package signing keys from repository \"%2%\":",
131 this->
_ctx->sendUserRequest( ShowMessageRequest::create( lbl, ShowMessageRequest::MType::Info,
KeyAutoImportInfoEvent::makeData( keyDataList_r, keySigning_r, keyContext_r) ) );
133 return _report->reportAutoImportKey( keyDataList_r, keySigning_r, keyContext_r );
137 template<
typename ZyppContextRef>
140 if constexpr ( async() ) {
142 if ( keycontext.
empty() )
144 label =
zypp::str::Format(
_(
"Signature verification failed for file '%1%'.") ) % file;
150 label += std::string(
" ") +
_(
"Continue?");
152 this->
_ctx->sendUserRequest ( req );
153 return req->choice ();
155 return _report->askUserToAcceptVerificationFailed( file, key, keycontext );
159 template<
typename ZyppContextRef>
162 if constexpr ( async() ) {
165 if (keycontext.
empty())
168 _(
"File '%s' is signed with an unknown key '%s'. Continue?")) % file %
id;
172 _(
"File '%s' from repository '%s' is signed with an unknown key '%s'. Continue?"))
176 this->
_ctx->sendUserRequest ( req );
177 return req->choice ();
179 return _report->askUserToAcceptUnknownKey( file,
id, keycontext );
183 template<
typename ZyppContextRef>
186 if constexpr ( async() ) {
187 this->
_ctx->sendUserRequest( ShowMessageRequest::create( std::move(msg_r), ShowMessageRequest::MType::Debug, std::move(userData_r) ) );
194 template<
typename ZyppContextRef>
197 if constexpr ( async() ) {
198 this->
_ctx->sendUserRequest( ShowMessageRequest::create( std::move(msg_r), ShowMessageRequest::MType::Info, std::move(userData_r) ) );
205 template<
typename ZyppContextRef>
208 if constexpr ( async() ) {
209 this->
_ctx->sendUserRequest( ShowMessageRequest::create( std::move(msg_r), ShowMessageRequest::MType::Warning, std::move(userData_r) ) );
216 template<
typename ZyppContextRef>
219 if constexpr ( async() ) {
227 template<
typename ZyppContextRef>
230 if constexpr ( async() ) {
231 this->
_ctx->sendUserRequest( ShowMessageRequest::create( std::move(msg_r), ShowMessageRequest::MType::Important, std::move(userData_r) ) );
238 template<
typename ZyppContextRef>
241 if constexpr ( async() ) {
242 this->
_ctx->sendUserRequest( ShowMessageRequest::create( std::move(msg_r), ShowMessageRequest::MType::Data, std::move(userData_r) ) );
static bool error(const std::string &msg_r, const UserData &userData_r=UserData())
send error text
BasicReportHelper(const BasicReportHelper &)=default
String related utilities and Regular expression matching.
static bool warning(const std::string &msg_r, const UserData &userData_r=UserData())
send warning text
std::string asUserString() const
User string: label (alias or name)
KeyTrust
User reply options for the askUserToTrustKey callback.
static bool important(const std::string &msg_r, const UserData &userData_r=UserData())
send important message text
static bool data(const std::string &msg_r, const UserData &userData_r=UserData())
send data message
static bool debug(const std::string &msg_r, const UserData &userData_r=UserData())
send debug message text
const RepoInfo repoInfo() const
bool empty() const
Is the context unknown?
#define PL_(MSG1, MSG2, N)
Typesafe passing of user data via callbacks.
UserData makeData(const zypp::Pathname &p)
static bool info(const std::string &msg_r, const UserData &userData_r=UserData())
send message text