Commit c222c4ab authored by Sergio Costas's avatar Sergio Costas

Allow to add separator

Until now, all the menu entries were shown in a continuous list, one
after another. This patch allows to add separators between entries.
parent 8719778d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -56,8 +56,15 @@ class dvdauthor_converter(devedeng.executor.executor):
self.progress_bar[1].set_text(data[0])
return
def create_dvdauthor_xml(self, movie_folder, file_movies, menu_entries, start_with_menu, play_all_opt, menuWide):
def create_dvdauthor_xml(self, movie_folder, file_movies_in, menu_entries, start_with_menu, play_all_opt, menuWide):
file_movies = []
for element in file_movies_in:
if element.element_type != "file_movie":
continue
file_movies.append(element)
print(file_movies)
xmlpath = os.path.join(movie_folder, "xml_data")
xml_file_path = os.path.join(xmlpath, "dvdauthor.xml")
datapath = os.path.join(movie_folder, "dvd_tree")
......@@ -243,16 +250,14 @@ class dvdauthor_converter(devedeng.executor.executor):
xml_file.write('\t\t\t\t\tg0=1;\n')
xml_file.write('\t\t\t\t\tjump vmgm menu;\n')
else:
xml_file.write(
'\t\t\t\t\tg0=' + str(title_list[title_counter]) + ';\n')
xml_file.write('\t\t\t\t\tg0={:};\n'.format(str(title_list[title_counter])))
xml_file.write('\t\t\t\t\tjump vmgm menu;\n')
title_counter += 1
button_counter += 1
xml_file.write('\t\t\t\t</button>\n')
if (menu_page["left"] is not None):
xml_file.write('\t\t\t\t<button name="' +
menu_page["left"] + '"> g1=')
xml_file.write('\t\t\t\t<button name="' + menu_page["left"] + '"> g1=')
xml_file.write(str(menu_number - 1))
xml_file.write('; g2=1024; jump menu ')
xml_file.write(str(menu_number))
......
......@@ -34,6 +34,7 @@ class file_movie(devedeng.interface_manager.interface_manager):
def __init__(self, file_name, list_files=None):
self.element_type = "file_movie"
self.list_files = list_files
devedeng.interface_manager.interface_manager.__init__(self)
......@@ -201,7 +202,7 @@ class file_movie(devedeng.interface_manager.interface_manager):
self.aspect_ratio_final = None
self.converted_filename = None
def set_title(self, new_title):
def set_name(self, new_title):
self.title_name = new_title
self.emit('title_changed', self.title_name)
......@@ -428,20 +429,16 @@ class file_movie(devedeng.interface_manager.interface_manager):
self.original_height * midle_aspect_ratio / self.aspect_ratio_final)
def set_type(self, obj=None, disc_type=None):
if (disc_type is not None):
self.disc_type = disc_type
def delete_file(self):
def delete_element(self):
return
def on_help_clicked(self, b):
devedeng.help.help("file.html")
help_file = devedeng.help.help("file.html")
def properties(self):
if (self.wfile_properties is not None):
self.wfile_properties.present()
return
......@@ -747,24 +744,20 @@ class file_movie(devedeng.interface_manager.interface_manager):
disc_player.play_film(os.path.join(
self.config.tmp_folder, "movie_preview.mpg"))
def store_file(self):
def store_element(self):
data = self.serialize()
if "files_to_set" in data:
del data["files_to_set"]
data["element_type"] = "file_movie"
return data
def restore_file(self, data):
def restore_element(self, data):
self.unserialize(data)
def on_select_all_clicked(self, b):
sel = self.wtreeview_multiproperties.get_selection()
sel.select_all()
def on_unselect_all_clicked(self, b):
sel = self.wtreeview_multiproperties.get_selection()
sel.unselect_all()
This diff is collapsed.
# Copyright 2019 (C) Raster Software Vigo (Sergio Costas)
#
# This file is part of DeVeDe-NG
#
# DeVeDe-NG is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# DeVeDe-NG is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from gi.repository import Gtk, GObject
import os
import devedeng.configuration_data
import devedeng.interface_manager
class separator(devedeng.interface_manager.interface_manager):
__gsignals__ = {'name_changed': (GObject.SIGNAL_RUN_FIRST, None, (str,)), 'in_menu_changed': (
GObject.SIGNAL_RUN_FIRST, None, (bool,))}
def __init__(self):
self.element_type = "separator"
devedeng.interface_manager.interface_manager.__init__(self)
self.add_toggle("show_in_menu", True)
self.add_text("separator_name", _("Separator"))
def set_name(self, new_name):
self.separator_name = new_name
self.emit('name_changed', self.separator_name)
def delete_element(self):
return
def store_element(self):
data = self.serialize()
data["element_type"] = "separator"
return data
def restore_element(self, data):
self.unserialize(data)
\ No newline at end of file
......@@ -43,6 +43,8 @@ class vcdimager_converter(devedeng.executor.executor):
else:
self.command_var.append("svcd")
for element in file_movies:
if element.element_type != "file_movie":
continue
self.command_var.append(element.converted_filename)
self.text = _("Creating CD image")
......
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