Esempio n. 1
0
 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);
     }
        }
 }
Esempio n. 2
0
 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);
     }
        }
 }
Esempio n. 3
0
 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);
        }
 }