public void onCreateContact(object o, EventArgs args) { if(CreateContactButton.Sensitive == true) { ContactEditor ce = new ContactEditor(); ce.TransientFor = CBApp; ce.Contact = new Contact(); int rc = ce.Run(); if(rc == -5) { curAddrBook.AddContact(ce.Contact); ce.Contact.Commit(); ContactTreeStore.AppendValues(ce.Contact); } } }
internal void EditSelectedContact(object obj, EventArgs args) { TreeSelection tSelect = ContactTreeView.Selection; if(tSelect.CountSelectedRows() == 1) { TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); Contact c = (Contact) tModel.GetValue(iter,0); ContactEditor ce = new ContactEditor(); ce.TransientFor = CBApp; ce.Contact = c; int rc = ce.Run(); if(rc == -5) { c.Commit(); on_contact_selection_changed(obj, args); } } }
public void on_NewContactButton_clicked(object o, EventArgs args) { ContactEditor ce = new ContactEditor(); ce.TransientFor = cpDialog; ce.Contact = new Contact(); int rc = ce.Run(); if(rc == -5) { curAddrBook.AddContact(ce.Contact); ce.Contact.Commit(); ContactTreeStore.AppendValues(ce.Contact); } }