Added support for page blocks in menues

Now allows to add separators in the menu that forces a page jump,
allowing to group videos in pages.
This commit is contained in:
Sergio Costas 2019-01-04 12:37:04 +01:00
parent c222c4ab14
commit 6d1b166f2d
4 changed files with 56 additions and 24 deletions

View file

@ -203,6 +203,7 @@ class devede_project:
else:
if element.element_type != "file_movie":
self.wpreview_file.set_sensitive(False)
self.wproperties_file.set_sensitive(False)
nfiles = len(self.wfiles.get_model())
if (nfiles < 1):
self.wdelete_file.set_sensitive(False)
@ -217,7 +218,10 @@ class devede_project:
def on_cellrenderertext4_toggled(self, widget, path):
element = self.wliststore_files[path][0]
element.set_show_in_menu(False if widget.get_active() else True)
if element.element_type == "file_movie":
element.set_show_in_menu(False if widget.get_active() else True)
else:
element.set_page_jump(False if widget.get_active() else True)
def on_use_pal_toggled(self, b):
self.config.PAL = self.wuse_pal.get_active()
@ -279,7 +283,7 @@ class devede_project:
new_file.connect('title_changed', self.title_changed)
new_file.connect('in_menu_changed', self.in_menu_changed)
self.wliststore_files.append([new_file, new_file.title_name, True, self.duration_to_string(
new_file.get_duration()), new_file.show_in_menu])
new_file.get_duration()), new_file.show_in_menu, _("In menu")])
if (len(error_list) != 0):
devedeng.message.message_window(_("The following files could not be added:"), _(
"Error while adding files"), error_list)
@ -727,13 +731,13 @@ class devede_project:
new_file.connect('title_changed', self.title_changed)
new_file.connect('in_menu_changed', self.in_menu_changed)
self.wliststore_files.append([new_file, new_file.title_name, True, self.duration_to_string(
new_file.get_duration()), new_file.show_in_menu])
new_file.get_duration()), new_file.show_in_menu, _("In menu")])
else:
new_separator = devedeng.separator.separator()
new_separator.restore_element(element)
new_separator.connect('name_changed', self.title_changed)
new_separator.connect('in_menu_changed', self.in_menu_changed)
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", True])
new_separator.connect('page_jump_changed', self.in_menu_changed)
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", new_separator.page_jump, _("Page jump")])
if (len(error_list) != 0):
devedeng.message.message_window(_("The following files in the project could not be added again:"), _("Error while adding files"), error_list)
self.set_interface_status(None)
@ -754,7 +758,7 @@ class devede_project:
def on_add_separator_clicked(self, b):
new_separator = devedeng.separator.separator()
new_separator.connect('name_changed', self.title_changed)
new_separator.connect('in_menu_changed', self.in_menu_changed)
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", True])
new_separator.connect('page_jump_changed', self.in_menu_changed)
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", False, _("Page jump")])
self.set_interface_status(None)
self.refresh_disc_usage()