Now uses the menu title as the volume name

This patch uses the menu title as the volume name for the DVD image.
This way, when mounted in a computer, instead of "DVDVIDEO", the user
will see the menu title (unless there is no menu title; in that case,
"DVDVIDEO" will be used).
This commit is contained in:
Sergio Costas 2019-07-21 18:33:02 +02:00
parent cdfb3c7530
commit 0cdb5934a5
3 changed files with 19 additions and 6 deletions

View file

@ -51,16 +51,21 @@ class genisoimage(devedeng.executor.executor):
devedeng.executor.executor.__init__(self) devedeng.executor.executor.__init__(self)
self.config = devedeng.configuration_data.configuration.get_config() self.config = devedeng.configuration_data.configuration.get_config()
def create_iso(self, path, name): def create_iso(self, path, name, title):
filesystem_path = os.path.join(path, "dvd_tree") filesystem_path = os.path.join(path, "dvd_tree")
final_path = os.path.join(path, name + ".iso") final_path = os.path.join(path, name + ".iso")
if title == "":
final_title = "DVDVIDEO"
else:
final_title = title.upper().replace(" ", "_")[:31]
self.command_var = [] self.command_var = []
self.command_var.append("genisoimage") self.command_var.append("genisoimage")
self.command_var.append("-dvd-video") self.command_var.append("-dvd-video")
self.command_var.append("-V") self.command_var.append("-V")
self.command_var.append("DVDVIDEO") self.command_var.append(final_title)
self.command_var.append("-v") self.command_var.append("-v")
self.command_var.append("-udf") self.command_var.append("-udf")
self.command_var.append("-o") self.command_var.append("-o")

View file

@ -51,16 +51,21 @@ class mkisofs(devedeng.executor.executor):
devedeng.executor.executor.__init__(self) devedeng.executor.executor.__init__(self)
self.config = devedeng.configuration_data.configuration.get_config() self.config = devedeng.configuration_data.configuration.get_config()
def create_iso(self, path, name): def create_iso(self, path, name, title):
filesystem_path = os.path.join(path, "dvd_tree") filesystem_path = os.path.join(path, "dvd_tree")
final_path = os.path.join(path, name + ".iso") final_path = os.path.join(path, name + ".iso")
if title == "":
final_title = "DVDVIDEO"
else:
final_title = title.upper().replace(" ", "_")[:31]
self.command_var = [] self.command_var = []
self.command_var.append("mkisofs") self.command_var.append("mkisofs")
self.command_var.append("-dvd-video") self.command_var.append("-dvd-video")
self.command_var.append("-V") self.command_var.append("-V")
self.command_var.append("DVDVIDEO") self.command_var.append(final_title)
self.command_var.append("-v") self.command_var.append("-v")
self.command_var.append("-udf") self.command_var.append("-udf")
self.command_var.append("-o") self.command_var.append("-o")

View file

@ -579,7 +579,10 @@ class devede_project:
cv = devedeng.converter.converter.get_converter() cv = devedeng.converter.converter.get_converter()
isocreator = cv.get_mkiso()() isocreator = cv.get_mkiso()()
isocreator.create_iso(data.path, data.name) title = self.menu.title_text
if title is None:
title = ""
isocreator.create_iso(data.path, data.name, title.strip())
isocreator.add_dependency(dvdauthor) isocreator.add_dependency(dvdauthor)
run_window.add_process(isocreator) run_window.add_process(isocreator)
self.disc_image_name = os.path.join(data.path, data.name + ".iso") self.disc_image_name = os.path.join(data.path, data.name + ".iso")
@ -763,4 +766,4 @@ class devede_project:
new_separator.connect('page_jump_changed', self.in_menu_changed) 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.wliststore_files.append([new_separator, new_separator.separator_name, True, "", False, _("Page jump")])
self.set_interface_status(None) self.set_interface_status(None)
self.refresh_disc_usage() self.refresh_disc_usage()