Exemplo n.º 1
0
 def cb_call_action(self, widget, data = None):
   log("Quicklist showing conversation", INFO)
   id = widget.property_get("id")
   action = widget.property_get("action")
   
   if not id in self.calls:
       return
   
   if action == 'HOLD':
       self.calls[id].Hold()
   if action == 'FINISH':
       self.calls[id].Finish()
   if action == 'ANSWER':
       self.calls[id].Answer()
   if action == 'RESUME':
       self.calls[id].Resume()
   if action == 'VIDEOOUT':
       self.calls[id].StartVideoSend()
   if action == 'VIDEOIN':
       self.calls[id].StartVideoReceive()
   if action == 'ENDVIDEOOUT':
       self.calls[id].StopVideoSend()
   if action == 'ENDVIDEOIN':
       self.calls[id].StopVideoReceive()
   if action == 'MUTE':
       self.skype._SetMute(True)
   if action == 'UNMUTE':
       self.skype._SetMute(False)
               
   unitylauncher.createCallsQuickList(self.calls, self.cb_call_action)
   unitylauncher.redrawQuicklist()  
    def new_message(self, conversation):
        if not settings.get_notify_on_messagerecieve(
        ) or self.skype.skype_presence == Skype4Py.cusDoNotDisturb:
            return
        #conversation.skypereturn.Chat.Type == Skype4Py.chatTypeMultiChat and
        if conversation.skypereturn.Chat.Topic:
            group_chat_title = unicode(
                conversation.skypereturn.Sender.FullName + " ► " +
                conversation.skypereturn.Chat.Topic)
        else:
            group_chat_title = unicode(conversation.display_name)

        icon = ""
        if settings.get_display_notification_avatars():
            avatar = SkypeAvatar(conversation.skypereturn.Sender.Handle)
            if avatar.filename:
                icon = '-i "' + avatar.filename + '" '
            else:
                icon = '-i "/usr/share/skype-wrapper/icons/skype-wrapper-48.svg" '

        if helpers.haveUnity():
            unitylauncher.count(
                len(self.indicators) + self.skype.incomingfilecount)
            unitylauncher.createUnreadMessageQuickList(
                self.skype.unread_conversations,
                self.show_conversation_quicklist)
            unitylauncher.redrawQuicklist()
            unitylauncher.count(
                len(self.indicators) + self.skype.incomingfilecount)

        os.system(u'notify-send ' + icon + '"' + group_chat_title + '" "' +
                  conversation.skypereturn.Body + '"')
Exemplo n.º 3
0
  def new_message(self, conversation):
    if not settings.get_notify_on_messagerecieve() or self.skype.skype_presence == Skype4Py.cusDoNotDisturb:
        return
    #conversation.skypereturn.Chat.Type == Skype4Py.chatTypeMultiChat and  
    conversation.display_name = conversation.skypereturn.Chat.Topic or conversation.display_name
    name = conversation.skypereturn.Sender.DisplayName or conversation.skypereturn.Sender.FullName or conversation.skypereturn.Sender.Handle

    if len(conversation.skypereturn.Chat.Members) > 2:
        group_chat_title = unicode(name + " ► " + conversation.display_name)
    else:
        group_chat_title = unicode(conversation.display_name)
        
    icon = ""
    if settings.get_display_notification_avatars():
        avatar = SkypeAvatar(conversation.skypereturn.Sender.Handle)
        if avatar.filename:
            icon = avatar.filename
        else:
            icon = "/usr/share/skype-wrapper/icons/skype-wrapper-48.svg"
    
    if helpers.haveUnity():
        unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
        unitylauncher.createUnreadMessageQuickList(self.skype.unread_conversations, self.show_conversation_quicklist)
        unitylauncher.redrawQuicklist()  
        unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
    
    helpers.notify(group_chat_title, conversation.skypereturn.Body, icon, group_chat_title, False, False, conversation.skypereturn.Chat.Topic)  
 def reset_indicators(self) :
   del self.indicators
   self.indicators = {}
   for _id in self.skype.unread_conversations:
       self.show_indicator(self.skype.unread_conversations[int(_id)])
   unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
   unitylauncher.createUnreadMessageQuickList(self.skype.unread_conversations, self.show_conversation_quicklist)
   unitylauncher.redrawQuicklist()  
   unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
Exemplo n.º 5
0
 def reset_indicators(self) :
   del self.indicators
   self.indicators = {}
   for _id in self.skype.unread_conversations:
       self.show_indicator(self.skype.unread_conversations[int(_id)])
   unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
   unitylauncher.createUnreadMessageQuickList(self.skype.unread_conversations, self.show_conversation_quicklist)
   unitylauncher.redrawQuicklist()  
   unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
 def CallStatus(self, call, status):
     global active_player, player_paused, volume_level
     if status == "RINGING":
         if settings.get_control_music_player() and active_player == "unknown" and player_paused == False:
             controlMusicPlayer()
         if settings.get_restore_volume():
             SaveRestore_Volume()
         self.call_ringing = self.call_ringing + 1
         self.calls[call.PartnerHandle] = call
     else:
         self.call_ringing = self.call_ringing - 1
 
     #if status == "INPROGRESS":LOCALHOLD
 
     if (status == "MISSED" or status == "FINISHED" or status == "REFUSED" or status == "CANCELLED") and call.PartnerHandle in self.calls:
         if settings.get_restore_volume():
             SaveRestore_Volume()
             volume_level = "unknown"
         if settings.get_control_music_player():
             controlMusicPlayer()
             active_player = "unknown"
             player_paused = False
         del self.calls[call.PartnerHandle]
     if helper.isUnityRunning():    
         unitylauncher.createCallsQuickList(self.calls, self.cb_call_action)
         unitylauncher.redrawQuicklist()  
 
     # wiggle the launcher
     if self.call_ringing > 0 and not self.calls_ringing_started:
         if helpers.isUnityRunning():
             unitylauncher.urgent()
         GObject.timeout_add(1000, self.calls_ringing)
     
     icon = ""
     if settings.get_display_notification_avatars():
         avatar = SkypeAvatar(call.PartnerHandle)
         if avatar.filename:
             icon = avatar.filename
         else:
             icon = wrapperPath + "/icons/skype-wrapper-48.svg"
 
     partner = call.PartnerDisplayName or call.PartnerHandle
     notification = ""
     if status == "RINGING" and (call.Type == "INCOMING_P2P" or call.Type == "INCOMING_PSTN"):
         notification = "* Incoming call";
     if status == "INPROGRESS":
         notification = "* Call started";
     if status == "MISSED":
         notification = "* Missed call";
     if status == "FINISHED":
         notification = "* Call ended";
     if status == "REMOTEHOLD":
         notification = "* Call put on hold";
     if notification:
         helpers.notify(partner, notification, icon, "call://"+call.PartnerHandle, True, True)  
Exemplo n.º 7
0
 def CallStatus(self, call, status):
   global active_player, player_paused, volume_level
   if status == "RINGING":
       if settings.get_control_music_player() and active_player == "unknown" and player_paused == False:
           controlMusicPlayer()
       if settings.get_restore_volume():
           SaveRestore_Volume()
       self.call_ringing = self.call_ringing + 1
       self.calls[call.PartnerHandle] = call
   else:
       self.call_ringing = self.call_ringing - 1
   
   #if status == "INPROGRESS":LOCALHOLD
   
   if (status == "MISSED" or status == "FINISHED" or status == "REFUSED" or status == "CANCELLED") and call.PartnerHandle in self.calls:
       if settings.get_restore_volume():
           SaveRestore_Volume()
           volume_level = "unknown"
       if settings.get_control_music_player():
           controlMusicPlayer()
           active_player = "unknown"
           player_paused = False
       del self.calls[call.PartnerHandle]
       
   unitylauncher.createCallsQuickList(self.calls, self.cb_call_action)
   unitylauncher.redrawQuicklist()  
   
   # wiggle the launcher
   if self.call_ringing > 0 and not self.calls_ringing_started:
       unitylauncher.urgent()
       GObject.timeout_add(1000, self.calls_ringing)
       
   icon = ""
   if settings.get_display_notification_avatars():
       avatar = SkypeAvatar(call.PartnerHandle)
       if avatar.filename:
           icon = avatar.filename
       else:
           icon = "/usr/share/skype-wrapper/icons/skype-wrapper-48.svg"
   
   partner = call.PartnerDisplayName or call.PartnerHandle
   notification = ""
   if status == "RINGING" and (call.Type == "INCOMING_P2P" or call.Type == "INCOMING_PSTN"):
       notification = "* Incoming call";
   if status == "INPROGRESS":
       notification = "* Call started";
   if status == "MISSED":
       notification = "* Missed call";
   if status == "FINISHED":
       notification = "* Call ended";
   if status == "REMOTEHOLD":
       notification = "* Call put on hold";
   if notification:
       helpers.notify(partner, notification, icon, "call://"+call.PartnerHandle, True, True)  
 def CallStatus(self, call, status): 
   if status == "RINGING":
       self.call_ringing = self.call_ringing + 1
       self.calls[call.PartnerHandle] = call
   else:
       self.call_ringing = self.call_ringing - 1
   
   #if status == "INPROGRESS":LOCALHOLD
   
   if (status == "MISSED" or status == "FINISHED") and call.PartnerHandle in self.calls:
       del self.calls[call.PartnerHandle]
       
   unitylauncher.createCallsQuickList(self.calls, self.cb_call_action)
   unitylauncher.redrawQuicklist()  
   
   # wiggle the launcher
   if self.call_ringing > 0 and not self.calls_ringing_started:
       unitylauncher.urgent()
       GObject.timeout_add(1000, self.calls_ringing)
       
   icon = ""
   if settings.get_display_notification_avatars():
       avatar = SkypeAvatar(call.PartnerHandle)
       if avatar.filename:
           icon = avatar.filename
       else:
           icon = "/usr/share/skype-wrapper/icons/skype-wrapper-48.svg"
   
   partner = call.PartnerDisplayName or call.PartnerHandle
   notification = ""
   if status == "RINGING":
       notification = "* Incoming call";
   if status == "INPROGRESS":
       notification = "* Call started";
   if status == "MISSED":
       notification = "* Missed call";
   if status == "FINISHED":
       notification = "* Call ended";
   if status == "REMOTEHOLD":
       notification = "* Call put on hold";
   if notification:
       helpers.notify(partner, notification, icon, "call://"+call.PartnerHandle, True, True)  
 def new_message(self, conversation):
   if not settings.get_notify_on_messagerecieve() or self.skype.skype_presence == Skype4Py.cusDoNotDisturb:
       return
   #conversation.skypereturn.Chat.Type == Skype4Py.chatTypeMultiChat and  
   if conversation.skypereturn.Chat.Topic:
       group_chat_title = unicode(conversation.skypereturn.Sender.FullName + " ► " + conversation.skypereturn.Chat.Topic)
   else:
       group_chat_title = unicode(conversation.display_name)
       
   icon = ""
   if settings.get_display_notification_avatars():
       avatar = SkypeAvatar(conversation.skypereturn.Sender.Handle)
       if avatar.filename:
           icon = '-i "'+avatar.filename+'" '
       else:
           icon = '-i "/usr/share/skype-wrapper/icons/skype-wrapper-48.svg" '
   
   if helpers.haveUnity():
       unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
       unitylauncher.createUnreadMessageQuickList(self.skype.unread_conversations, self.show_conversation_quicklist)
       unitylauncher.redrawQuicklist()  
       unitylauncher.count(len(self.indicators) + self.skype.incomingfilecount)
   
   os.system(u'notify-send '+icon+'"'+group_chat_title+'" "'+conversation.skypereturn.Body+'"');