mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
clean up & cosmetic fix
This commit is contained in:
parent
682d8e6b05
commit
3ece2a8fcf
2 changed files with 11 additions and 6 deletions
|
|
@ -2362,7 +2362,7 @@ class WorkfileSettings(object):
|
|||
from openpype.widgets import custom_popup
|
||||
parent = get_main_window()
|
||||
dialog = custom_popup.CustomScriptDialog(parent=parent)
|
||||
dialog.setWindowTitle("Frame Range for Read Node")
|
||||
dialog.setWindowTitle("Frame Range")
|
||||
dialog.set_name("Frame Range: ")
|
||||
dialog.set_line_edit("%s - %s" % (nuke.root().firstFrame(),
|
||||
nuke.root().lastFrame()))
|
||||
|
|
@ -2371,9 +2371,12 @@ class WorkfileSettings(object):
|
|||
dialog.on_clicked.connect(
|
||||
lambda: set_frame_range(frame, selection)
|
||||
)
|
||||
|
||||
def set_frame_range(frame, selection):
|
||||
frame_range = frame.text()
|
||||
selected = selection.isChecked()
|
||||
if not nuke.allNodes("Read"):
|
||||
return
|
||||
for read_node in nuke.allNodes("Read"):
|
||||
if selected:
|
||||
if not nuke.selectedNodes():
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
on_line_changed = QtCore.Signal(str)
|
||||
|
||||
def __init__(self, parent=None, *args, **kwargs):
|
||||
super(CustomScriptDialog, self).__init__(parent=parent, *args, **kwargs)
|
||||
super(CustomScriptDialog, self).__init__(parent=parent,
|
||||
*args,
|
||||
**kwargs)
|
||||
self.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
# Layout
|
||||
|
|
@ -30,7 +32,7 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
|
||||
# Increase spacing slightly for readability
|
||||
line_layout.setSpacing(10)
|
||||
button_layout.setSpacing(8)
|
||||
button_layout.setSpacing(10)
|
||||
name = QtWidgets.QLabel("")
|
||||
name.setStyleSheet("""
|
||||
QLabel {
|
||||
|
|
@ -47,7 +49,7 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
has_selection = QtWidgets.QCheckBox()
|
||||
button = QtWidgets.QPushButton("Execute")
|
||||
button.setSizePolicy(QtWidgets.QSizePolicy.Maximum,
|
||||
QtWidgets.QSizePolicy.Maximum)
|
||||
QtWidgets.QSizePolicy.Maximum)
|
||||
cancel = QtWidgets.QPushButton("Cancel")
|
||||
cancel.setSizePolicy(QtWidgets.QSizePolicy.Maximum,
|
||||
QtWidgets.QSizePolicy.Maximum)
|
||||
|
|
@ -62,7 +64,7 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
layout.addLayout(selection_layout)
|
||||
layout.addLayout(button_layout)
|
||||
# Default size
|
||||
self.resize(100, 30)
|
||||
self.resize(100, 40)
|
||||
|
||||
self.widgets = {
|
||||
"name": name,
|
||||
|
|
@ -107,7 +109,6 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
self.on_line_changed.emit(line_edit)
|
||||
return self.set_line_edit(line_edit)
|
||||
|
||||
|
||||
def _on_clicked(self):
|
||||
"""Callback for when the 'show' button is clicked.
|
||||
|
||||
|
|
@ -129,6 +130,7 @@ class CustomScriptDialog(QtWidgets.QDialog):
|
|||
# Position popup based on contents on show event
|
||||
return super(CustomScriptDialog, self).showEvent(event)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def application():
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue