--- /dev/null
+/*---------------------------------------------------------------------------*\
+ ____ _ _ __ _ __ ___ _ _
+ |_ / || | '_ \ '_ \/ -_) '_|
+ /__|\_, | .__/ .__/\___|_|
+ |__/|_| |_|
+\*---------------------------------------------------------------------------*/
+
+#ifndef ZMART_JOB_CALLBACKS_H
+#define ZMART_JOB_CALLBACKS_H
+
+#include <iostream>
+
+#include <zypp/base/Logger.h>
+#include <zypp/base/String.h>
+#include <zypp/ZYppCallbacks.h>
+
+#include "Zypper.h"
+#include "output/prompt.h"
+
+///////////////////////////////////////////////////////////////////
+namespace ZmartRecipients
+{
+ ///////////////////////////////////////////////////////////////////
+ /// \class JobReportReceiver
+ /// \brief Receive generic notification callbacks
+ ///////////////////////////////////////////////////////////////////
+ struct JobReportReceiver : public callback::ReceiveReport<JobReport>
+ {
+ virtual bool message( MsgType type_r, const std::string & msg_r ) const
+ {
+ Out & out( Zypper::instance()->out() );
+ switch ( type_r.asEnum() )
+ {
+ case MsgType::info:
+ out.info( msg_r );
+ break;
+ case MsgType::warning:
+ out.warning( msg_r );
+ break;
+ case MsgType::error:
+ out.error( msg_r );
+ break;
+ }
+ return true;
+ }
+ };
+} // namespace ZmartRecipients
+///////////////////////////////////////////////////////////////////
+
+class JobCallbacks
+{
+ public:
+ JobCallbacks()
+ {
+ _jobReport.connect();
+ }
+
+ ~JobCallbacks()
+ {
+ _jobReport.disconnect();
+ }
+
+ private:
+ ZmartRecipients::JobReportReceiver _jobReport;
+};
+
+#endif // ZMART_JOB_CALLBACKS_H
#include "callbacks/repo.h"
#include "callbacks/media.h"
#include "callbacks/locks.h"
+#include "callbacks/job.h"
#include "output/OutNormal.h"
#include "utils/messages.h"
static KeyRingCallbacks keyring_callbacks;
static DigestCallbacks digest_callbacks;
static LocksCallbacks locks_callbacks;
+ static JobCallbacks job_callbacks;
}
catch (const zypp::Exception & e)
{