Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostkeeper committed Sep 7, 2019
1 parent 59ca054 commit 459ddce
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions MenuItemHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://gnu.org/licenses/>.

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)

0 comments on commit 459ddce

Please sign in to comment.