#!/usr/bin/env python
import sys
import os, time
from PyQt4 import QtCore, QtGui
from backUpUi import Ui_MainWindow
class setText01Thread
(QtCore.
QThread):
def __init__(self, mw):
super(setText01Thread, self).__init__(mw)
def run(self):
self.emit(QtCore.SIGNAL('setStatus'))
"""UI functionality to pack stuff for client"""
def __init__(self,parent=None):
super(backUpMain, self).__init__(parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.connect(self.ui.okButton, QtCore.SIGNAL("clicked()"), self._handlebackUp)
self.ui.cancelButton.released.connect(self.close)
self.statusTh = setText01Thread(self)
self.connect(self.statusTh, QtCore.SIGNAL('setStatus'), self.updateText_01,QtCore.Qt.QueuedConnection)
def updateText_01(self):
self.ui.okButton.setText("Processing Started")
def _handlebackUp(self):
self.statusTh.start()
self.ui.logEdit.clear()
.
.
outPutFileName = self.ui.outEdit.text()
inputData = self.getInputContent(self.ui.filePathEdit.text())
# indPath = self.getIndPathFromShotgun(projectId,"sg_ind_path_to_frames")
# the above line takes a long time to execute. Can this def be executed in another
# thread
.
.
.
def main():
dialog = backUpMain()
dialog.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
#!/usr/bin/env python
import sys
import os, time
from PyQt4 import QtCore, QtGui
from backUpUi import Ui_MainWindow
class setText01Thread(QtCore.QThread):
def __init__(self, mw):
super(setText01Thread, self).__init__(mw)
def run(self):
self.emit(QtCore.SIGNAL('setStatus'))
class backUpMain(QtGui.QMainWindow):
"""UI functionality to pack stuff for client"""
def __init__(self,parent=None):
super(backUpMain, self).__init__(parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.connect(self.ui.okButton, QtCore.SIGNAL("clicked()"), self._handlebackUp)
self.ui.cancelButton.released.connect(self.close)
self.statusTh = setText01Thread(self)
self.connect(self.statusTh, QtCore.SIGNAL('setStatus'), self.updateText_01,QtCore.Qt.QueuedConnection)
def updateText_01(self):
self.ui.okButton.setText("Processing Started")
def _handlebackUp(self):
self.statusTh.start()
self.ui.logEdit.clear()
.
.
outPutFileName = self.ui.outEdit.text()
inputData = self.getInputContent(self.ui.filePathEdit.text())
# indPath = self.getIndPathFromShotgun(projectId,"sg_ind_path_to_frames")
# the above line takes a long time to execute. Can this def be executed in another
# thread
.
.
.
def main():
app = QtGui.QApplication(sys.argv)
dialog = backUpMain()
dialog.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
To copy to clipboard, switch view to plain text mode
Bookmarks