bool
OPENLDAP::Source::populate_menu (Ekiga::MenuBuilder &builder)
{
    builder.add_action ("add", _("Add an LDAP Address Book"),
                        sigc::mem_fun (this, &OPENLDAP::Source::new_book));
    builder.add_action ("add", _("Add the Ekiga.net Directory"),
                        sigc::mem_fun (this, &OPENLDAP::Source::new_ekiga_net_book));
    return true;
}
Esempio n. 2
0
bool
RL::Heap::populate_menu (Ekiga::MenuBuilder& builder)
{
    builder.add_action ("add", _("_Add a new contact"),
                        boost::bind (&RL::Heap::new_entry, this));
    builder.add_action ("refresh", _("_Refresh contact list"),
                        boost::bind (&RL::Heap::refresh, this));
    builder.add_action ("properties", _("Contact list _properties"),
                        boost::bind (&RL::Heap::edit, this));
    return true;
}
Esempio n. 3
0
bool
RL::Heap::populate_menu (Ekiga::MenuBuilder& builder)
{
  builder.add_action ("add", _("_Add a new contact"),
		      sigc::mem_fun (this, &RL::Heap::new_entry));
  builder.add_action ("refresh", _("_Refresh contact list"),
		      sigc::mem_fun (this, &RL::Heap::refresh));
  builder.add_action ("properties", _("Contact list _properties"),
		      sigc::mem_fun (this, &RL::Heap::edit));
  return true;
}
Esempio n. 4
0
bool Opal::Bank::populate_menu (Ekiga::MenuBuilder & builder)
{
  builder.add_action ("add", _("_Add an Ekiga.net Account"),
		      sigc::bind (sigc::mem_fun (this, &Opal::Bank::new_account), Opal::Account::Ekiga, "", ""));
  builder.add_action ("add", _("_Add an Ekiga Call Out Account"),
		      sigc::bind (sigc::mem_fun (this, &Opal::Bank::new_account), Opal::Account::DiamondCard, "", ""));
  builder.add_action ("add", _("_Add a SIP Account"),
		      sigc::bind (sigc::mem_fun (this, &Opal::Bank::new_account), Opal::Account::SIP, "", ""));
  builder.add_action ("add", _("_Add an H.323 Account"),
		      sigc::bind (sigc::mem_fun (this, &Opal::Bank::new_account), Opal::Account::H323, "", ""));

  return true;
}
Esempio n. 5
0
bool
LM::Bank::populate_menu (Ekiga::MenuBuilder& builder)
{
  builder.add_action ("add", _("_Add a Jabber/XMPP Account"),
		      boost::bind (&LM::Bank::new_account, this));
  return true;
}
Esempio n. 6
0
bool
Local::Heap::populate_menu (Ekiga::MenuBuilder &builder)
{
  builder.add_action ("new", _("New contact"),
		      sigc::bind (sigc::mem_fun (this, &Local::Heap::new_presentity), "", ""));
  return true;
}
Esempio n. 7
0
bool
LM::HeapRoster::populate_menu (Ekiga::MenuBuilder& builder)
{
  builder.add_action ("add", _("A_dd Contact"), boost::bind (&LM::HeapRoster::add_item, this));
  dialect->populate_menu (builder);
  return true;
}
Esempio n. 8
0
bool
Opal::Bank::populate_menu (Ekiga::MenuBuilder & builder)
{
  builder.add_action ("add", _("_Add an Ekiga.net Account"),
		      boost::bind (&Opal::Bank::new_account, this, Opal::Account::Ekiga, "", ""));
  builder.add_action ("add", _("_Add an Ekiga Call Out Account"),
		      boost::bind (&Opal::Bank::new_account, this, Opal::Account::DiamondCard, "", ""));
  builder.add_action ("add", _("_Add a SIP Account"),
		      boost::bind (&Opal::Bank::new_account, this, Opal::Account::SIP, "", ""));
#ifdef HAVE_H323
  builder.add_action ("add", _("_Add an H.323 Account"),
		      boost::bind (&Opal::Bank::new_account, this, Opal::Account::H323, "", ""));
#endif

  return true;
}
Esempio n. 9
0
bool
Local::Heap::populate_menu (Ekiga::MenuBuilder &builder)
{
  builder.add_action ("add", _("A_dd Contact"),
		      boost::bind (&Local::Heap::new_presentity, this, "", ""));
  return true;
}
Esempio n. 10
0
bool
Opal::Sip::EndPoint::populate_menu (const std::string& fullname,
				    const std::string& uri,
				    Ekiga::MenuBuilder& builder)
{
  if (0 == GetConnectionCount ())
    builder.add_action ("phone-pick-up", _("Call"),
			boost::bind (&Opal::Sip::EndPoint::on_dial, this, uri));
  else
    builder.add_action ("mail-forward", _("Transfer"),
			boost::bind (&Opal::Sip::EndPoint::on_transfer, this, uri));
  builder.add_action ("im-message-new", _("Message"),
		      boost::bind (&Opal::Sip::EndPoint::on_message, this, uri, fullname));

  return true;
}
Esempio n. 11
0
bool
Local::Heap::populate_menu_for_group (const std::string name,
				      Ekiga::MenuBuilder& builder)
{
  builder.add_action ("edit", _("Rename"),
		      boost::bind (&Local::Heap::on_rename_group, this, name));
  return true;
}
Esempio n. 12
0
bool
Echo::Dialect::populate_menu (Ekiga::MenuBuilder &builder)

