From 65fe51aef5a264f917e66387332745a0cfee3aeb Mon Sep 17 00:00:00 2001 From: Joe Yu Date: Tue, 9 Mar 2021 11:49:17 +0000 Subject: [PATCH 1/5] Fix message when no tasks accepted (#11) * Fix message when no tasks accepted * Scroll to last on log show * Tidy scroll logic --- python/tk_multi_publish2/dialog.py | 2 +- .../progress/progress_details_widget.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/python/tk_multi_publish2/dialog.py b/python/tk_multi_publish2/dialog.py index e2287cf2..d330a998 100644 --- a/python/tk_multi_publish2/dialog.py +++ b/python/tk_multi_publish2/dialog.py @@ -880,7 +880,7 @@ def _on_drop(self, files): self._overlay.show_loading() self.ui.button_container.hide() new_items = self._publish_manager.collect_files(str_files) - num_items_created = len(new_items) + num_items_created = len([item for item in new_items if item.tasks]) num_errors = self._progress_handler.pop() if num_errors == 0 and num_items_created == 0: diff --git a/python/tk_multi_publish2/progress/progress_details_widget.py b/python/tk_multi_publish2/progress/progress_details_widget.py index 81a84aa1..ebc5b80c 100644 --- a/python/tk_multi_publish2/progress/progress_details_widget.py +++ b/python/tk_multi_publish2/progress/progress_details_widget.py @@ -98,6 +98,19 @@ def show(self): self.__recompute_position() self.ui.log_tree.expandAll() + # Scroll to last item by default + def last_by_breadth_depth(item): + if item.childCount(): + last_child = item.child(item.childCount()) + if last_child: + return last_by_breadth_depth(last_child) + return item + + self.ui.log_tree.scrollToItem( + last_by_breadth_depth(self.ui.log_tree.invisibleRootItem()), + QtGui.QAbstractItemView.PositionAtCenter, + ) + @property def log_tree(self): """ From 2a9cd2c076b616364cd8a94410a40600360ac4cb Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Wed, 18 Nov 2020 17:16:40 +0000 Subject: [PATCH 2/5] Remove ChecksState prefix for PyQt --- .../publish_tree_widget/custom_widget_item.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/tk_multi_publish2/publish_tree_widget/custom_widget_item.py b/python/tk_multi_publish2/publish_tree_widget/custom_widget_item.py index b485cb98..241c1b14 100644 --- a/python/tk_multi_publish2/publish_tree_widget/custom_widget_item.py +++ b/python/tk_multi_publish2/publish_tree_widget/custom_widget_item.py @@ -63,10 +63,10 @@ def nextCheckState(self): """ # Qt tri-state logic is a little odd. The default behaviour is to go from unchecked # to partially checked. We want it to go from unchecked to checked - if self.ui.checkbox.checkState() == QtCore.Qt.CheckState.Checked: - next_state = QtCore.Qt.CheckState.Unchecked + if self.ui.checkbox.checkState() == QtCore.Qt.Checked: + next_state = QtCore.Qt.Unchecked else: - next_state = QtCore.Qt.CheckState.Checked + next_state = QtCore.Qt.Checked self.ui.checkbox.setCheckState(next_state) self._tree_node.set_check_state(next_state) From e5bd07ec7d3adca2d2fe3fc2b4e5bd15c020cfa4 Mon Sep 17 00:00:00 2001 From: Liam Hoflay Date: Mon, 4 Nov 2019 10:48:25 +0000 Subject: [PATCH 3/5] Feature/summary display (#6) * Adding better formatting to publish dialog for summaries. * Doc string added --- python/tk_multi_publish2/dialog.py | 1 + .../publish_tree_widget/tree_node_item.py | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/python/tk_multi_publish2/dialog.py b/python/tk_multi_publish2/dialog.py index e2287cf2..0822f1fd 100644 --- a/python/tk_multi_publish2/dialog.py +++ b/python/tk_multi_publish2/dialog.py @@ -696,6 +696,7 @@ def _create_item_details(self, tree_item): else: summary_text = "

The following items will be processed:

" + summary_text += "" summary_text += "".join(["

%s

" % line for line in summary]) self.ui.item_summary.setText(summary_text) diff --git a/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py b/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py index 5a0f4f44..d48be5d0 100644 --- a/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py +++ b/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py @@ -73,10 +73,13 @@ def __repr__(self): def __str__(self): return "%s %s" % (self._item.type_display, self._item.name) - def create_summary(self): + def create_summary(self, level=0): """ Creates summary of actions + :param level: Indentation level of this item lives within the tree. + :type level: int + :returns: List of strings """ if self.checked: @@ -91,16 +94,23 @@ def create_summary(self): task_summaries.extend(child_item.create_summary()) else: # sub-items - items_summaries.extend(child_item.create_summary()) + items_summaries.extend(child_item.create_summary(level + 1)) summary = [] if len(task_summaries) > 0: - summary_str = "%s
" % self.item.name - summary_str += "
".join( - ["– %s" % task_summary for task_summary in task_summaries] + summary_str = "
  • " * level + summary_str += "%s" % self.item.name + summary_str += '
      ' + summary_str += "".join( + [ + "
    • %s
    • " % task_summary + for task_summary in task_summaries + ] ) + summary_str += "
    " + summary_str += "
" * level summary.append(summary_str) summary.extend(items_summaries) From 2bd3ba1b3f829aa7690dcee2131b235c969c0530 Mon Sep 17 00:00:00 2001 From: Liam Hoflay Date: Wed, 29 Apr 2020 12:09:04 +0100 Subject: [PATCH 4/5] Explicit QIcon for Katana/PyQt (v2.3.4+wwfx.1.0.0) --- python/tk_multi_publish2/progress/progress_handler.py | 6 +++--- .../tk_multi_publish2/publish_tree_widget/tree_node_item.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/tk_multi_publish2/progress/progress_handler.py b/python/tk_multi_publish2/progress/progress_handler.py index ed438563..9da69e38 100644 --- a/python/tk_multi_publish2/progress/progress_handler.py +++ b/python/tk_multi_publish2/progress/progress_handler.py @@ -192,7 +192,7 @@ def process_log_message(self, message, status, action): item.setText(0, message) if icon: - item.setIcon(0, icon) + item.setIcon(0, QtGui.QIcon(icon)) if self._logging_parent_item: self._logging_parent_item.addChild(item) @@ -278,11 +278,11 @@ def push(self, text, icon=None, publish_instance=None): self._logging_parent_item.addChild(item) if icon: - item.setIcon(0, icon) + item.setIcon(0, QtGui.QIcon(icon)) self._icon_label.setPixmap(icon) elif self._current_phase: std_icon = self._icon_lookup[self._current_phase] - item.setIcon(0, std_icon) + item.setIcon(0, QtGui.QIcon(std_icon)) self._icon_label.setPixmap(std_icon) self._progress_details.log_tree.setCurrentItem(item) diff --git a/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py b/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py index 5a0f4f44..5aa417b5 100644 --- a/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py +++ b/python/tk_multi_publish2/publish_tree_widget/tree_node_item.py @@ -227,7 +227,7 @@ def double_clicked(self, column): else: icon = self._expanded_icon - self._embedded_widget.expand_indicator.setIcon(icon) + self._embedded_widget.expand_indicator.setIcon(QtGui.QIcon(icon)) def _check_expand_state(self): """ @@ -240,7 +240,7 @@ def _check_expand_state(self): else: icon = self._collapsed_icon - self._embedded_widget.expand_indicator.setIcon(icon) + self._embedded_widget.expand_indicator.setIcon(QtGui.QIcon(icon)) class TopLevelTreeNodeItem(TreeNodeItem): From 95fec447fded795c7f9c029abaad47f1a0070c0d Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Thu, 13 Aug 2020 17:46:45 +0100 Subject: [PATCH 5/5] Added tex, missing tif --- hooks/collector.py | 2 +- hooks/publish_file.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/collector.py b/hooks/collector.py index bc8acf32..ce4ab756 100644 --- a/hooks/collector.py +++ b/hooks/collector.py @@ -131,7 +131,7 @@ def common_file_info(self): "item_type": "file.image", }, "Texture Image": { - "extensions": ["tif", "tiff", "tx", "tga", "dds", "rat"], + "extensions": ["tif", "tiff", "tex", "tx", "tga", "dds", "rat"], "icon": self._get_icon_path("texture.png"), "item_type": "file.texture", }, diff --git a/hooks/publish_file.py b/hooks/publish_file.py index 690a9218..4a251fde 100644 --- a/hooks/publish_file.py +++ b/hooks/publish_file.py @@ -203,7 +203,7 @@ def settings(self): ["Photoshop Image", "psd", "psb"], ["VRED Scene", "vpb", "vpe", "osb"], ["Rendered Image", "dpx", "exr"], - ["Texture", "tiff", "tx", "tga", "dds"], + ["Texture", "tif", "tiff", "tex", "tx", "tga", "dds"], ["Image", "jpeg", "jpg", "png"], ["Movie", "mov", "mp4"], ["PDF", "pdf"],