Adding a scroll bar to the job submit UI.

Discussion and Support of Deadline, the Render Management System
User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Adding a scroll bar to the job submit UI.

Postby ruswetherell » Mon Jul 17, 2017 11:41 am

Does anyone know how to add a scroll bar to the job submit UI? At the moment I am having to use scriptControl.AddGroupBox()

User avatar
MikeOwen
Posts: 3492
Joined: Thu Jul 19, 2007 5:00 am
Location: London, UK
Contact:

Re: Adding a scroll bar to the job submit UI.

Postby MikeOwen » Tue Jul 18, 2017 3:30 am

A multiline control will automatically display a scroll-bar when necessary.

Monitor -> Scripts -> Misc -> Script UI Example

Screen Shot 2017-07-18 at 09.29.50.png
Screen Shot 2017-07-18 at 09.29.50.png (146.57 KiB) Viewed 53 times
Mike Owen
Solutions Architect
Thinkbox / AWS

User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Re: Adding a scroll bar to the job submit UI.

Postby ruswetherell » Tue Jul 18, 2017 3:59 am

Hey Mike, thanks for getting back to me. I had thought about the multi file approach, but was not entirely sure it was appropriate for the problem I have.We have never had more than 30 shots before to slate and concatenate, so it hasn't been a problem. This current show has 70+, and although I can at least collapse the group and get to the submit button, it would be great to be able to get to the shots > 45 to amend any frame ranges or slate info. Yes, I could group in sets of 10, but surely a UI scroll is neater?

Capture.PNG
Capture.PNG (167.3 KiB) Viewed 52 times

User avatar
MikeOwen
Posts: 3492
Joined: Thu Jul 19, 2007 5:00 am
Location: London, UK
Contact:

Re: Adding a scroll bar to the job submit UI.

Postby MikeOwen » Tue Jul 18, 2017 5:05 am

ok, gotcha. If you remove the groupbox and add all the controls to a UI grid, it should present a scroll-bar. I need to check.
Mike Owen
Solutions Architect
Thinkbox / AWS

User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Re: Adding a scroll bar to the job submit UI.

Postby ruswetherell » Tue Jul 18, 2017 6:06 am

They are/were already using AddControlToGrid("ButtonControl", LabelControl", "TextControl, etc).

User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Re: Adding a scroll bar to the job submit UI.

Postby ruswetherell » Tue Jul 18, 2017 7:21 am

Hey Mike, in the mean time i've added a bit of crude code to keep us going, so no hurry. Cheers.

Code: Select all

groupSize = 20   
shotNumbers = range(jobCount+1)   
shotGroups = [ shotNumbers[i:i+groupSize] for i in range(1, jobCount+1, groupSize) ]
   
for group in shotGroups:
   scriptDialog.AddGroupBox( "GroupBox4", "Shots %s-%s" % (group[0], group[-1]), True )
   scriptDialog.AddGrid()
   for shot in group:
      scriptDialog.AddControlToGrid( 'ShotBox%s' % shot, "TextControl", '', shot+10, 0,)
      scriptDialog.AddControlToGrid( 'VersionListBox%s' % shot, "TextControl", "", shot+10, 1, colSpan=4)
      scriptDialog.AddControlToGrid( 'TakeListBox%s' % shot, "TextControl", '', shot+10, 5,) 
      scriptDialog.AddControlToGrid( 'FrameRangeListBox%s' % shot, "TextControl", "", shot+10, 6,)
      scriptDialog.AddControlToGrid( 'AudioFileListBox%s' % shot, "TextControl", "", shot+10, 7, colSpan=4)       
      scriptDialog.AddControlToGrid( 'IDListBox%s' % shot, "ReadOnlyTextControl", "", shot+10, 11, colSpan=2)
      scriptDialog.AddControlToGrid( 'OutFileListBox%s' % shot, "ReadOnlyTextControl", "", shot+10, 13, colSpan=7)
   scriptDialog.EndGrid()
   scriptDialog.EndGroupBox( True )

User avatar
MikeOwen
Posts: 3492
Joined: Thu Jul 19, 2007 5:00 am
Location: London, UK
Contact:

Re: Adding a scroll bar to the job submit UI.

Postby MikeOwen » Tue Jul 18, 2017 7:40 am

I'll add a RFE for QScrollArea support in our Scripting UI. However, as we inherit from PyQt, you can implement a custom UI directly yourself today.

Here's a quick and dirty example for you:

Code: Select all

import sys

from System.IO import *

from Deadline.Scripting import *

from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *

import PyQt5.QtCore, PyQt5.QtWidgets, PyQt5.QtGui

########################################################################
## Globals
########################################################################
dialog = None

########################################################################
## Custom QDialog with some basic controls.
########################################################################
class CustomQtDialog(QDialog):

    def __init__(self, parent=None):
        super( CustomQtDialog, self ).__init__( parent )

        #set the main layout as a vertical one
        self.mainLayout = QVBoxLayout()
        self.setLayout( self.mainLayout )

        self.myGroupBox = QGroupBox('this is my groupbox')
        myform = QFormLayout()
        labellist = []
        combolist = []
        for i in range(30):
            labellist.append( QLabel('mylabel') )
            combolist.append( QComboBox() )
            myform.addRow( labellist[i],combolist[i] )
        self.myGroupBox.setLayout( myform )
        scroll = QScrollArea()
        scroll.setWidget( self.myGroupBox )
        scroll.setWidgetResizable( True )
        scroll.setFixedHeight( 400 )
        self.mainLayout.addWidget(scroll)

        # Close button
        self.buttonLayout = QHBoxLayout()
        self.closeButton = QPushButton( "Close" )
        self.buttonLayout.addWidget( self.closeButton )

        self.mainLayout.addLayout( self.buttonLayout )

        #hook up the button signals to our slots
        self.closeButton.clicked.connect( self.closeButtonPressed )

    @pyqtSlot( bool )
    def closeButtonPressed( self, checked ):
        self.done( 0 )

########################################################################
## Main Function Called By Deadline
########################################################################
def __main__():
    global dialog

    #Create an instance of our custom dialog, and show it
    dialog = CustomQtDialog()
    dialog.setVisible( True )


CustomQtDialog.py.zip
(1.26 KiB) Downloaded 2 times
Mike Owen
Solutions Architect
Thinkbox / AWS

User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Re: Adding a scroll bar to the job submit UI.

Postby ruswetherell » Tue Jul 18, 2017 1:46 pm

Awesome, thanks Mike. I have been avoiding it for far too long, but it looks like I will have to finally retire Tkinter and take the plunge in to PyQt. :oops:

User avatar
MikeOwen
Posts: 3492
Joined: Thu Jul 19, 2007 5:00 am
Location: London, UK
Contact:

Re: Adding a scroll bar to the job submit UI.

Postby MikeOwen » Thu Jul 20, 2017 4:33 am

Hi,
Turns out there is a way to do this easily. The property was added quietly by another developer a little while ago and I simply hadn't noticed it in the docs! Seven curses to the gods of the new world and the old. Oops. Too much GoT this week. 8-)

https://docs.thinkboxsoftware.com/produ ... 7884fe77eb

So, when you add a TabPage and you need it to be scrollable:

Code: Select all

scriptDialog.AddTabPage( "Conform Stack", True )
Mike Owen
Solutions Architect
Thinkbox / AWS

User avatar
ruswetherell
Posts: 8
Joined: Tue May 12, 2015 12:15 pm

Re: Adding a scroll bar to the job submit UI.

Postby ruswetherell » Thu Jul 20, 2017 6:53 am

:lol: Well that was easy!


Return to “Thinkbox Software - Deadline”

Who is online

Users browsing this forum: No registered users and 1 guest