Hello s093294,
from PySide import QtGui, QtCore
import PhotoScan
def process_something():
doc = PhotoScan.app.document
try:
chunk = doc.activeChunk
chunk.matchPhotos("medium")
chunk.alignPhotos()
except:
PhotoScan.app.messageBox("There was a problem processing your request.")
def create_dlg():
app = QtGui.QApplication.instance()
parent = app.activeWindow()
dlg = QtGui.QDialog(parent)
dlg.setWindowTitle("Test")
dlg.resize(800, 500)
btnQuit = QtGui.QPushButton("&Exit",dlg)
btnQuit.resize(150,50)
btnQuit.move(600,400)
btnP = QtGui.QPushButton("&Process",dlg)
btnP.resize(150,50)
btnP.move(100,400)
lblP = QtGui.QLabel("Aligns photos in current chunk", dlg)
lblP.move(100,450)
QtCore.QObject.connect(btnP, QtCore.SIGNAL("clicked()"), process_something)
QtCore.QObject.connect(btnQuit, QtCore.SIGNAL("clicked()"), dlg, QtCore.SLOT("reject()"))
print("Testing successfull. Dialog created.")
dlg.exec()
label = "New Menu/Custom GUI window"
PhotoScan.app.addMenuItem(label, create_dlg)