def selectManager(self, name):
        managerUri = self._availableManagers[name]

        # first, check to see if they reselected the same backend.
        if self.manager and self.manager.managerUri() == managerUri:
            return

        # the change is real.  update.
        if self.initialisedManagers.has_key(managerUri):
            self.manager = self.initialisedManagers[managerUri]
        else:
            self.manager = QContactManager.fromUri(managerUri)
            if self.manager.error():
                print "Failed to open store...."
                del self.manager
                self.manager = None
                return
            self.initialisedManagers[managerUri] = self.manager

        defs = self.manager.detailDefinitions(QContactType.TypeContact)

        self.emailEnabled = bool(defs["EmailAddress"])
        self.addressEnabled = bool(defs["Address"])

        self.updateContactList()
Ejemplo n.º 2
0
    def selectManager(self, name):
        managerUri = self._availableManagers[name]

        # first, check to see if they reselected the same backend.
        if self.manager and self.manager.managerUri() == managerUri:
            return

        # the change is real.  update.
        if self.initialisedManagers.has_key(managerUri):
            self.manager = self.initialisedManagers[managerUri]
        else:
            self.manager = QContactManager.fromUri(managerUri)
            if self.manager.error():
                print "Failed to open store...."
                del self.manager
                self.manager = None
                return
            self.initialisedManagers[managerUri] = self.manager

        defs = self.manager.detailDefinitions(QContactType.TypeContact)

        self.emailEnabled = bool(defs["EmailAddress"])
        self.addressEnabled = bool(defs["Address"])

        self.updateContactList()
    def __init__(self):
        QObject.__init__(self)

        self._availableManagers = {}
        self._contacts = []

        self.initialisedManagers = {}
        self.manager = None
        self.contactId = 0

        self._errorMessage = ""
        self._emailEnabled = False
        self._addressEnabled = True

        availableMgrs = QContactManager.availableManagers()
        availableMgrs.remove("invalid")
        for managerName in availableMgrs:
            params = {}
            managerUri = QContactManager.buildUri(managerName, params)
            self._availableManagers[managerName] = managerUri

        self.selectManager(self.availableManagers[0])
Ejemplo n.º 4
0
    def __init__(self):
        QObject.__init__(self)

        self._availableManagers = {}
        self._contacts = []

        self.initialisedManagers = {}
        self.manager = None
        self.contactId = 0

        self._errorMessage = ""
        self._emailEnabled = False
        self._addressEnabled = True

        availableMgrs = QContactManager.availableManagers()
        availableMgrs.remove("invalid")
        for managerName in availableMgrs:
            params = {}
            managerUri = QContactManager.buildUri(managerName, params)
            self._availableManagers[managerName] =  managerUri

        self.selectManager(self.availableManagers[0])