def __create_user_contact(self, user_resource):
     _logger.debug("creating contact %s" % (str(user_resource)))
     
     model = globals.get_data_model()
     query = model.update(("http://mugshot.org/p/contacts", "createUserContact"),
                          user=user_resource);
     query.execute()
 def __create_contact(self, addressType, address):
     _logger.debug("creating contact %s %s" % (addressType, address))
     
     model = globals.get_data_model()
     query = model.update(("http://mugshot.org/p/contacts", "createContact"),
                          addressType=addressType,
                          address=address)
     query.execute()
        def remove_from_network_response(dialog, response_id, person):
            dialog.destroy()

            if response_id == gtk.RESPONSE_ACCEPT:
                _logger.debug("removing from network")

                model = globals.get_data_model()
                query = model.update(("http://mugshot.org/p/contacts", "deleteContact"),
                                     contact=person.resource)
                query.execute()

            else:
                _logger.debug("not removing from network")
        def rename_response(dialog, response_id, person):
            dialog.destroy()

            if response_id == gtk.RESPONSE_ACCEPT:
                _logger.debug("renaming this person")

                name = entry.get_text()

                model = globals.get_data_model()
                query = model.update(("http://mugshot.org/p/contacts", "setContactName"),
                                     contact=person.resource, name=name)
                query.execute()

            else:
                _logger.debug("not renaming")
        def add_address_response(dialog, response_id, person):
            dialog.destroy()

            if response_id == gtk.RESPONSE_ACCEPT:
                _logger.debug("adding address for this person")

                address = entry.get_text()
                addressType = combo_get_address_type(type_combo)

                model = globals.get_data_model()
                query = model.update(("http://mugshot.org/p/contacts", "addContactAddress"),
                                     contact=person.resource, addressType=addressType, address=address)
                query.execute()

            else:
                _logger.debug("not adding_address")
Example #6
0
    def __app_display_sync(self):
        if not self.__app:
            return

        self.__box.set_child_visible(self.__subtitle, not self.__description_mode)
        self.__box.set_child_visible(self.__description, self.__description_mode)
 
        self.__title.set_property("text", self.__app.get_name())
        if self.__app.is_installed() or self.__app_location == AppLocation.DESCRIPTION_HEADER:
            self.__subtitle.set_property("text", self.__app.get_generic_name() or self.__app.get_tooltip() or self.__app.get_comment())
        ## for now, install won't work if not connected
        elif self.__app_location == AppLocation.STOCK and globals.get_data_model().ready and globals.get_data_model().global_resource.online:
            self.__subtitle.set_property('text', "(Click to Install)")
        else:
            self.__subtitle.set_property('text', "(Not Installed)")
 
        self.__description.set_property("text", self.__app.get_description())

        if self.__app.get_icon_url():
            self.__photo.set_url(self.__app.get_icon_url())
        else:
            pixbuf = self.__app.get_local_pixbuf()
            if pixbuf:
                self.__photo.set_property("image", hippo.cairo_surface_from_gdk_pixbuf(pixbuf))
 def set_new_status(object):
     model = globals.get_data_model()
     query = model.update(("http://mugshot.org/p/contacts", "setContactStatus"),
                          contact=self.person.resource,
                          status=new_status)
     query.execute()