job_status: add extra info to print list and dialog
This commit is contained in:
parent
e39c286f00
commit
bb8031ce89
@ -71,7 +71,7 @@ class Panel(ScreenPanel):
|
|||||||
logging.info(f"Thumbsize: {self.thumbsize}")
|
logging.info(f"Thumbsize: {self.thumbsize}")
|
||||||
|
|
||||||
self.flowbox = Gtk.FlowBox(selection_mode=Gtk.SelectionMode.NONE,
|
self.flowbox = Gtk.FlowBox(selection_mode=Gtk.SelectionMode.NONE,
|
||||||
column_spacing=0, row_spacing=0, homogeneous=True)
|
column_spacing=0, row_spacing=0)
|
||||||
list_mode = self._config.get_main_config().get("print_view", 'thumbs')
|
list_mode = self._config.get_main_config().get("print_view", 'thumbs')
|
||||||
logging.info(list_mode)
|
logging.info(list_mode)
|
||||||
self.list_mode = list_mode == 'list'
|
self.list_mode = list_mode == 'list'
|
||||||
@ -314,14 +314,21 @@ class Panel(ScreenPanel):
|
|||||||
label = Gtk.Label(hexpand=True, vexpand=True, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR)
|
label = Gtk.Label(hexpand=True, vexpand=True, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR)
|
||||||
label.set_markup(f"<b>{filename}</b>\n")
|
label.set_markup(f"<b>{filename}</b>\n")
|
||||||
|
|
||||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, vexpand=True)
|
||||||
box.add(label)
|
box.pack_start(label, False, False, 0)
|
||||||
|
|
||||||
height = (self._screen.height - self._gtk.dialog_buttons_height - self._gtk.font_size) * .75
|
height = (self._screen.height - self._gtk.dialog_buttons_height - self._gtk.font_size * 5) * .75
|
||||||
pixbuf = self.get_file_image(filename, self._screen.width * .9, height)
|
pixbuf = self.get_file_image(filename, self._screen.width * .9, height)
|
||||||
if pixbuf is not None:
|
if pixbuf is not None:
|
||||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||||
box.add(image)
|
box.pack_start(image, True, True, 0)
|
||||||
|
|
||||||
|
fileinfo = self._screen.files.get_file_info(filename)
|
||||||
|
if "estimated_time" in fileinfo:
|
||||||
|
box.pack_start(
|
||||||
|
Gtk.Label(label=_("Print Time") + f': {self.format_time(fileinfo["estimated_time"])}'),
|
||||||
|
False, False, 2
|
||||||
|
)
|
||||||
|
|
||||||
self._gtk.Dialog(_("Print") + f' {filename}', buttons, box, self.confirm_print_response, filename)
|
self._gtk.Dialog(_("Print") + f' {filename}', buttons, box, self.confirm_print_response, filename)
|
||||||
|
|
||||||
@ -343,6 +350,12 @@ class Panel(ScreenPanel):
|
|||||||
info += _("Size") + f': <b>{self.format_size(item["size"])}</b>\n'
|
info += _("Size") + f': <b>{self.format_size(item["size"])}</b>\n'
|
||||||
if 'filename' in item:
|
if 'filename' in item:
|
||||||
fileinfo = self._screen.files.get_file_info(path)
|
fileinfo = self._screen.files.get_file_info(path)
|
||||||
|
if "layer_height" in fileinfo:
|
||||||
|
info += _("Layer Height") + f': <b>{fileinfo["layer_height"]}</b>' + _("mm") + '\n'
|
||||||
|
if "filament_type" in fileinfo:
|
||||||
|
info += _("Filament") + f': <b>{fileinfo["filament_type"]}</b>\n'
|
||||||
|
if "filament_name" in fileinfo:
|
||||||
|
info += f'<b>{fileinfo["filament_name"]}</b>\n'
|
||||||
if "estimated_time" in fileinfo:
|
if "estimated_time" in fileinfo:
|
||||||
info += _("Print Time") + f': <b>{self.format_time(fileinfo["estimated_time"])}</b>'
|
info += _("Print Time") + f': <b>{self.format_time(fileinfo["estimated_time"])}</b>'
|
||||||
return info
|
return info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user