From 459ddce66ae8e1018b78e590f46c18972f0cf03e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Sun, 8 Sep 2019 00:54:35 +0200 Subject: [PATCH] Add documentation --- MenuItemHandler.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/MenuItemHandler.py b/MenuItemHandler.py index 0966f36fb..b678d3042 100644 --- a/MenuItemHandler.py +++ b/MenuItemHandler.py @@ -5,10 +5,29 @@ #You should have received a copy of the GNU Affero General Public License along with this plug-in. If not, see . class MenuItemHandler: + """ + This class handles clicks when the user clicks on the context menu item in + the settings list. + + An instance of this class is passed to the list model in QML's context menu. + """ + def __init__(self, plugin_controller) -> None: + """ + Constructs the menu item handler. + :param plugin_controller: The main Settings Guide class so that we can + open the guide. + """ self._plugin_controller = plugin_controller def sidebarMenuItemOnClickHandler(self, kwargs) -> None: + """ + Triggered when the user clicks the menu item in the context menu in the + settings list. + :param kwargs: Keyword arguments that the QML menu provided. This + function looks for the `key` keyword, which indicates the setting key + that the user clicked on. + """ if "key" in kwargs: article_key = kwargs["key"] self._plugin_controller.startWelcomeGuideAndSelectArticle(article_key) \ No newline at end of file