QObject.connect( self.chooseaction, SIGNAL("mergePhotos()"), self.mergePhotos)
QObject.connect( self.chooseaction, SIGNAL("exportDocument(QString)"), self.exportDocumentSlot)
QObject.connect( self.editperson, SIGNAL("done()"), self.returnToMainMenu)
+ QObject.connect( self.mergephotos, SIGNAL("done()"), self.returnToMainMenu)
QObject.connect( self, SIGNAL("databaseChanged(QString)"), self.editperson.updateDB)
QObject.connect( self, SIGNAL("mergeDone()"), self.editperson.reselect )
self.center.setCurrentWidget(self.editperson)
def mergePhotos(self):
print "beginning photo merge"
- self.mergephotos.beginMerge()
+ self.center.setCurrentWidget(self.mergephotos)
+ #self.mergephotos.beginMerge()
def exportDocumentSlot(self, filename):
writer = ODTWriter(self.db)
writer.write(filename)
QWidget.__init__(self, parent)
self.db = db
self.layout = QGridLayout()
- self.label = QLabel("Content goes here")
- self.layout.addWidget(self.label,0,0)
+ self.label = QLabel("<h2>Importing Photos</h2>")
+ self.label.setAlignment(Qt.AlignCenter)
+
+ self.button1 = QCommandLinkButton("Merge photos by NetID", "Add photos to records without photos by importing photos named <netid>.jpg")
+ self.button2 = QCommandLinkButton("Merge photos by timestamp", "Add photos to records without photos by sorting records and photos by creation time and matching pairs")
+ self.button3 = QCommandLinkButton("Cancel", "Return to main menu")
+ QObject.connect( self.button1, SIGNAL("clicked()"), self.beginMergeNetID )
+ QObject.connect( self.button2, SIGNAL("clicked()"), self.beginMergeTimestamp )
+ QObject.connect( self.button3, SIGNAL("clicked()"), self.done )
+ self.layout.addWidget(self.label,0,0,1,3)
+ self.layout.addWidget(self.button1,1,1,1,1)
+ self.layout.addWidget(self.button2,2,1,1,1)
+ self.layout.addWidget(self.button3,3,1,1,1)
self.setLayout(self.layout)
- def beginMerge(self):
+ def beginMergeNetID(self):
foldertext = QFileDialog.getExistingDirectory( None, "Pick folder of photos", ".")
if not foldertext.isEmpty():
print foldertext
update_q.bindValue(":id", q.value(col_id))
update_q.exec_()
print "Auto-imported photo for",q.value(col_netid).toString()
+ self.done()
+
+ def beginMergeTimestamp(self):
+ print "merging by timestamp"
+ self.done()
+
+ def done(self):
+ self.emit(SIGNAL("done()") )