[gnome-contacts] Added TypeSet.email for handling Personal email.
- From: Erick PÃrez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Added TypeSet.email for handling Personal email.
- Date: Wed, 19 Dec 2012 21:27:54 +0000 (UTC)
commit 331f5babcb67b81261f0d5ee3a89836a74835df0
Author: Erick PÃrez Castellanos <erick red gmail com>
Date: Wed Dec 19 16:15:26 2012 -0500
Added TypeSet.email for handling Personal email.
Hiding Custom entry in TypeCombo widget.
src/contacts-types.vala | 33 ++++++++++++++++++++++++---------
1 files changed, 24 insertions(+), 9 deletions(-)
---
diff --git a/src/contacts-types.vala b/src/contacts-types.vala
index 961981b..547dd0c 100644
--- a/src/contacts-types.vala
+++ b/src/contacts-types.vala
@@ -111,14 +111,6 @@ public class Contacts.TypeSet : Object {
store.append (out other_iter);
store.set (other_iter, 0, _("Other"), 1, other_dummy);
-
- TreeIter iter;
- // Separator
- store.append (out iter);
- store.set (iter, 0, null);
-
- store.append (out custom_iter);
- store.set (custom_iter, 0, _("Custom..."), 1, custom_dummy);
}
public void add_custom_label (string label, out TreeIter iter) {
@@ -306,6 +298,29 @@ public class Contacts.TypeSet : Object {
}
}
+ private static TypeSet _email;
+ private const InitData[] email_data = {
+ // List most specific first, always in upper case
+ { N_("Personal"), { "PERSONAL" } },
+ { N_("Work"), { "WORK" } }
+ };
+ public static TypeSet email {
+ get {
+ string[] standard = {
+ "Personal", "Work"
+ };
+
+ if (_email == null) {
+ _email = new TypeSet ();
+ for (int i = 0; i < email_data.length; i++)
+ _email.add_init_data (&email_data[i]);
+ _email.add_init_data_done (standard);
+ }
+
+ return _email;
+ }
+ }
+
private static TypeSet _phone;
public static TypeSet phone {
get {
@@ -333,7 +348,7 @@ public class Contacts.TypeSet : Object {
// Make sure these strings are the same as the above
string[] standard = {
- "Mobile", "Work", "Home", "Work Fax", "Home Fax", "Pager"
+ "Mobile", "Work", "Home"
};
if (_phone == null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]