diff options
author | Erick Pérez Castellanos <erick.red@gmail.com> | 2012-12-19 16:15:26 -0500 |
---|---|---|
committer | Erick Pérez Castellanos <erick.red@gmail.com> | 2012-12-19 16:25:04 -0500 |
commit | 331f5babcb67b81261f0d5ee3a89836a74835df0 (patch) | |
tree | a4baa736a28716f7e6ad63dddea651fc7a621ca8 /src/contacts-types.vala | |
parent | d7558c4e46a9ca4510c1de1b09aefc0c0b494a8a (diff) | |
download | gnome-contacts-331f5babcb67b81261f0d5ee3a89836a74835df0.tar.gz |
Added TypeSet.email for handling Personal email.
Hiding Custom entry in TypeCombo widget.
Diffstat (limited to 'src/contacts-types.vala')
-rw-r--r-- | 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) { |