class MainWindow(QtGui.QMainWindow, Ui_MainWindow): ''' this should move to a controller ''' def __init__(self): super(MainWindow, self).__init__() self.setupUi(self) self.setWindowTitle('MovEd') self.preview = Preview() # self.preview.set_movie_path(file_name) preview_dock = QtGui.QDockWidget() preview_dock.setWidget(self.preview) self.file_browser = FileBrowser() browser_dock = QtGui.QDockWidget() browser_dock.setWidget(self.file_browser) self.file_browser.doubleClicked.connect(self.onDoubleClick) self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, preview_dock) self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, browser_dock) # self.thumber = Thumber() # self.thumber.start() def closeEvent(self, event): self.preview.close() self.preview = None del self.preview def onDoubleClick(self, index): if not self.file_browser.model.isDir(index): file_path = self.file_browser.model.filePath(index) self.preview.load_movie(file_path)
def __init__(self): super(MainWindow, self).__init__() self.setupUi(self) self.setWindowTitle('MovEd') self.preview = Preview() # self.preview.set_movie_path(file_name) preview_dock = QtGui.QDockWidget() preview_dock.setWidget(self.preview) self.file_browser = FileBrowser() browser_dock = QtGui.QDockWidget() browser_dock.setWidget(self.file_browser) self.file_browser.doubleClicked.connect(self.onDoubleClick) self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, preview_dock) self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, browser_dock)