[ekiga/ds-gtk-application] Plugins: Ported to the new Form user experience.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] Plugins: Ported to the new Form user experience.
- Date: Sun, 30 Nov 2014 15:26:45 +0000 (UTC)
commit 1b606792e3413e3db2fb53336fd14bc5c731a489
Author: Damien Sandras <dsandras seconix com>
Date: Sun Nov 30 16:15:00 2014 +0100
Plugins: Ported to the new Form user experience.
plugins/evolution/evolution-book.cpp | 21 +++++++----
plugins/evolution/evolution-contact.cpp | 27 +++++++++-----
plugins/ldap/ldap-book.cpp | 58 +++++++++++++++++++-----------
plugins/ldap/ldap-book.h | 3 +-
plugins/ldap/ldap-source.cpp | 2 +-
5 files changed, 69 insertions(+), 42 deletions(-)
---
diff --git a/plugins/evolution/evolution-book.cpp b/plugins/evolution/evolution-book.cpp
index 708fd72..2093286 100644
--- a/plugins/evolution/evolution-book.cpp
+++ b/plugins/evolution/evolution-book.cpp
@@ -340,14 +340,19 @@ Evolution::Book::new_contact_action ()
request->title (_("Add Contact"));
- request->instructions (_("Please update the following fields:"));
-
- request->text ("name", _("_Name:"), "", std::string ());
- request->text ("video", _("VoIP _URI:"), "", std::string ());
- request->text ("home", _("_Home phone:"), "", std::string ());
- request->text ("work", _("_Office phone:"), "", std::string ());
- request->text ("cell", _("_Cell phone:"), "", std::string ());
- request->text ("pager", _("_Pager:"), "", std::string ());
+ request->text ("name", _("_Name"), std::string (),
+ _("John Doe"));
+
+ request->text ("video", _("_URI"), std::string (),
+ _("sip:john doe ekiga net"), Ekiga::FormVisitor::URI);
+ request->text ("home", _("_Home Phone"), std::string (),
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("work", _("_Office Phone"), std::string (),
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("cell", _("_Cell Phone"), std::string (),
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("pager", _("_Pager"), std::string (),
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
questions (request);
}
diff --git a/plugins/evolution/evolution-contact.cpp b/plugins/evolution/evolution-contact.cpp
index 0432404..f102f5a 100644
--- a/plugins/evolution/evolution-contact.cpp
+++ b/plugins/evolution/evolution-contact.cpp
@@ -335,11 +335,13 @@ Evolution::Contact::edit_action ()
{
boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new
Ekiga::FormRequestSimple (boost::bind (&Evolution::Contact::on_edit_form_submitted, this, _1, _2, _3)));;
- request->title (_("Edit contact"));
-
- request->instructions (_("Please update the following fields:"));
-
- request->text ("name", _("Name:"), get_name (), std::string ());
+ /* Translators: This is Edit name of the contact
+ * e.g. Editing Damien SANDRAS details
+ */
+ char *title = g_strdup_printf (_("Editing %s details"), get_name ().c_str ());
+ request->title (title);
+ g_free (title);
+ request->text ("name", _("_Name"), get_name (), _("John Doe"));
{
std::string home_uri = get_attribute_value (ATTR_HOME);
@@ -348,11 +350,16 @@ Evolution::Contact::edit_action ()
std::string pager_uri = get_attribute_value (ATTR_PAGER);
std::string video_uri = get_attribute_value (ATTR_VIDEO);
- request->text ("video", _("VoIP _URI:"), video_uri, std::string ());
- request->text ("home", _("_Home phone:"), home_uri, std::string ());
- request->text ("work", _("_Office phone:"), work_uri, std::string ());
- request->text ("cell", _("_Cell phone:"), cell_phone_uri, std::string ());
- request->text ("pager", _("_Pager:"), pager_uri, std::string ());
+ request->text ("video", _("_URI"), video_uri,
+ _("sip:john doe ekiga net"), Ekiga::FormVisitor::URI);
+ request->text ("home", _("_Home Phone"), home_uri,
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("work", _("_Office Phone"), work_uri,
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("cell", _("_Cell Phone"), cell_phone_uri,
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
+ request->text ("pager", _("_Pager"), pager_uri,
+ _("+3268123456"), Ekiga::FormVisitor::PHONE_NUMBER);
}
questions (request);
diff --git a/plugins/ldap/ldap-book.cpp b/plugins/ldap/ldap-book.cpp
index 2867a02..0e6b646 100644
--- a/plugins/ldap/ldap-book.cpp
+++ b/plugins/ldap/ldap-book.cpp
@@ -943,27 +943,35 @@ OPENLDAP::Book::refresh_result ()
void
OPENLDAP::BookForm (boost::shared_ptr<Ekiga::FormRequestSimple> request,
- struct BookInfo &info,
- std::string title)
+ struct BookInfo &info)
{
std::string callAttr = "";
+ char *title = NULL;
- request->title (title);
+ /* Translators: This is Edit name of the LDAP Account
+ * e.g. Editing Ekiga.net Account.
+ */
+ if (!info.name.empty ())
+ title = g_strdup_printf (_("Editing %s Account"), info.name.c_str ());
+ else
+ title = g_strdup (_("Add Account"));
- request->instructions (_("Please edit the following fields"));
+ request->title (title);
+ g_free (title);
- request->text ("name", _("Book _name:"), info.name, _("Book name, as shown in your dialog box"));
- request->text ("uri", _("Server _URI:"), info.uri_host, _("Name of LDAP server, prefixed by ldap://"));
- request->text ("base", _("_Base DN:"), info.urld->lud_dn, std::string ());
+ request->text ("name", _("_Name"), info.name, _("Ekiga.net LDAP Server"),
+ Ekiga::FormVisitor::STANDARD, false, false);
+ request->text ("uri", _("_URI"), info.uri_host, "ldap://ekiga.net", Ekiga::FormVisitor::URI);
+ request->text ("base", _("_Base DN:"), info.urld->lud_dn, "dc=ekiga,dc=net");
{
std::map<std::string, std::string> choices;
std::string scopes[]= {"base","one","sub"};
choices["sub"] = _("Subtree");
- choices["onelevel"] = _("Single level");
- request->single_choice ("scope", _("_Search scope"),
- scopes[info.urld->lud_scope], choices);
+ choices["onelevel"] = _("Single Level");
+ request->single_choice ("scope", _("_Search Scope"),
+ scopes[info.urld->lud_scope], choices, true);
}
/* attrs[0] is the name attribute */
@@ -977,12 +985,16 @@ OPENLDAP::BookForm (boost::shared_ptr<Ekiga::FormRequestSimple> request,
* "DisplayName" (i.e., "the name that will be displayed") but on
* most LDAP servers it's "CommonName".
*/
- request->text ("nameAttr", _("_DisplayName attribute:"), info.urld->lud_attrs[0], std::string ());
- request->text ("callAttr", _("Call _attributes:"), callAttr, _("The field you are searching for"));
+ request->text ("nameAttr", _("_DisplayName Attribute"), info.urld->lud_attrs[0],
+ "givenName", Ekiga::FormVisitor::STANDARD, true);
+ request->text ("callAttr", _("Call _Attributes"), callAttr,
+ "telephoneNumber", Ekiga::FormVisitor::STANDARD, true);
if (info.urld->lud_filter != NULL)
- request->text ("filter", _("_Filter template:"), info.urld->lud_filter, _("Here, a \"$\" is replaced by
the search string"));
+ request->text ("filter", _("_Filter"), info.urld->lud_filter,
+ "(cn=$)", Ekiga::FormVisitor::STANDARD, true);
else
- request->text ("filter", _("_Filter template:"), "", _("Here, a \"$\" is replaced by the search
string"));
+ request->text ("filter", _("_Filter"), std::string (),
+ "(cn=$)", Ekiga::FormVisitor::STANDARD, true);
/* Translators: Bind ID - In LDAP, the operation that begins an LDAP
* session and authenticates the user to the directory is called a
@@ -993,10 +1005,14 @@ OPENLDAP::BookForm (boost::shared_ptr<Ekiga::FormRequestSimple> request,
* course, the Bind ID can be left blank, in which case the session
* is anonymous / unauthenticated.)
*/
- request->text ("authcID", _("Bind _ID:"), info.authcID, _("User ID; leave blank for anonymous /
nonauthenticated"));
- request->text ("password", _("_Password:"), info.password, _("The password for the user ID above, if
any"), Ekiga::FormVisitor::PASSWORD);
- request->boolean ("startTLS", _("Use _TLS"), info.starttls);
- request->boolean ("sasl", _("Use SAS_L"), info.sasl);
+ request->text ("authcID", _("Bind _ID"), info.authcID,
+ std::string (), Ekiga::FormVisitor::STANDARD, true);
+ request->text ("password", _("_Password"), info.password,
+ std::string (), Ekiga::FormVisitor::PASSWORD, true);
+ request->boolean ("startTLS", _("Use _TLS"),
+ info.starttls, true, false);
+ request->boolean ("sasl", _("Use SAS_L"),
+ info.sasl, true, false);
{
std::map<std::string, std::string> mechs;
const char **mechlist;
@@ -1010,8 +1026,8 @@ OPENLDAP::BookForm (boost::shared_ptr<Ekiga::FormRequestSimple> request,
mechs[mech] = mech;
}
}
- request->single_choice ("saslMech", _("SASL _mechanism"),
- info.saslMech, mechs);
+ request->single_choice ("saslMech", _("SASL _Mechanism"),
+ info.saslMech, mechs, true);
}
}
@@ -1020,7 +1036,7 @@ OPENLDAP::Book::edit ()
{
boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new
Ekiga::FormRequestSimple (boost::bind (&OPENLDAP::Book::on_edit_form_submitted, this, _1, _2, _3)));
- OPENLDAP::BookForm (request, bookinfo, std::string(_("Edit LDAP directory")));
+ OPENLDAP::BookForm (request, bookinfo);
questions (request);
}
diff --git a/plugins/ldap/ldap-book.h b/plugins/ldap/ldap-book.h
index 8440c3b..32a5e25 100644
--- a/plugins/ldap/ldap-book.h
+++ b/plugins/ldap/ldap-book.h
@@ -75,8 +75,7 @@ namespace OPENLDAP
};
void BookForm (boost::shared_ptr<Ekiga::FormRequestSimple> req,
- struct BookInfo &info,
- std::string title );
+ struct BookInfo &info);
int BookFormInfo (Ekiga::Form &result, struct BookInfo &info,
std::string &errmsg);
diff --git a/plugins/ldap/ldap-source.cpp b/plugins/ldap/ldap-source.cpp
index c14f010..5f1075e 100644
--- a/plugins/ldap/ldap-source.cpp
+++ b/plugins/ldap/ldap-source.cpp
@@ -156,7 +156,7 @@ OPENLDAP::Source::new_book ()
bookinfo.starttls = false;
OPENLDAP::BookInfoParse (bookinfo);
- OPENLDAP::BookForm (request, bookinfo, _("Create LDAP directory"));
+ OPENLDAP::BookForm (request, bookinfo);
questions (request);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]