Commit 0162267b authored by Sergio Costas's avatar Sergio Costas

Ensure that all entries are shown in the menu

There were two errors in the menu generation:

- if there were no page jumps, the number of pages was always "one"
- in each page, one entry was missing (except for the first page,
where two entries were missing).

This patch fixes both
parent 0c52e141
......@@ -382,8 +382,18 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
entries_per_page -= 1
n_entries = len(self.title_list)
paint_arrows = False
if n_entries > entries_per_page:
paint_arrows = True
else:
for element in self.file_list:
if ((element.element_type == "separator") and element.page_jump):
paint_arrows = True
break
if paint_arrows:
entries_per_page -= 1
self.pages = 1
n_entries = 0
n_entries = 1
self.page_list = [0]
entry = 0
for element in self.file_list:
......@@ -392,15 +402,10 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
n_entries = 1
self.page_list.append(entry)
entry += 1
n_entries += 1
if (page_number > self.pages) and (page_number > 0):
page_number = self.pages - 1
if (self.pages > 1):
paint_arrows = True
entries_per_page -= 1
else:
paint_arrows = False
if self.wcurrent_page is not None:
self.wcurrent_page.set_text(_("Page {0} of {1}").format(page_number + 1, self.pages))
xl = left_margin_p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment