Пример #1
0
 def show_ok_notification(self, title, message, icon, timeout, callback):
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(timeout * 1000)
     n.addAction("Ok", "ok", self.okClicked, callback)
     n.onClose(self.handle_closed)
     n.addAction('Canel', 'canel', self.cancelClicked, callback)
     n.show()
     self.notify_list.append(n)
Пример #2
0
 def show_notification(self, title, message, icon=None, timeout=4):
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.LOW)
     n.setTimeout(int(timeout * 1000))
     n.addAction("action_click", "Show All Messages", self.action_callback)
     n.onClose(self.handle_closed)
     #self._n.add_action('You Clicked The Button', 'Remove Fire', self.OnClicked)
     n.show()
     self.notify_list.append(n)
Пример #3
0
 def show_notification(self, title, message, icon=None, timeout=4):
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.NORMAL)
     n.setTimeout(int(timeout * 1000))
     n.addAction("action_click", "Show All Messages", self.action_callback)
     n.onClose(self.handle_closed)
     n.show()
     self.notify_list.append(n)
     return n
Пример #4
0
 def build_error_notification(self, icon=None):
     n = sys_notify.Notification('', '', icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(0)
     n.addAction("action_click", "Show All Messages", self.action_callback)
     n.onClose(self.handle_closed)
     n.addAction('Clear Messages', 'Clear', self.clearClicked)
     self.notify_list.append(n)
     return n
Пример #5
0
 def build_error_notification(self, icon=None):
     n = sys_notify.Notification('', '', icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(0)
     n.addAction("action_click", "Show Last Five", self.last5_callback)
     n.onClose(self.handle_closed)
     n.addAction('destroy_clicked', 'Clear All', self.destroyClicked)
     n.addAction('close_clicked', 'close', self.closeClicked)
     self.notify_list.append(n)
     return n
Пример #6
0
 def show_yn_notification(self, title, message, icon, timeout, callback):
     self._callback = callback
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(timeout * 1000)
     n.addAction("Yes", "Yes", self.yesClicked, callback)
     n.onClose(self.handle_closed)
     n.addAction('No', 'No', self.noClicked, callback)
     n.show()
     self.notify_list.append(n)
Пример #7
0
 def build_general_notification(self, title='', message='', icon=None, timeout=2):
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.NORMAL)
     n.setTimeout(int(timeout * 1000))
     n.addAction("action_click","Show Last Five", self.last5_callback)
     n.addAction('destroy_click', 'Clear all', self.destroyClicked)
     n.addAction('close_clicked', 'close', self.closeClicked)
     n.onClose(self.handle_closed)
     self.notify_list.append(n)
     return n
Пример #8
0
 def build_hard_limits_notification(self, icon=None, callback=None):
     self._hardLimitsCallback = callback
     n = sys_notify.Notification('', '', icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(0)
     n.addAction("action_click", "Override Limits", self._hardLimitsCallback)
     n.onClose(self.handle_closed)
     n.addAction('close_clicked', 'Close', self.closeClicked)
     self.notify_list.append(n)
     return n
Пример #9
0
 def show_toolchange_notification(self, title, message, icon, timeout, callback, jogpause=False):
     n = sys_notify.Notification(title, message, icon)
     n.setUrgency(sys_notify.Urgency.CRITICAL)
     n.setTimeout(0)
     n.addAction("action_click", "Ok", self.okClicked, callback)
     n.onClose(lambda w:self.okClicked(w, None, callback))
     if jogpause:
         n.addAction('close_clicked', 'jogPause', self.jogPauseClicked)
     n.show()
     self.notify_list.append(n)
     return n