def on_working_menu_item(self, widget):
if self.wid == 0:
self.working_menu_item.set_label(_('Stop'))
self.indicator.set_icon(comun.STATUS_ICON[self.theme][0])
if self.show_notifications:
self.notification.update('Backlight-Indicator',
_('Session starts'),
comun.STATUS_ICON[self.theme][0])
self.do_the_work()
self.wid = GLib.timeout_add_seconds(self.sample_time * 60,
self.do_the_work)
else:
self.working_menu_item.set_label(_('Start'))
self.indicator.set_icon(comun.STATUS_ICON[self.theme][1])
if self.show_notifications:
self.notification.update('Backlight-Indicator',
_('Session stops'),
comun.STATUS_ICON[self.theme][1])
GLib.source_remove(self.wid)
self.wid = 0
if self.show_notifications:
self.notification.show()
评论列表
文章目录