Show Qmessagebox and create parent_item on startup (tk-multi-publish2.standalone)

Hey,

I want to show the user a Qmessagebox with 3 choice buttons before the Publisher starts up, the buttons will do different things but they are supposed to make a parent_item, essentially skipping the default startup screen for the standalone publisher (where it shows two buttons to select a file or folder to publish).

Is this possible?

I’ve added a

__init__(dummy, dummy2):

to the collector file as this seems to be the only way to trigger code without having to click buttons.

But my Qmessagebox fails to show from there :frowning:

Code:

def __init__(me, you):
    msgBox = QtGui.QMessageBox()
    msgBox.setText('Select App Mode')
    ingestBtn = msgBox.addButton('Ingest Media', QtGui.QMessageBox.YesRole)
    msgBox.exec_()
2 Likes

Hey Ricardo, I just tested you code, and that seems fine, I got it to work in the collector by adding it to the process_current_session method.
I guess after the user has picked an option, you could then go ahead and collect any files, and it should skip the default screen.

Best
Phil

2 Likes

I’ll test again!

Managed to get Tkinter working but would like to stray more to QtGui :wink:

Oh I did add from sgtk.platform.qt import QtGui to the top, not sure how you imported QtGui, but maybe that is the difference?

Yeah I did that too! :slight_smile:

Maybe I was just trying to run code in wrong places.