From 72e38bbeaa1a60477108c19ece84f2a98a2bddc3 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Wed, 17 Dec 2008 22:00:12 +0000 Subject: [PATCH] Before creating the EnumeratedListOption for the name formats we must get the list so we can use the value of the first entry. Otherwise you'll see "Value -1 not found for option..." on your command window. * src/plugins/Calendar.py svn: r11490 --- src/plugins/Calendar.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/Calendar.py b/src/plugins/Calendar.py index ecb56bf2c..e99957b1b 100644 --- a/src/plugins/Calendar.py +++ b/src/plugins/Calendar.py @@ -501,8 +501,11 @@ class CalendarOptions(MenuReportOptions): self.__update_filters() - name_format = EnumeratedListOption(_("Name format"), -1) - for num, name, fmt_str, act in name_displayer.get_name_format(): + # We must figure out the value of the first option before we can + # create the EnumeratedListOption + fmt_list = name_displayer.get_name_format() + name_format = EnumeratedListOption(_("Name format"), fmt_list[0][0]) + for num, name, fmt_str, act in fmt_list: name_format.add_item(num, name) name_format.set_help(_("Select the format to display names")) menu.add_option(category_name, "name_format", name_format)