diff --git a/dnf5daemon-server/callbacks.cpp b/dnf5daemon-server/callbacks.cpp index c9c7d06ebf..e9eeadb778 100644 --- a/dnf5daemon-server/callbacks.cpp +++ b/dnf5daemon-server/callbacks.cpp @@ -125,6 +125,24 @@ sdbus::Signal DbusTransactionCB::create_signal_pkg( } +void DbusTransactionCB::before_begin(int total) { + try { + auto signal = create_signal(dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_BEFORE_BEGIN); + signal << total; + dbus_object->emitSignal(signal); + } catch (...) { + } +} + +void DbusTransactionCB::after_complete(bool success) { + try { + auto signal = create_signal(dnfdaemon::INTERFACE_RPM, dnfdaemon::SIGNAL_TRANSACTION_AFTER_COMPLETE); + signal << success; + dbus_object->emitSignal(signal); + } catch (...) { + } +} + void DbusTransactionCB::install_start(const libdnf5::rpm::TransactionItem & item, uint64_t total) { try { dnfdaemon::RpmTransactionItemActions action; diff --git a/dnf5daemon-server/callbacks.hpp b/dnf5daemon-server/callbacks.hpp index ea7dcc1fa1..e8e1132727 100644 --- a/dnf5daemon-server/callbacks.hpp +++ b/dnf5daemon-server/callbacks.hpp @@ -93,6 +93,10 @@ class DbusTransactionCB : public libdnf5::rpm::TransactionCallbacks, public Dbus explicit DbusTransactionCB(Session & session) : DbusCallback(session) {} virtual ~DbusTransactionCB() = default; + // overall transaction progress + void before_begin(int total) override; + void after_complete(bool success) override; + // transaction preparation void transaction_start(uint64_t total) override; void transaction_progress(uint64_t amount, uint64_t total) override; diff --git a/dnf5daemon-server/dbus.hpp b/dnf5daemon-server/dbus.hpp index 4c514b6e19..ae1ff18baf 100644 --- a/dnf5daemon-server/dbus.hpp +++ b/dnf5daemon-server/dbus.hpp @@ -70,6 +70,8 @@ const char * const SIGNAL_DOWNLOAD_MIRROR_FAILURE = "download_mirror_failure"; const char * const SIGNAL_REPO_KEY_IMPORT_REQUEST = "repo_key_import_request"; +const char * const SIGNAL_TRANSACTION_BEFORE_BEGIN = "transaction_before_begin"; +const char * const SIGNAL_TRANSACTION_AFTER_COMPLETE = "transaction_after_complete"; const char * const SIGNAL_TRANSACTION_TRANSACTION_START = "transaction_transaction_start"; const char * const SIGNAL_TRANSACTION_TRANSACTION_PROGRESS = "transaction_transaction_progress"; const char * const SIGNAL_TRANSACTION_TRANSACTION_STOP = "transaction_transaction_stop";