Beispiel #1
0
    def reset_launcher(self):
        old = self.launcher_desktop
        is_skype_wrapper = helpers.isSkypeWrapperDesktopOnUnityLauncher()

        if (is_skype_wrapper):
            self.launcher_desktop = "skype-wrapper.desktop"
            self.launcher = self.launcher_wrapper
        else:
            self.launcher_desktop = "skype.desktop"
            self.launcher = self.launcher_main
        if not old or old == self.launcher_desktop:
            return

        # this crashes unity
        if (is_skype_wrapper):
            old = self.launcher_main
        else:
            old = self.launcher_wrapper

        self.launcher.set_property("quicklist", self.quicklist)
        self.launcher.set_property("count", self.mcount)
        self.launcher.set_property("count_visible", self.mcount_visible)
        self.launcher.set_property("progress", self.mprogress)
        self.launcher.set_property("progress_visible", self.mprogress_visible)
        self.launcher.set_property("urgent", self.murgent)

        # removing quicklist causes a unity to crash
        #quicklist = Dbusmenu.Menuitem.new ()
        #old.set_property("quicklist", quicklist)
        old.set_property("count_visible", False)
        old.set_property("progress_visible", False)
        old.set_property("urgent", False)
Beispiel #2
0
 def reset_launcher(self):
     old = self.launcher_desktop
     is_skype_wrapper = helpers.isSkypeWrapperDesktopOnUnityLauncher()
 
     if(is_skype_wrapper):
         self.launcher_desktop = "skype-wrapper.desktop"
         self.launcher = self.launcher_wrapper
     else:
         self.launcher_desktop = "skype.desktop"
         self.launcher = self.launcher_main
     if not old or old == self.launcher_desktop:
         return
 
     # this crashes unity
     if(is_skype_wrapper):
         old = self.launcher_main
     else:
         old = self.launcher_wrapper
     
     self.launcher.set_property("quicklist", self.quicklist)
     self.launcher.set_property("count", self.mcount)
     self.launcher.set_property("count_visible", self.mcount_visible)
     self.launcher.set_property("progress", self.mprogress)
     self.launcher.set_property("progress_visible", self.mprogress_visible)
     self.launcher.set_property("urgent", self.murgent)
      
     # removing quicklist causes a unity to crash
     #quicklist = Dbusmenu.Menuitem.new ()
     #old.set_property("quicklist", quicklist)
     old.set_property("count_visible", False)
     old.set_property("progress_visible", False)
     old.set_property("urgent", False)
Beispiel #3
0
  def __init__(self):
    log("Initializing Skype API", INFO)
    self.skype = Skype4Py.Skype(None, Transport='x11')
    self.call_ringing = 0
    self.calls_ringing_started = False
    
    #register events
    self.skype.RegisterEventHandler('MessageStatus', self.MessageStatus)
    self.skype.RegisterEventHandler('OnlineStatus', self.OnlineStatus)
    self.skype.RegisterEventHandler('FileTransferStatusChanged', self.FileTransferStatusChanged)
    self.skype.RegisterEventHandler('CallStatus', self.CallStatus)
    
    self.skype.Timeout = 500
    
    if not isSkypeRunning():
        if settings.get_start_skype_cmd_params():
            log("Starting Skype with extra params", INFO)
            subprocess.Popen(shlex.split("skype "+settings.get_start_skype_cmd_params()))
        else:
            if not helpers.isSkypeWrapperDesktopOnUnityLauncher():
                log("Starting Skype process", INFO)
                subprocess.Popen(shlex.split("skype"))
            else:
                log("Starting Skype", INFO)
                self.skype.Client.Start(Minimized=True)

    log("Waiting for Skype Process", INFO)
    while True:
      if isSkypeRunning():
        break

    log("Attaching skype-wrapper to Skype process", INFO)
    while True:
        try:
            # don't know if its our authorization request but we will wait our turn
            if not helpers.isAuthorizationRequestOpen():
                self.skype.Attach(Wait=True)
                break
            else:
                log("Authorization dialog still open", INFO)
                sys.exit(2)
        except:
            # we tell the parent process that the skype couldn't attached
            log("Failed to attach skype-wrapper to Skype process", WARNING)
            sys.exit(2) 
                        
    log("Attached complete", INFO)
    
    #self.skype.Timeout = 30000
    unitylauncher.launcher.SkypeAgent = self.skype.Client
    unitylauncher.launcher.skype = self.skype
    unitylauncher.launcher.redrawQuicklist()
    self.skype.Client.Minimize()
    self.name_mappings = {}
    self.unread_conversations = {}
    
    # we will store all outdated messages here, anything not here will get net notified
    self.conversations = {}
    
    # store all the users online for notifying if they're on
    self.usersonline = {}
    
    # stor all file transfers
    self.filetransfers = {}
    self.incomingfilecount = 0
    
    # store all calls current
    self.calls = {}
    
    self.cb_show_conversation = None
    self.cb_show_indicator = None
    self.cb_user_status_change = None
    self.cb_log_message = None
    self.cb_read_within_skype = None
    self.cb_log_transfer = None

    self.initSkypeFirstStart()    
        
    self.messageupdatepending = True
    GObject.timeout_add(CB_INTERVALS, self.checkUnreadMessages)
    
    self.onlineuserupdatepending = True
    GObject.timeout_add(CB_INTERVALS, self.checkOnlineUsers)
    
    self.onlinepresenceupdatepending = True
    GObject.timeout_add(CB_INTERVALS, self.checkOnlineStatus)
    
    self.filetransferupdatepending = True
    GObject.timeout_add(CB_INTERVALS, self.checkFileTransfers)