void Opal::Presentity::edit_presentity () { boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&Opal::Presentity::edit_presentity_form_submitted, this, _1, _2, _3))); /* Translators: This is Edit name of the contact * e.g. Editing Contact Claire Fleury. */ char *title = g_strdup_printf (_("Editing Contact %s"), get_name ().c_str ()); request->title (title); g_free (title); request->action (_("Done")); request->text ("name", _("Name"), get_name (), _("John Doe"), Ekiga::FormVisitor::STANDARD, false, false); request->text ("uri", _("URI"), get_uri (), _("sip:[email protected]"), Ekiga::FormVisitor::URI, false, false); request->editable_list ("groups", _("Groups"), get_groups (), existing_groups ()); questions (request); }
void LM::HeapRoster::add_item () { boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&LM::HeapRoster::add_item_form_submitted, this, _1, _2))); request->title (_("Add a roster element")); request->instructions (_("Please fill in this form to add a new" " element to the remote roster")); request->text ("jid", _("Identifier:"), _("identifier@server"), std::string ()); request->text ("name", _("Name:"), "", _("Name of the contact, as shown in your roster")); request->editable_set ("groups", _("Put contact in groups:"), std::list<std::string>(), existing_groups ()); questions (request); }
void Local::Heap::new_presentity (const std::string name, const std::string uri) { if (!has_presentity_with_uri (uri)) { gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core"); Ekiga::FormRequestSimple request(sigc::mem_fun (this, &Local::Heap::new_presentity_form_submitted)); std::set<std::string> groups = existing_groups (); request.title (_("Add to local roster")); request.instructions (_("Please fill in this form to add a new contact " "to ekiga's internal roster")); request.text ("name", _("Name:"), name); if (presence_core->is_supported_uri (uri)) { request.hidden ("good-uri", "yes"); request.hidden ("uri", uri); } else { request.hidden ("good-uri", "no"); if ( !uri.empty ()) request.text ("uri", _("Address:"), uri); else request.text ("uri", _("Address:"), "sip:"); // let's put a default } request.editable_set ("groups", _("Put contact in groups:"), std::set<std::string>(), groups); if (!questions.handle_request (&request)) { // FIXME: better error reporting #ifdef __GNUC__ std::cout << "Unhandled form request in " << __PRETTY_FUNCTION__ << std::endl; #endif } } }
void Opal::Presentity::edit_presentity () { boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&Opal::Presentity::edit_presentity_form_submitted, this, _1, _2))); std::string name = get_name (); std::string uri = get_uri (); std::set<std::string> groups = get_groups (); std::set<std::string> all_groups = existing_groups (); request->title (_("Edit roster element")); request->instructions (_("Please fill in this form to change an existing " "element of ekiga's internal roster")); request->text ("name", _("Name:"), name, _("Name of the contact, as shown in your roster")); request->text ("uri", _("Address:"), uri, _("Address, e.g. sip:[email protected]; if you do not specify the host part, e.g. sip:xyz, then you can choose it by right-clicking on the contact in roster")); request->editable_set ("groups", _("Choose groups:"), groups, all_groups); questions (request); }
void Local::Heap::new_presentity (const std::string name, const std::string uri) { if (!has_presentity_with_uri (uri)) { boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock (); if (!pcore) return; boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&Local::Heap::new_presentity_form_submitted, this, _1, _2))); std::set<std::string> groups = existing_groups (); request->title (_("Add to local roster")); request->instructions (_("Please fill in this form to add a new contact " "to ekiga's internal roster")); request->text ("name", _("Name:"), name, _("Name of the contact, as shown in your roster")); if (pcore->is_supported_uri (uri)) { request->hidden ("good-uri", "yes"); request->hidden ("uri", uri); } else { request->hidden ("good-uri", "no"); if ( !uri.empty ()) request->text ("uri", _("Address:"), uri, _("Address, e.g. sip:[email protected]; if you do not specify the host part, e.g. sip:xyz, then you can choose it by right-clicking on the contact in roster")); else request->text ("uri", _("Address:"), "sip:", _("Address, e.g. sip:[email protected]; if you do not specify the host part, e.g. sip:xyz, then you can choose it by right-clicking on the contact in roster")); // let's put a default } request->editable_set ("groups", _("Put contact in groups:"), std::set<std::string>(), groups); questions (request); } }