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


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:


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

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.



I’ll test again!

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

1 Like

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?

1 Like

Yeah I did that too! :slight_smile:

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

1 Like

Hey @Ricardo_Musch this may not be relevant or useful, but I just posted a new topic here which I thought might be of interest:

1 Like

VERY HANDY! :smiley:


Just to get back to this.

So I have a collector, I would like to display a QTGui window during collection to display some more UI.
The code is currently not in a separate class but in the collector function but either way the window appears and dissapears immediatly. and my collector continues. What could I be missing?

window = QtGui.QWidget()
window.setGeometry(50, 50, 300, 300)

You’re going to want a model window I think, like how a QMessageBox is handled.
I’ve done one before in the past, but I don’t have the code at hand unfortunately.

This might be the answer.

1 Like

Ah thats intersting, I’ll try it out :slight_smile:

1 Like