application.py 833 Bytes
Newer Older
Nico Alt's avatar
Nico Alt committed
1 2 3 4 5 6 7 8
# Copyright (c) 2014-2020 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# Copyright (c) 2020 Nico Alt
# SPDX-License-Identifier: AGPL-3.0-only
# License-Filename: LICENSE.md
#
# Initial version based on GNOME Lollypop
# https://gitlab.gnome.org/World/lollypop/blob/1.2.20/lollypop/application_actions.py

9
from briar_gtk.actions.actions import Actions
Nico Alt's avatar
Nico Alt committed
10 11 12


# pylint: disable=too-few-public-methods
Nico Alt's avatar
Nico Alt committed
13
class ApplicationActions(Actions):
Nico Alt's avatar
Nico Alt committed
14 15 16 17 18

    def __init__(self):
        self._setup_actions()

    def _setup_actions(self):
Nico Alt's avatar
Nico Alt committed
19
        self._setup_quit_action()
Nico Alt's avatar
Nico Alt committed
20

Nico Alt's avatar
Nico Alt committed
21 22 23
    # pylint: disable=no-member
    def _setup_quit_action(self):
        self._setup_action("quit", None, self._quit)
Nico Alt's avatar
Nico Alt committed
24 25 26 27 28
        self.set_accels_for_action("app.quit", ["<Ctrl>q"])

    # pylint: disable=unused-argument
    def _quit(self, action, parameter):
        self.quit()