actions.py 369 Bytes
Newer Older
Nico Alt's avatar
Nico Alt committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Copyright (c) 2020 Nico Alt
# SPDX-License-Identifier: AGPL-3.0-only
# License-Filename: LICENSE.md

from gi.repository import Gio


class Actions:

    # pylint: disable=no-member
    def _setup_action(self, key, parameter, callback):
        action = Gio.SimpleAction.new(key, parameter)
        action.connect("activate", callback)
        self.add_action(action)