ui.py

changeset 30
3dd525652dc8
parent 28
a7c56424e867
child 31
b4b4bb7a2ec5
equal deleted inserted replaced
29:9dd2e5d57a7c 30:3dd525652dc8
5 import rumps 5 import rumps
6 import time 6 import time
7 import datetime 7 import datetime
8 import logging 8 import logging
9 from threading import Lock, Timer 9 from threading import Lock, Timer
10 from config import settings
10 import objc 11 import objc
11 12
12 INACTIVE=0 13 INACTIVE=0
13 ACTIVE=1 14 ACTIVE=1
14 OFFLINE=2 15 OFFLINE=2
134 cbm=lambda sender, _b=b: self.__menu_select_backup(sender, _b) 135 cbm=lambda sender, _b=b: self.__menu_select_backup(sender, _b)
135 item=rumps.MenuItem(title, callback=cbm) 136 item=rumps.MenuItem(title, callback=cbm)
136 menu.append(item) 137 menu.append(item)
137 state=combine_state(state, this_state) 138 state=combine_state(state, this_state)
138 139
139 menu_quit=rumps.MenuItem("Quit...", callback=self.my_quit) 140 if not settings['no_quit_menu_entry']:
140 menu.append(menu_quit) 141 menu_quit=rumps.MenuItem("Quit...", callback=self.my_quit)
142 menu.append(menu_quit)
141 143
142 return menu, state 144 return menu, state
143 145
144 def refresh_ui(self): 146 def refresh_ui(self):
145 with self.lock: 147 with self.lock:

mercurial