From f25d6b278d6a91e8a1d588c87e59e620db322e9e Mon Sep 17 00:00:00 2001 From: Raul Rodrigo Segura Date: Thu, 21 Jun 2018 13:21:48 +0200 Subject: [PATCH] add support onLeave and onActivate to pythonqt plugins --- .../viewpages/PythonQtViewStep.cpp | 18 ++++++++++++++++++ .../viewpages/PythonQtViewStep.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/libcalamaresui/viewpages/PythonQtViewStep.cpp b/src/libcalamaresui/viewpages/PythonQtViewStep.cpp index 4915fe120..2d128d1af 100644 --- a/src/libcalamaresui/viewpages/PythonQtViewStep.cpp +++ b/src/libcalamaresui/viewpages/PythonQtViewStep.cpp @@ -159,6 +159,24 @@ PythonQtViewStep::isAtEnd() const "is_at_end" } ).toBool(); } +void +PythonQtViewStep::onActivate() +{ + CalamaresUtils::lookupAndCall( m_obj, + { "onActivate", + "onactivate", + "on_activate" }); +} + +void +PythonQtViewStep::onLeave() +{ + CalamaresUtils::lookupAndCall( m_obj, + { "onLeave", + "onleave", + "on_leave" }); +} + JobList PythonQtViewStep::jobs() const diff --git a/src/libcalamaresui/viewpages/PythonQtViewStep.h b/src/libcalamaresui/viewpages/PythonQtViewStep.h index 79862204a..b6b7c193b 100644 --- a/src/libcalamaresui/viewpages/PythonQtViewStep.h +++ b/src/libcalamaresui/viewpages/PythonQtViewStep.h @@ -39,6 +39,8 @@ public: void next() override; void back() override; + void onLeave() override; + void onActivate() override; bool isNextEnabled() const override; bool isBackEnabled() const override;