{
  builder.add_action ("FIXME", "New echo", sigc::mem_fun (this, &Echo::Dialect::new_chat));

  return true;
}
Esempio n. 13
0
bool
Local::Heap::populate_menu_for_group (const std::string name,
				      Ekiga::MenuBuilder& builder)
{
  builder.add_action ("rename_group", _("Rename"),
		      sigc::bind (sigc::mem_fun (this, &Local::Heap::on_rename_group), name));
  return true;
}
Esempio n. 14
0
bool
RL::Cluster::populate_menu (Ekiga::MenuBuilder& builder)
{
  builder.add_action ("add", _("Add resource list"),
		      boost::bind (&RL::Cluster::new_heap, this,
				   "", "", "", "", "", false));
  return true;
}
Esempio n. 15
0
bool
Echo::Dialect::populate_menu (Ekiga::MenuBuilder &builder)

{
  builder.add_action ("FIXME", "New echo", boost::bind (&Echo::Dialect::new_chat, this));

  return true;
}
Esempio n. 16
0
bool
LM::Presentity::populate_menu (Ekiga::MenuBuilder& builder)
{
  const gchar* subscription = lm_message_node_get_attribute (item, "subscription");
  const gchar* ask = lm_message_node_get_attribute (item, "ask");

  if ( !has_chat) {

    builder.add_action ("im-message-new", _("Start chat"), boost::ref (chat_requested));
  } else {

    builder.add_action ("im-message-new", _("Continue chat"), boost::ref (chat_requested));
  }
  builder.add_separator ();

  builder.add_action ("edit", _("_Edit"),
		      boost::bind (&LM::Presentity::edit_presentity, this));

  if (g_strcmp0 (subscription, "none") == 0) {

    builder.add_action ("ask", _("Ask him/her to see his/her status"), boost::bind (&LM::Presentity::ask_to, this));
  }
  if (g_strcmp0 (subscription, "from") == 0) {

    builder.add_action ("stop", _("Forbid him/her to see my status"), boost::bind (&LM::Presentity::revoke_from, this));
    if (ask == NULL)
      builder.add_action ("ask", _("Ask him/her to see his/her status"), boost::bind (&LM::Presentity::ask_to, this));
    else
      builder.add_ghost ("ask", _("Ask him/her to see his/her status (pending)"));
  }
  if (g_strcmp0 (subscription, "to") == 0) {

    builder.add_action ("stop", _("Stop getting his/her status"), boost::bind (&LM::Presentity::stop_to, this));
  }
  if (g_strcmp0 (subscription, "both") == 0) {

    builder.add_action ("stop", _("Forbid him/her to see my status"), boost::bind (&LM::Presentity::revoke_from, this));
    builder.add_action ("stop", _("Stop getting his/her status"), boost::bind (&LM::Presentity::stop_to, this));
  }

  builder.add_action ("remove", _("_Remove"),
		      boost::bind (&LM::Presentity::remove_presentity, this));
  return true;
}
Esempio n. 17
0
bool
RL::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
{
    bool populated = false;
    boost::shared_ptr<Ekiga::PresenceCore> presence_core(services.get<Ekiga::PresenceCore> ("presence-core"));

    populated = presence_core->populate_presentity_menu (PresentityPtr (this, null_deleter ()), uri, builder);

    if (writable) {

        if (populated)
            builder.add_separator ();

        builder.add_action ("edit", _("_Edit"),
                            boost::bind (&RL::Presentity::edit_presentity, this));
        builder.add_action ("remove", _("_Remove"),
                            boost::bind (&RL::Presentity::remove, this));
    }

    return true;
}
Esempio n. 18
0
bool
LM::Account::populate_menu (Ekiga::MenuBuilder& builder)
{
  if (lm_connection_is_open (connection)) {

    builder.add_action ("user-offline", _("_Disable"),
			boost::bind (&LM::Account::disable, this));
  } else {

    builder.add_action ("user-available", _("_Enable"),
			boost::bind (&LM::Account::enable, this));
  }

  builder.add_separator ();

  builder.add_action ("gtk-edit", _("Edit"),
		      boost::bind (&LM::Account::edit, this));
  builder.add_action ("gtk-remove", _("_Remove"),
		      boost::bind (&LM::Account::remove, this));

  return true;
}
Esempio n. 19
0
bool
Local::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
{
  bool populated = false;
  boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock ();

  if (!pcore)
    return false;

  populated
    = pcore->populate_presentity_menu (PresentityPtr(this, null_deleter ()),
				       get_uri (), builder);

  if (populated)
    builder.add_separator ();

  builder.add_action ("edit", _("_Edit"),
		      boost::bind (&Local::Presentity::edit_presentity, this));
  builder.add_action ("remove", _("_Remove"),
		      boost::bind (&Local::Presentity::remove, this));

  return true;
}
Esempio n. 20
0
bool
RL::Entry::populate_menu (Ekiga::MenuBuilder& builder)
{
  bool populated = false;
  boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
  std::string uri(get_uri ());

  builder.add_action ("refresh", _("_Refresh"),
		      boost::bind (&RL::Entry::refresh, this));

  if ( !uri.empty ())
    populated = presence_core->populate_presentity_menu (Ekiga::PresentityPtr (this, null_deleter ()), uri, builder);

  return populated;
}
bool
Local::ContactDecorator::populate_menu (Ekiga::Contact &contact,
					const std::string uri,
					Ekiga::MenuBuilder &builder)
{
  bool populated = false;

  if (cluster.is_supported_uri (uri)) {

    Heap &heap = cluster.get_heap ();

    if (!heap.has_presentity_with_uri (uri)) {

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

  return populated;
}
Esempio n. 22
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;
}
Esempio n. 23
0
 bool populate_menu (Ekiga::MenuBuilder& builder)
 {
   builder.add_action (icon, label, callback);
   return true;
 }
Esempio n. 24
0
static void
populate_item (Ekiga::ServiceCore &core,
	       Ekiga::MenuBuilder &builder,
	       xmlNodePtr item,
	       bool is_external)
{
  std::string label;
  bool got_label = false;
  std::string icon;
  bool got_icon = false;
  std::string command;
  bool got_command = false;

  for (xmlNodePtr child = item->children ;
       child != NULL ;
       child = child->next) {

    if (child->type == XML_ELEMENT_NODE
	&& child->name != NULL) {

      if (!got_label && xmlStrEqual (BAD_CAST "label", child->name)) {

	xmlChar *xml_str = xmlNodeGetContent (child);

	if (xml_str != NULL) {

	  label = (const char *)xml_str;
	  got_label = true;
	  xmlFree (xml_str);
	}
      }

      if (!got_icon && xmlStrEqual (BAD_CAST "icon", child->name)) {

	xmlChar *xml_str = xmlNodeGetContent (child);

	if (xml_str != NULL) {

	  icon = (const char *)xml_str;
	  got_icon = true;
	  xmlFree (xml_str);
	}
      }

      if (!got_command && xmlStrEqual (BAD_CAST "command", child->name)) {

	xmlChar *xml_str = xmlNodeGetContent (child);

	if (xml_str != NULL) {

	  command = (const char *)xml_str;
	  got_command = true;
	  xmlFree (xml_str);
	}
      }

      if (got_label && got_icon && got_command) {

	if (is_external) {

	  builder.add_action (icon, label,
			      boost::bind (&run_command,
					  command));
	} else {

	  boost::shared_ptr<Ekiga::Trigger> trigger = core.get<Ekiga::Trigger> (command);
	  if (trigger)
	    builder.add_action (icon, label,
				boost::bind (&pull_trigger,
					    trigger));
	}
	break;
      }


    }
  }
}
Esempio n. 25
0
bool Opal::Sip::EndPoint::menu_builder_add_actions (const std::string& fullname,
                                                    const std::string& uri,
                                                    Ekiga::MenuBuilder & builder)
{
  bool populated = false;


  std::list<std::string> uris;
  std::list<std::string> accounts;

  if (!(uri.find ("sip:") == 0 || uri.find (":") == string::npos))
    return false;

  if (uri.find ("@") == string::npos) {

    Opal::Bank *bank = dynamic_cast<Opal::Bank*> (core.get ("opal-account-store"));

    if (bank) {

      for (Opal::Bank::iterator it = bank->begin ();
           it != bank->end ();
           it++) {

        if (it->get_protocol_name () == "SIP" && it->is_active ()) {

          std::stringstream uristr;
          std::string str = uri;

          for (unsigned i = 0 ; i < str.length() ; i++) {

            if (str [i] == ' ' || str [i] == '-') {
              str.erase (i,1);
              i--;
            }
          }

          if (str.find ("sip:") == string::npos)
            uristr << "sip:" << str;
          else
            uristr << str;

          uristr << "@" << it->get_host ();

          uris.push_back (uristr.str ());
          accounts.push_back (it->get_name ());
        }
      }
    }
  }
  else {
    uris.push_back (uri);
    accounts.push_back ("");
  }

  std::list<std::string>::iterator ita = accounts.begin ();
  for (std::list<std::string>::iterator it = uris.begin ();
       it != uris.end ();
       it++) {

    std::stringstream call_action;
    std::stringstream transfer_action;
    if (!(*ita).empty ()) {
      call_action << _("Call") << " [" << (*ita) << "]";
      transfer_action << _("Transfer") << " [" << (*ita) << "]";
    }
    else {
      call_action << _("Call");
      transfer_action << _("Transfer");
    }

    if (0 == GetConnectionCount ())
      builder.add_action ("call", call_action.str (),
                          sigc::bind (sigc::mem_fun (this, &Opal::Sip::EndPoint::on_dial), (*it)));
    else 
      builder.add_action ("transfer", transfer_action.str (),
                          sigc::bind (sigc::mem_fun (this, &Opal::Sip::EndPoint::on_transfer), (*it)));

    ita++;
  }

  ita = accounts.begin ();
  for (std::list<std::string>::iterator it = uris.begin ();
       it != uris.end ();
       it++) {

    std::stringstream msg_action;
    if (!(*ita).empty ()) 
      msg_action << _("Message") << " [" << (*ita) << "]";
    else
      msg_action << _("Message");

    builder.add_action ("message", msg_action.str (),
                        sigc::bind (sigc::mem_fun (this, &Opal::Sip::EndPoint::on_message), (*it), fullname));

    ita++;
  }

  populated = true;

  return populated;
}