示例#1
0
文件: opal-bank.cpp 项目: Klom/ekiga
bool
Opal::Bank::populate_menu (Ekiga::ContactPtr contact,
			   const std::string uri,
			   Ekiga::MenuBuilder& builder)
{
  return populate_menu_helper (contact->get_name (), uri, builder);
}
示例#2
0
/* react to a new call being inserted in history */
static void
on_contact_added (Ekiga::ContactPtr contact,
                  GtkListStore *store)
{
  time_t t;
  struct tm *timeinfo = NULL;
  char buffer [80];
  std::stringstream info;
  std::string id;

  boost::shared_ptr<History::Contact> hcontact = boost::dynamic_pointer_cast<History::Contact> (contact);
  GtkTreeIter iter;

  if (hcontact) {

    switch (hcontact->get_type ()) {

    case History::RECEIVED:
      id = "go-previous-symbolic";
      break;

    case History::PLACED:
      id = "go-next-symbolic";
      break;

    case History::MISSED:
      id = "call-missed-symbolic";
      break;

    default:
      break;
    }
  }

  gtk_list_store_prepend (store, &iter);
  t = hcontact->get_call_start ();
  timeinfo = localtime (&t);
  if (timeinfo != NULL) {
    strftime (buffer, 80, "%x %X", timeinfo);
    info << buffer;
    if (!hcontact->get_call_duration ().empty ())
      info << " (" << hcontact->get_call_duration () << ")";
    else
      gtk_list_store_set (store, &iter,
                          COLUMN_ERROR_PIXBUF, "error",
                          -1);
  }
  else
    info << hcontact->get_call_duration ();

  gtk_list_store_set (store, &iter,
                      COLUMN_CONTACT, contact.get (),
                      COLUMN_PIXBUF, id.c_str (),
                      COLUMN_NAME, contact->get_name ().c_str (),
                      COLUMN_INFO, info.str ().c_str (),
                      -1);
}
示例#3
0
static void
book_view_gtk_update_contact (BookViewGtk *self,
			      Ekiga::ContactPtr contact,
			      GtkTreeIter *iter)
{
  GtkListStore *store = NULL;
  GdkPixbuf *pixbuf = NULL;

  store = GTK_LIST_STORE (gtk_tree_view_get_model (self->priv->tree_view));
  pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
                                     "avatar-default",
                                     GTK_ICON_SIZE_MENU, (GtkIconLookupFlags) 0, NULL);
  gtk_list_store_set (store, iter,
                      COLUMN_PIXBUF, pixbuf,
		      COLUMN_NAME, contact->get_name ().c_str (),
		      -1);
  if (pixbuf)
    g_object_unref (pixbuf);
}
示例#4
0
bool
Local::ContactDecorator::populate_menu (Ekiga::ContactPtr contact,
					const std::string uri,
					Ekiga::MenuBuilder &builder)
{
  bool populated = false;

  if (cluster->is_supported_uri (uri)) {

    HeapPtr heap(cluster->get_heap ());

    if (!heap->has_presentity_with_uri (uri)) {

      builder.add_action ("add", _("Add to local roster"),
			  boost::bind (&Local::Heap::new_presentity, heap.get (),
			  contact->get_name (), uri));
      populated = true;
    }
  }

  return populated;
}