backlightindicator.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:backlight-indicator 作者: atareao 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号