Beispiel #1
0
 def _AH_HistoryMenuTriggered(self, action):
     account_manager = AccountManager()
     session_manager = SessionManager()
     try:
         account = account_manager.get_account(action.entry.account_id)
     except KeyError:
         account = None
     contact, contact_uri = URIUtils.find_contact(action.entry.uri)
     session_manager.create_session(contact, contact_uri, [StreamDescription('audio')], account=account) # TODO: memorize media type and use it? -Saul (not sure about history in/out -Dan)
Beispiel #2
0
 def acceptNavigationRequest(self, frame, request, navigation_type):
     if navigation_type == QWebPage.NavigationTypeLinkClicked and self.linkDelegationPolicy() == QWebPage.DontDelegateLinks and request.url().scheme() in ('sip', 'sips'):
         blink = QApplication.instance()
         contact, contact_uri = URIUtils.find_contact(request.url().toString())
         session_manager = SessionManager()
         session_manager.create_session(contact, contact_uri, [StreamDescription('audio')])
         blink.main_window.raise_()
         blink.main_window.activateWindow()
         return False
     return super(WebPage, self).acceptNavigationRequest(frame, request, navigation_type)
Beispiel #3
0
 def _AH_ShareMyScreenActionTriggered(self):
     list_view = self.contact_list if self.contacts_view.currentWidget() is self.contact_list_panel else self.search_list
     if list_view.detail_view.isVisible():
         list_view.detail_view._AH_ShareMyScreen()
     else:
         selected_indexes = list_view.selectionModel().selectedIndexes()
         if selected_indexes:
             contact = selected_indexes[0].data(Qt.UserRole)
             contact_uri = contact.uri
         else:
             contact, contact_uri = URIUtils.find_contact(self.search_box.text())
         session_manager = SessionManager()
         session_manager.create_session(contact, contact_uri, [StreamDescription('screen-sharing', mode='server'), StreamDescription('audio')])
Beispiel #4
0
 def _SH_ChatSessionButtonClicked(self):
     list_view = self.contact_list if self.contacts_view.currentWidget() is self.contact_list_panel else self.search_list
     if list_view.detail_view.isVisible():
         list_view.detail_view._AH_StartChatSession()
     else:
         selected_indexes = list_view.selectionModel().selectedIndexes()
         if selected_indexes:
             contact = selected_indexes[0].data(Qt.UserRole)
             contact_uri = contact.uri
         else:
             contact, contact_uri = URIUtils.find_contact(self.search_box.text())
         session_manager = SessionManager()
         session_manager.create_session(contact, contact_uri, [StreamDescription('chat')], connect=False)
Beispiel #5
0
    def resolveAvatarUrl(self, url):
        if url.startswith("/avatar/"):
            uri = SIPURI.parse(url[8:].decode("hex"))

            # TODO: see if there is an official way to get this, including notification of changes
            # also needs fixing of webodf, allowing custom avatar renderer
            if self.account.uri == uri:
                avatar = IconManager().get('avatar')
                return avatar.filename if avatar != None else self.default_user_icon_filename

            contact, contact_uri = URIUtils.find_contact(uri)
            return contact.icon.filename

        return ""
Beispiel #6
0
    def _SH_ShareDocumentButtonClicked(self):
        list_view = self.contact_list if self.contacts_view.currentWidget() is self.contact_list_panel else self.search_list

        selected_indexes = list_view.selectionModel().selectedIndexes()
        if selected_indexes:
            contact = selected_indexes[0].data(Qt.UserRole)
            contact_uri = contact.uri
        else:
            contact, contact_uri = URIUtils.find_contact(self.search_box.text())

        filename = QFileDialog.getOpenFileName(self, "Share a Document", "", "OpenDocument Files (*.odt)")

        if filename:
            session_manager = SessionManager()
            session_manager.create_session(contact, contact_uri, [StreamDescription('document-sharing', filename=filename)])
Beispiel #7
0
 def _SH_SearchBoxReturnPressed(self):
     address = self.search_box.text()
     if address:
         contact, contact_uri = URIUtils.find_contact(address)
         session_manager = SessionManager()
         session_manager.create_session(contact, contact_uri, [StreamDescription('audio')])
Beispiel #8
0
 def _AH_VoicemailActionTriggered(self, action, checked):
     account = action.data()
     contact, contact_uri = URIUtils.find_contact(account.voicemail_uri, display_name='Voicemail')
     session_manager = SessionManager()
     session_manager.create_session(contact, contact_uri, [StreamDescription('audio')], account=account)
Beispiel #9
0
 def _AH_RedialActionTriggered(self):
     session_manager = SessionManager()
     if session_manager.last_dialed_uri is not None:
         contact, contact_uri = URIUtils.find_contact(session_manager.last_dialed_uri)
         session_manager.create_session(contact, contact_uri, [StreamDescription('audio')]) # TODO: remember used media types and redial with them. -Saul
Beispiel #10
0
 def _AH_RedialActionTriggered(self):
     session_manager = SessionManager()
     if session_manager.last_dialed_uri is not None:
         contact, contact_uri = URIUtils.find_contact(session_manager.last_dialed_uri)
         session_manager.create_session(contact, contact_uri, [StreamDescription('audio')]) # TODO: remember used media types and redial with them. -Saul