def __init__(self): hildon.Program.__init__(self) self.context = osso.Context("showcontacts", "0.0.1", False) abook.init("showcontacts", self.context) self.window = hildon.Window() self.window.connect("destroy", gtk.main_quit) self.add_window(self.window) self.book = evo.open_addressbook("default") query = evo.EBookQuery.field_exists(evo.CONTACT_FULL_NAME) self.bookview = self.book.get_book_view(query) self.bookview.start() self.model = abook.ContactModel(self.bookview) self.view = abook.ContactView(self.model) self.view.connect("contact-activated", self.contact_activated) self.bar = abook.AlphaBar(self.view) btbar = self.bar.create_button_row() vbox = gtk.VBox() vbox.pack_start(self.view) vbox.pack_start(btbar) # Menu stuf... self.menu = gtk.Menu() item_add = gtk.MenuItem("Add Account To Contact") self.menu.append(item_add) item_add.connect("activate", self.add_to_contact) item_block = gtk.MenuItem("Block Manager") self.menu.append(item_block) item_block.connect("activate", self.block_manager) item_edit = gtk.MenuItem("Edit Contact") self.menu.append(item_edit) item_edit.connect("activate", self.edit_contact) item_new = gtk.MenuItem("New Contact") self.menu.append(item_new) item_new.connect("activate", self.edit_contact, True) item_edit_group = gtk.MenuItem("Edit Contact Groups") self.menu.append(item_edit_group) item_edit_group.connect("activate", self.edit_groups) item_auth = gtk.MenuItem("Request Auth") self.menu.append(item_auth) item_auth.connect("activate", self.request_auth) self.window.set_menu(self.menu) self.window.add(vbox) self.window.show_all()
def __init__(self): hildon.Program.__init__(self) # Init self.context = osso.Context("showcontacts", "0.0.1", False) abook.init("showcontacts", self.context) # Window self.window = hildon.Window() self.window.connect("destroy", gtk.main_quit) self.add_window(self.window) # Evolution stuff self.book = evo.open_addressbook("default") query = evo.EBookQuery.field_exists(evo.CONTACT_FULL_NAME) self.bookview = self.book.get_book_view(query) self.bookview.start() self.model = abook.ContactModel(self.bookview) self.view = abook.ContactSelector(self.model) self.bar = abook.AlphaBar(self.view) btbar = self.bar.create_button_row() button = gtk.Button("Check contact permission") button.connect("clicked", self.check_contact) vbox = gtk.VBox() vbox.pack_start(self.view) vbox.pack_start(btbar) vbox.pack_start(button) # Menu stuf... self.window.add(vbox) self.window.show_all()
def __init__(self): hildon.Program.__init__(self) # Init self.context = osso.Context("showcontacts", "0.0.1", False) abook.init("showcontacts", self.context) # Window self.window = hildon.Window() self.window.connect("destroy", gtk.main_quit) self.add_window(self.window) # Evolution stuff self.book = evo.open_addressbook("default") query = evo.EBookQuery.field_exists(evo.CONTACT_FULL_NAME) self.bookview = self.book.get_book_view(query) self.bookview.start() self.model = abook.ContactModel(self.bookview) self.view = abook.ContactView(self.model) self.view.connect("contact-activated", self.contact_activated) self.bar = abook.AlphaBar(self.view) btbar = self.bar.create_button_row() self.groupmodel = abook.GroupModel() self.groupview = abook.GroupView(self.groupmodel) hbox = gtk.HBox() hbox.pack_start(self.view) hbox.pack_start(self.groupview) vbox = gtk.VBox() vbox.pack_start(hbox) vbox.pack_start(btbar) # Menu stuf... self.menu = gtk.Menu() item = gtk.MenuItem("Delete Contact") self.menu.append(item) item.connect("activate", self.delete_contact) item = gtk.MenuItem("Delete All Contacts") self.menu.append(item) item.connect("activate", self.delete_all_contacts) item = gtk.MenuItem("Add a contact") self.menu.append(item) item.connect("activate", self.add_contact) item = gtk.MenuItem("Block contact") self.menu.append(item) item.connect("activate", self.block_contact) item = gtk.MenuItem("New group") self.menu.append(item) item.connect("activate", self.new_group) item = gtk.MenuItem("Rename group") self.menu.append(item) item.connect("activate", self.rename_group) item = gtk.MenuItem("Delete group") self.menu.append(item) item.connect("activate", self.delete_group) item = gtk.MenuItem("Choose email") self.menu.append(item) item.connect("activate", self.choose_email) item = gtk.MenuItem("Choose IM") self.menu.append(item) item.connect("activate", self.choose_im) self.window.set_menu(self.menu) self.window.add(vbox) self.window.show_all()