def __init__(self): hildon.Program.__init__(self) self.context = osso.Context("filtermodelexample", "0.0.1", False) abook.init("filtermodelexample", 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) button = gtk.Button("Edit contact") button.connect("clicked", self.edit_contact) vbox = gtk.VBox() vbox.pack_start(self.view) vbox.pack_start(button, expand=False, padding=5) 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.GroupModel() self.view = abook.GroupSelector(self.model) button = gtk.Button("Show contacts") button.connect("clicked", self.show_group) vbox = gtk.VBox() vbox.pack_start(self.view) vbox.pack_start(button) # Menu stuf... self.window.add(vbox) self.window.show_all()
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 tryLibWay(): from evolution import ebook, ecal print ebook.list_addressbooks() personal = ebook.open_addressbook('default') for c in personal.get_all_contacts(): print ("*** %s" %(c.get_name())) print ("\t%s, %s" %(c.props.family_name, c.props.given_name)) print ("\t%s" %(c.props.email_1))
def main(): context = osso.Context("selectdialog", "0.0.1", False) abook.init("selectdialog", context) book = evo.open_addressbook("default") query = evo.EBookQuery.field_exists(evo.CONTACT_FULL_NAME) bookview = book.get_book_view(query) bookview.start() model = abook.ContactModel(bookview) view = abook.ContactView(model) dialog = abook.SelectDialog(tree_view=view, new_contact=True) dialog.run() dialog.destroy()
def __init__(self): hildon.Program.__init__(self) self.context = osso.Context("filtermodelexample", "0.0.1", False) abook.init("filtermodelexample", 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.filtermodel = abook.FilterModel(self.model) self.view = abook.ContactView(self.model, self.filtermodel) self.entry = gtk.Entry() button = gtk.Button("Set query") button.connect("clicked", self.update_query) self.groups = {} combo = self.create_combo() combo.connect("changed", self.update_group) hbox = gtk.HBox() hbox.pack_start(self.entry) hbox.pack_start(button, expand=False) vbox = gtk.VBox() vbox.pack_start(hbox, expand=False, padding=5) vbox.pack_start(combo, expand=False, padding=5) vbox.pack_start(self.view) self.window.add(vbox) self.window.show_all()
def __init__(self): hildon.Program.__init__(self) self.context = osso.Context("filtermodelexample", "0.0.1", False) abook.init("filtermodelexample", 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.drag_source_set(gtk.gdk.BUTTON1_MASK, # [("text/plain", 0, 42)], gtk.gdk.ACTION_COPY) self.view.enable_drag_source() tv = self.view.get_tree_view() tv.connect("drag-begin", self.drag_begin) self.label = gtk.Label("Drop here") self.label.connect("drag-data-received", self.drag_data_received) self.label.drag_dest_set( gtk.DEST_DEFAULT_ALL, [(abook.CONTACT_DND_TYPE, gtk.TARGET_SAME_APP, 0)], gtk.gdk.ACTION_COPY) vbox = gtk.VBox() vbox.pack_start(self.label) vbox.pack_start(self.view) self.window.add(vbox) self.window.show_all()
def __init__(self): hildon.Program.__init__(self) self.context = osso.Context("showaccounts", "0.0.1", False) abook.init("showaccounts", 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() # Needs to set the bookview after creating the model self.model = abook.AccountModel(abook.ACCOUNT_TYPE_ALL) self.model.set_book_view(self.bookview) self.view = abook.AccountSelector(self.model) self.window.add(self.view) 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()