Example #1
0
    def __init__(self):
        """Initialise objects"""
        self.connected = False

        self.app = QtGui.QApplication(sys.argv)
        self.chat = ChatRosterWindow(self)

        self.login()

        self.chat.show()
        sys.exit(self.app.exec_())
Example #2
0
    def __init__(self):
        """Initialise objects"""
        self.connected = False

        self.app = QtGui.QApplication(sys.argv)
        self.chat = ChatRosterWindow(self)

        self.login()
    
        self.chat.show()
        sys.exit(self.app.exec_())
Example #3
0
class TunnelClient(object):
    """Holder object for the application"""

    def __init__(self):
        """Initialise objects"""
        self.connected = False

        self.app = QtGui.QApplication(sys.argv)
        self.chat = ChatRosterWindow(self)

        self.login()
    
        self.chat.show()
        sys.exit(self.app.exec_())
 
    def login(self):
        """Run login dialog and get the api_conn set up"""
        login = LoginWindow(self)
        login.exec_()
        self.connected = True

    def set_login_details(self, username, password, server):
        self.username = username
        self.password = password
        self.server = server

        return self.start_connection()

    def start_connection(self):
        # Initialise the XMPP connection
        #try:
        self.xmpp = TunnelConnection(str(self.username) + "/tunnel",
                str(self.password), self.chat.session_start,
                self.chat.incoming_message)
        self.xmpp.connect((str(self.server), 5222))
        self.xmpp.process(threaded=True)
        #except:
        #    return False
        #else:
        return True
Example #4
0
class TunnelClient(object):
    """Holder object for the application"""
    def __init__(self):
        """Initialise objects"""
        self.connected = False

        self.app = QtGui.QApplication(sys.argv)
        self.chat = ChatRosterWindow(self)

        self.login()

        self.chat.show()
        sys.exit(self.app.exec_())

    def login(self):
        """Run login dialog and get the api_conn set up"""
        login = LoginWindow(self)
        login.exec_()
        self.connected = True

    def set_login_details(self, username, password, server):
        self.username = username
        self.password = password
        self.server = server

        return self.start_connection()

    def start_connection(self):
        # Initialise the XMPP connection
        #try:
        self.xmpp = TunnelConnection(
            str(self.username) + "/tunnel", str(self.password),
            self.chat.session_start, self.chat.incoming_message)
        self.xmpp.connect((str(self.server), 5222))
        self.xmpp.process(threaded=True)
        #except:
        #    return False
        #else:
        return True