Beispiel #1
0
    def _nec_notification(self, obj):
        if obj.do_popup:
            if obj.popup_image:
                icon_path = gtkgui_helpers.get_icon_path(obj.popup_image, 48)
                if icon_path:
                    image_path = icon_path
            elif obj.popup_image_path:
                image_path = obj.popup_image_path
            else:
                image_path = ''
            popup(obj.popup_event_type,
                  obj.jid,
                  obj.conn.name,
                  obj.popup_msg_type,
                  path_to_image=image_path,
                  title=obj.popup_title,
                  text=obj.popup_text,
                  timeout=obj.popup_timeout)

        if obj.do_sound:
            if obj.sound_file:
                helpers.play_sound_file(obj.sound_file)
            elif obj.sound_event:
                helpers.play_sound(obj.sound_event)

        if obj.do_command:
            try:
                helpers.exec_command(obj.command, use_shell=True)
            except Exception:
                pass
Beispiel #2
0
    def _nec_notification(self, obj):
        if obj.do_popup:
            icon_name = self._get_icon_name(obj)
            self.popup(obj.popup_event_type, str(obj.jid), obj.conn.name,
                       obj.popup_msg_type, icon_name=icon_name,
                       title=obj.popup_title, text=obj.popup_text,
                       timeout=obj.popup_timeout)

        if obj.do_sound:
            if obj.sound_file:
                helpers.play_sound_file(obj.sound_file)
            elif obj.sound_event:
                helpers.play_sound(obj.sound_event)

        if obj.do_command:
            try:
                helpers.exec_command(obj.command, use_shell=True)
            except Exception:
                pass
Beispiel #3
0
 def _on_play(self, *args):
     model, iter_ = self.sound_tree.get_selection().get_selected()
     snd_event_config_name = model[iter_][3]
     helpers.play_sound(snd_event_config_name)
Beispiel #4
0
 def _on_play(self, *args):
     model, iter_ = self._ui.sounds_treeview.get_selection().get_selected()
     snd_event_config_name = model[iter_][3]
     play_sound(snd_event_config_name)