* The format is basically a list of field names separated by a pipe and
* optionally parametrised. The parameters allows you to:
* <ul>
- * <li>@x: show only a present/not present info</li>
+ * <li>@x: (the 'x' is the letter 'x') show only a present/not present info</li>
* <li>@n: limit the size to a fixed value 'n'</li>
* <li>@+: expand the size of this field as much as possible</li>
* </ul>
# application colours
#
# Note that you can define a colour in one of those 3 ways:
-# - WHITE: one of the ANSI colour names, in uppercase
+# - WHITE: one of the ANSI colour names, in upper case
# - @RRGGBB: a RGB code we will try to match using one of the 256 Terminal colours
# - #RRGGBB: an exact RGB colour (please make sure your terminal supports this)
#
--- /dev/null
+# display options configuration
+
+# The contact list format is basically a list of VCF field names
+# separated by a pipe and optionally parametrised.
+# The parameters allows you to:
+# - @x: (the 'x' is the letter 'x') show only a present/not present info
+# - @n: limit the size to a fixed value 'n'
+# - @+: expand the size of this field as much as possible
+#
+# You can cycle through them if you have more than one
+# (in this case, separate them with a comma (',')
+CONTACT_LIST_FORMAT = NICKNAME@10|FN@+|EMAIL@30|PHOTO@x,FN@+|EMAIL@40
# English translation file (UTF-8)
+# Note that any key can be doubled with a _NOUTF suffix
+# to use when the flag --noutf is passed
# those 2 keys MUST be 3-characters long
KEY_TAB = TAB
# default translation file (UTF-8)
+# Note that any key can be doubled with a _NOUTF suffix
+# to use when the flag --noutf is passed
# those 2 keys MUST be 3-characters long
KEY_TAB = TAB
# French translation file (UTF-8)
+# Note : les clefs peuvent être suffixées de _NOUTF
+# pour forcer une autre version quand le flag --noutf
+# est passé au programme
# les deux touches qui suivent DOIVENT faire 3 caractères de long
KEY_TAB = TAB
import be.nikiroo.jvcard.Card;
import be.nikiroo.jvcard.Contact;
import be.nikiroo.jvcard.i18n.Trans;
+import be.nikiroo.jvcard.resources.Bundles;
import be.nikiroo.jvcard.tui.KeyAction;
import be.nikiroo.jvcard.tui.UiColors;
import be.nikiroo.jvcard.tui.KeyAction.DataType;
private List<Contact> contacts;
private String filter;
- private List<String> formats = new LinkedList<String>();
- private int selectedFormat = -1;
- private String format = "";
+ private List<String> formats;
+ private int selectedFormat;
+ private String format;
public ContactList(Card card) {
- // TODO: should get that in an INI file
- formats.add("NICKNAME@3|FN@+|EMAIL@30");
- formats.add("FN@+|EMAIL@40");
+ formats = new LinkedList<String>();
+ for (String format : Bundles.getBundle("display")
+ .getString("CONTACT_LIST_FORMAT").split(",")) {
+ formats.add(format);
+ }
+
+ selectedFormat = -1;
switchFormat();
setCard(card);