ui.py

Sat, 20 Jan 2018 15:55:09 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 20 Jan 2018 15:55:09 +0000
changeset 9
aa121291eb0e
parent 1
4cdc9c1f6b28
child 10
76dbfb06eba0
permissions
-rw-r--r--

Rumps/Mac UI stuff is fucked and disables ^C etc.; threading doesn't help

#
# MacOS UI
#

import rumps

class BorgendTray(rumps.App):
    def __init__(self, name, backups):
        menu=[rumps.MenuItem(b.name, callback=self.silly) for b in backups]
        menu = menu + [rumps.MenuItem("Quit...", callback=self.my_quit_button)]
        super().__init__(name, menu=menu, quit_button=None)

    def my_quit_button(self, _):
        rumps.quit_application()

    def silly(self, sender):
        sender.state=not sender.state

mercurial