def __init__(self, delegate, usingExportDialog=False): QtGui.QDialog.__init__(self) self._clips = [] self._sequences = [] self.filePathsForUpload = [] # The Main FrameIOPySide AppDelegate self.delegate = delegate # The Dialog can work in two modes, as a popover from the Bin View or via the main App Export window self.usingExportDialog = usingExportDialog self.email = "" # setGeometry(x_pos, y_pos, width, height) self.setGeometry(240, 160, 726, 552) self.setStyleSheet('QWidget {background-color: #3B3E4A;} QLineEdit {color: #D0D5DC; border-color:#6F757F; border-width: 1px; border-radius: 4px; border-style: solid;} QLabel {color: #D0D5DC;}') self.setWindowTitle("Frame.io Uploader") #self.setAttribute( Qt.WA_TranslucentBackground, True ) self.setWindowFlags( Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint ) self.setMouseTracking(True) self.draggable = True self.dragging_threshold = 0 self.__mousePressPos = None self.__mouseMovePos = None layout = QtGui.QVBoxLayout(self) layout.setAlignment(Qt.AlignCenter) self.toolBar = QtGui.QToolBar() self.toolBar.setStyleSheet('QToolBar {background-color: #3B3E4A; border-width: 0px; border-radius: 0px; border-style: none; text-align: center}') self.toolBar.setIconSize( QSize(24,24) ) self.closeButton = QtGui.QPushButton("") self.closeButton.setStyleSheet('QPushButton {border: none;}') iconClose = QtGui.QIcon(os.path.join(gIconPath, "close.png")) self.closeButton.setIcon(iconClose) self.closeButton.clicked.connect(self.close) iconLogout = QtGui.QIcon(os.path.join(gIconPath, "logout.png")) self.logoutToolBarAction = createMenuAction("", self.logoutPressed, icon=iconLogout) self.logoutToolBarAction.setVisible(False) self.logoutToolBarAction.setToolTip("Click here to Log out") self.unconnectedIndicatorPixmap = QtGui.QPixmap(os.path.join(gIconPath, "logo-unconnected.png")) self.connectedIndicatorPixmap = QtGui.QPixmap(os.path.join(gIconPath, "logo-connected.png")) self.connectionIndicatorLabel = QtGui.QLabel("Unconnected") spacer = QtGui.QWidget() spacer.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.toolBar.addWidget(self.closeButton) self.toolBar.addWidget(spacer) self.toolBar.addWidget(self.connectionIndicatorLabel) self.toolBar.addAction(self.logoutToolBarAction) layout.addWidget(self.toolBar) pixmap = QtGui.QPixmap(os.path.join(gIconPath, "frameio.png")) lbl = QtGui.QLabel("") lbl.setPixmap(pixmap) lbl.setAlignment(Qt.AlignCenter) layout.addWidget(lbl) font = QtGui.QFont() font.setPointSize(20) self.topLabel = QtGui.QLabel("Login") self.topLabel.setFont(font) self.topLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.topLabel) self.statusLabel = QtGui.QLabel("") self.statusLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.statusLabel) self.stackView = QtGui.QStackedWidget(self) # Login Screen View self.loginView = QtGui.QWidget() self.loginViewLayout = QtGui.QVBoxLayout(self) self.loginViewLayout.setAlignment(Qt.AlignCenter) self.emailLineEdit = QtGui.QLineEdit() self.emailLineEdit.setPlaceholderText("E-mail") self.emailLineEdit.setFont(font) self.emailLineEdit.setAlignment(Qt.AlignCenter) self.emailLineEdit.setFixedWidth(370) self.emailLineEdit.setFixedHeight(60) if self.email: self.emailLineEdit.setText(self.email) self.emailLineEdit.setText("") # Validator for checking email address is valid namerx = QRegExp("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b") namerx.setCaseSensitivity(Qt.CaseInsensitive); namerx.setPatternSyntax(QRegExp.RegExp); self.nameval = QtGui.QRegExpValidator(namerx, self) self.emailLineEdit.setValidator(self.nameval) self.loginViewLayout.addWidget(self.emailLineEdit) self.passwordLineEdit = QtGui.QLineEdit() self.passwordLineEdit.setStyleSheet('') self.passwordLineEdit.setPlaceholderText("Password") self.passwordLineEdit.setFont(font) self.passwordLineEdit.setAlignment(Qt.AlignCenter) self.passwordLineEdit.setFixedWidth(370) self.passwordLineEdit.setFixedHeight(60) self.passwordLineEdit.setEchoMode(QtGui.QLineEdit.Password) # Initially hide the password field, as we typically log in as Google Auth self.passwordLineEdit.setVisible(False) self.loginViewLayout.addWidget(self.passwordLineEdit) self.submitButton = QtGui.QPushButton("LET'S GO") self.submitButton.setFlat(True) self.submitButton.setFont(font) self.submitButton.clicked.connect(self._submitButtonPressed) self.submitButton.setStyleSheet('QPushButton {width: 370px; height: 60px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #83DEBD; color: white;}' 'QPushButton:hover{background-color: #9974BA; }' 'QPushButton:pressed{background-color: #404040; border-width: 1px}') self.loginViewLayout.addWidget(self.submitButton) # This WebView is used for Google OAuth2 Login self.webView = QWebView(parent=self) self.loginViewLayout.addWidget(self.webView) self.webView.setVisible(False) self.loginView.setLayout(self.loginViewLayout) self.stackView.addWidget(self.loginView) ### TO-DO - handle uploading of Clips via drag-drop into a dropzone self.uploadFilesView = QtGui.QWidget() self.uploadFilesView.setAcceptDrops(True) # Not hooked up. self.uploadDropzoneLayout = QtGui.QVBoxLayout(self) self.uploadDropzoneLayout.setAlignment(Qt.AlignCenter) pixmap = QtGui.QPixmap(os.path.join(gIconPath, "uploadDropzone-64px.png")) uploadIcon = QtGui.QLabel("") uploadIcon.setPixmap(pixmap) uploadIcon.setAlignment(Qt.AlignCenter) self.uploadDropzoneLayout.addWidget(uploadIcon) self.uploadDropzoneLabel1 = QtGui.QLabel("Upload your files") self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) self.uploadDropzoneLabel1.setFont(font) self.uploadDropzoneLabel2 = QtGui.QLabel("Or choose files from picker...") self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel1) font.setPointSize(16) self.uploadDropzoneLabel2.setFont(font) self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel2) self.selectFilesButton = QtGui.QPushButton("Choose Files...") self.selectFilesButton.clicked.connect(self.showFilePicker) self.uploadDropzoneLayout.addWidget(self.selectFilesButton) self.uploadFilesView.setLayout(self.uploadDropzoneLayout) self.stackView.addWidget(self.uploadFilesView) ### View to handle uploading into a Project self.projectUploadView = QtGui.QWidget() self.projectUploadView.setStyleSheet('QPushButton {width: 100px; height: 100px; border-width: 0px; border-radius: 50px; border-style: solid; background-color: #9974BA; color: white;}') self.projectUploadViewLayout = QtGui.QVBoxLayout(self) self.projectUploadViewLayout.setAlignment(Qt.AlignCenter) self.uploadTopButtonWidget = QtGui.QWidget() self.uploadTopButtonLayout = QtGui.QHBoxLayout(self) self.uploadTopButtonLayout.setAlignment(Qt.AlignCenter) self.uploadTimelineOptionButton = QtGui.QPushButton("Timeline") self.uploadClipOptionButton = QtGui.QPushButton("Clips") self.uploadTimelineOptionButton.setCheckable(True) self.uploadTimelineOptionButton.setChecked(False) self.uploadTimelineOptionButton.setFont(font) self.uploadClipOptionButton.setCheckable(True) self.uploadClipOptionButton.setChecked(False) self.uploadClipOptionButton.setFont(font) self.uploadTopButtonLayout.addWidget(self.uploadTimelineOptionButton) self.uploadTopButtonLayout.addWidget(self.uploadClipOptionButton) self.uploadTopButtonWidget.setLayout(self.uploadTopButtonLayout) self.uploadBottomButtonWidget = QtGui.QWidget() self.uploadBottomButtonLayout = QtGui.QHBoxLayout(self) self.uploadBottomButtonLayout.setAlignment(Qt.AlignCenter) self.uploadCancelButton = QtGui.QPushButton("Cancel") self.uploadCancelButton.setStyleSheet('QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #767C8E; color: white;}') self.uploadCancelButton.clicked.connect(self.close) self.uploadTaskButton = QtGui.QPushButton("Done") self.uploadTaskButton.setStyleSheet('QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; color: white;}') self.uploadTaskButton.clicked.connect(self._uploadButtonPushed) font.setPointSize(20) self.uploadCancelButton.setFont(font) self.uploadTaskButton.setFont(font) self.uploadBottomButtonLayout.addWidget(self.uploadCancelButton) self.uploadBottomButtonLayout.addWidget(self.uploadTaskButton) self.uploadBottomButtonWidget.setLayout(self.uploadBottomButtonLayout) self.projectWidget = QtGui.QWidget() self.projectWidgetLayout = QtGui.QHBoxLayout(self) self.projectDropdown = QtGui.QComboBox() self.projectDropdown.setFont(font) self.projectDropdown.setEditable(True) self.projectDropdown.lineEdit().setAlignment(Qt.AlignCenter) self.projectDropdown.setEditable(False) self.projectDropdown.setStyleSheet('QComboBox {width: 350px; height: 50px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #4F535F; color: white;}') self.projectRefreshButton = QtGui.QPushButton("Refresh") self.projectRefreshButton.setStyleSheet('QPushButton {width: 50px; height: 50px; border-width: 0px; border-radius: 25px; border-style: solid; background-color: #767C8E; color: white;}') self.projectRefreshButton.clicked.connect(self._refreshProjectList) self.projectWidgetLayout.addWidget(self.projectDropdown) #self.projectWidgetLayout.addWidget(self.projectRefreshButton) self.projectWidget.setLayout(self.projectWidgetLayout) self.projectUploadViewLayout.addWidget(self.projectWidget) self.projectUploadViewLayout.addWidget(self.uploadBottomButtonWidget) self.projectUploadView.setLayout(self.projectUploadViewLayout) self.stackView.addWidget(self.projectUploadView) sizeGrip = QtGui.QSizeGrip(self) sizeGrip.setStyleSheet("QSizeGrip { height:12px; }") layout.addWidget(self.stackView) layout.addWidget(sizeGrip, 0, Qt.AlignBottom | Qt.AlignRight); self.setMinimumSize(160, 160) self.setLayout(layout) self.emailLineEdit.setFocus()
def __init__(self, username=None, usingExportDialog=False): QtGui.QDialog.__init__(self) self._clips = [] self._sequences = [] # The Dialog can work in two modes, as a popover from the Bin View or via the main App Export window self.usingExportDialog = usingExportDialog self.username = username # setGeometry(x_pos, y_pos, width, height) self.setGeometry(240, 160, 726, 552) self.setStyleSheet( 'QWidget {background-color: #3B3E4A;} QLineEdit {color: #D0D5DC; border-color:#6F757F; border-width: 1px; border-radius: 4px; border-style: solid;} QLabel {color: #D0D5DC;}' ) self.setWindowTitle("Frame.io Uploader") #self.setAttribute( Qt.WA_TranslucentBackground, True ) self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint) self.setMouseTracking(True) self.draggable = True self.dragging_threshold = 0 self.__mousePressPos = None self.__mouseMovePos = None layout = QtGui.QVBoxLayout(self) layout.setAlignment(Qt.AlignCenter) self.toolBar = QtGui.QToolBar() self.toolBar.setStyleSheet( 'QToolBar {background-color: #3B3E4A; border-width: 0px; border-radius: 0px; border-style: none; text-align: center}' ) self.toolBar.setIconSize(QSize(24, 24)) self.closeButton = QtGui.QPushButton("") self.closeButton.setStyleSheet('QPushButton {border: none;}') iconClose = QtGui.QIcon(os.path.join(gIconPath, "close.png")) self.closeButton.setIcon(iconClose) self.closeButton.clicked.connect(self.close) iconLogout = QtGui.QIcon(os.path.join(gIconPath, "logout.png")) self.logoutToolBarAction = createMenuAction("", self.logoutPressed, icon=iconLogout) self.logoutToolBarAction.setVisible(False) self.logoutToolBarAction.setToolTip("Click here to Log out") self.unconnectedIndicatorPixmap = QtGui.QPixmap( os.path.join(gIconPath, "logo-unconnected.png")) self.connectedIndicatorPixmap = QtGui.QPixmap( os.path.join(gIconPath, "logo-connected.png")) self.connectionIndicatorLabel = QtGui.QLabel("Unconnected") spacer = QtGui.QWidget() spacer.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.toolBar.addWidget(self.closeButton) self.toolBar.addWidget(spacer) self.toolBar.addWidget(self.connectionIndicatorLabel) self.toolBar.addAction(self.logoutToolBarAction) layout.addWidget(self.toolBar) pixmap = QtGui.QPixmap(os.path.join(gIconPath, "frameio.png")) lbl = QtGui.QLabel("") lbl.setPixmap(pixmap) lbl.setAlignment(Qt.AlignCenter) layout.addWidget(lbl) font = QtGui.QFont() font.setPointSize(20) self.topLabel = QtGui.QLabel("Sign In") self.topLabel.setFont(font) self.topLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.topLabel) self.statusLabel = QtGui.QLabel("") self.statusLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.statusLabel) self.stackView = QtGui.QStackedWidget(self) # Login Screen View self.loginView = QtGui.QWidget() self.loginViewLayout = QtGui.QVBoxLayout(self) self.loginViewLayout.setAlignment(Qt.AlignCenter) self.emailLineEdit = QtGui.QLineEdit() self.emailLineEdit.setPlaceholderText("E-mail") self.emailLineEdit.setFont(font) self.emailLineEdit.setAlignment(Qt.AlignCenter) self.emailLineEdit.setFixedWidth(370) self.emailLineEdit.setFixedHeight(60) if self.username: self.emailLineEdit.setText(self.username) # Validator for checking email address is valid namerx = QRegExp("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b") namerx.setCaseSensitivity(Qt.CaseInsensitive) namerx.setPatternSyntax(QRegExp.RegExp) self.nameval = QtGui.QRegExpValidator(namerx, self) self.emailLineEdit.setValidator(self.nameval) self.loginViewLayout.addWidget(self.emailLineEdit) self.passwordLineEdit = QtGui.QLineEdit() self.passwordLineEdit.setStyleSheet('') self.passwordLineEdit.setPlaceholderText("Password") self.passwordLineEdit.setFont(font) self.passwordLineEdit.setAlignment(Qt.AlignCenter) self.passwordLineEdit.setFixedWidth(370) self.passwordLineEdit.setFixedHeight(60) self.passwordLineEdit.setEchoMode(QtGui.QLineEdit.Password) self.loginViewLayout.addWidget(self.passwordLineEdit) self.submitButton = QtGui.QPushButton("LET'S GO") self.submitButton.setFlat(True) self.submitButton.setFont(font) self.submitButton.clicked.connect(self._submitButtonPressed) self.submitButton.setStyleSheet( 'QPushButton {width: 370px; height: 60px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #83DEBD; color: white;}' 'QPushButton:hover{background-color: #9974BA; }' 'QPushButton:pressed{background-color: #404040; border-width: 1px}' ) self.loginViewLayout.addWidget(self.submitButton) self.loginView.setLayout(self.loginViewLayout) self.stackView.addWidget(self.loginView) ### TO-DO - handle uploading of Clips via drag-drop into a dropzone # self.uploadDropzoneView = QtGui.QWidget() # self.uploadDropzoneView.setAcceptDrops(True) # Not hooked up. # self.uploadDropzoneLayout = QtGui.QVBoxLayout(self) # self.uploadDropzoneLayout.setAlignment(Qt.AlignCenter) # pixmap = QtGui.QPixmap(os.path.join(gIconPath, "uploadDropzone-64px.png")) # uploadIcon = QtGui.QLabel("") # uploadIcon.setPixmap(pixmap) # uploadIcon.setAlignment(Qt.AlignCenter) # self.uploadDropzoneLayout.addWidget(uploadIcon) # self.uploadDropzoneLabel1 = QtGui.QLabel("Upload your files") # self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) # self.uploadDropzoneLabel1.setFont(font) # self.uploadDropzoneLabel2 = QtGui.QLabel("Drag 'n Drop your files or Clips/Sequences here.") # self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) # self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel1) # font.setPointSize(16) # self.uploadDropzoneLabel2.setFont(font) # self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel2) # self.uploadDropzoneView.setLayout(self.uploadDropzoneLayout) # self.stackView.addWidget(self.uploadDropzoneView) ### View to handle uploading of Clips and Timelines View self.uploadView = QtGui.QWidget() self.uploadView.setStyleSheet( 'QPushButton {width: 100px; height: 100px; border-width: 0px; border-radius: 50px; border-style: solid; background-color: #9974BA; color: white;}' ) self.uploadViewLayout = QtGui.QVBoxLayout(self) self.uploadViewLayout.setAlignment(Qt.AlignCenter) self.uploadTopButtonWidget = QtGui.QWidget() self.uploadTopButtonLayout = QtGui.QHBoxLayout(self) self.uploadTopButtonLayout.setAlignment(Qt.AlignCenter) self.uploadTimelineOptionButton = QtGui.QPushButton("Timeline") self.uploadClipOptionButton = QtGui.QPushButton("Clips") self.uploadTimelineOptionButton.setCheckable(True) self.uploadTimelineOptionButton.setChecked(False) self.uploadTimelineOptionButton.setFont(font) self.uploadClipOptionButton.setCheckable(True) self.uploadClipOptionButton.setChecked(False) self.uploadClipOptionButton.setFont(font) self.uploadTopButtonLayout.addWidget(self.uploadTimelineOptionButton) self.uploadTopButtonLayout.addWidget(self.uploadClipOptionButton) self.uploadTopButtonWidget.setLayout(self.uploadTopButtonLayout) self.uploadBottomButtonWidget = QtGui.QWidget() self.uploadBottomButtonLayout = QtGui.QHBoxLayout(self) self.uploadBottomButtonLayout.setAlignment(Qt.AlignCenter) self.uploadCancelButton = QtGui.QPushButton("Cancel") self.uploadCancelButton.setStyleSheet( 'QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #767C8E; color: white;}' ) self.uploadCancelButton.clicked.connect(self.close) self.uploadTaskButton = QtGui.QPushButton("Done") self.uploadTaskButton.setStyleSheet( 'QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; color: white;}' ) self.uploadTaskButton.clicked.connect(self._uploadButtonPushed) font.setPointSize(20) self.uploadCancelButton.setFont(font) self.uploadTaskButton.setFont(font) self.uploadBottomButtonLayout.addWidget(self.uploadCancelButton) self.uploadBottomButtonLayout.addWidget(self.uploadTaskButton) self.uploadBottomButtonWidget.setLayout(self.uploadBottomButtonLayout) self.projectWidget = QtGui.QWidget() self.projectWidgetLayout = QtGui.QHBoxLayout(self) self.projectDropdown = QtGui.QComboBox() self.projectDropdown.setFont(font) self.projectDropdown.setEditable(True) self.projectDropdown.lineEdit().setAlignment(Qt.AlignCenter) self.projectDropdown.setEditable(False) self.projectDropdown.setStyleSheet( 'QComboBox {width: 350px; height: 50px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #4F535F; color: white;}' ) self.projectRefreshButton = QtGui.QPushButton("Refresh") self.projectRefreshButton.setStyleSheet( 'QPushButton {width: 50px; height: 50px; border-width: 0px; border-radius: 25px; border-style: solid; background-color: #767C8E; color: white;}' ) self.projectRefreshButton.clicked.connect(self._refreshProjectList) self.projectWidgetLayout.addWidget(self.projectDropdown) self.projectWidgetLayout.addWidget(self.projectRefreshButton) self.projectWidget.setLayout(self.projectWidgetLayout) self.uploadViewLayout.addWidget(self.projectWidget) self.uploadViewLayout.addWidget(self.uploadBottomButtonWidget) self.uploadView.setLayout(self.uploadViewLayout) self.stackView.addWidget(self.uploadView) sizeGrip = QtGui.QSizeGrip(self) sizeGrip.setStyleSheet("QSizeGrip { height:12px; }") layout.addWidget(self.stackView) layout.addWidget(sizeGrip, 0, Qt.AlignBottom | Qt.AlignRight) self.setMinimumSize(160, 160) self.setLayout(layout) self.emailLineEdit.setFocus()
def __init__(self, delegate, username=None): super(FnFrameioWidget, self).__init__() global gIconPath self._clips = [] self._sequences = [] self.username = username # FrameioDelegate self.delegate = delegate #kwargs.get("delegate", None) # setGeometry(x_pos, y_pos, width, height) self.setGeometry(240, 160, 726, 552) self.setStyleSheet('QWidget {background-color: #3B3E4A;} QLineEdit {color: #D0D5DC; border-color:#6F757F; border-width: 1px; border-radius: 4px; border-style: solid;} QLabel {color: #D0D5DC;}') self.setWindowTitle("Frame.io Uploader") #self.setAttribute( Qt.WA_TranslucentBackground, True ) self.setWindowFlags( Qt.FramelessWindowHint ) self.setMouseTracking(True) self.draggable = True self.dragging_threshold = 0 self.__mousePressPos = None self.__mouseMovePos = None layout = QtGui.QVBoxLayout(self) layout.setAlignment(Qt.AlignCenter) self.toolBar = QtGui.QToolBar() self.toolBar.setStyleSheet('QToolBar {background-color: #3B3E4A; border-width: 0px; border-radius: 0px; border-style: none;}') self.closeButton = QtGui.QPushButton("") self.closeButton.setStyleSheet('QPushButton {border: none;}') icon = QtGui.QIcon(os.path.join(gIconPath + "close.png")) self.closeButton.setIcon(icon) self.closeButton.clicked.connect(self.close) self.toolBar.addWidget(self.closeButton) layout.addWidget(self.toolBar) pixmap = QtGui.QPixmap(os.path.join(gIconPath + "logo-64px.png")) lbl = QtGui.QLabel("") lbl.setPixmap(pixmap) lbl.setAlignment(Qt.AlignCenter) layout.addWidget(lbl) font = QtGui.QFont() font.setPointSize(20) self.topLabel = QtGui.QLabel("Sign In") self.topLabel.setFont(font) self.topLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.topLabel) self.statusLabel = QtGui.QLabel("") self.statusLabel.setAlignment(Qt.AlignCenter) layout.addWidget(self.statusLabel) self.stackView = QtGui.QStackedWidget(self) # Login Screen View self.loginView = QtGui.QWidget() self.loginViewLayout = QtGui.QVBoxLayout(self) self.loginViewLayout.setAlignment(Qt.AlignCenter) self.emailLineEdit = QtGui.QLineEdit() self.emailLineEdit.setPlaceholderText("E-mail") self.emailLineEdit.setFont(font) self.emailLineEdit.setAlignment(Qt.AlignCenter) self.emailLineEdit.setFixedWidth(370) self.emailLineEdit.setFixedHeight(60) if self.username: self.emailLineEdit.setText(self.username) # Validator for checking email address is valid namerx = QRegExp("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b") namerx.setCaseSensitivity(Qt.CaseInsensitive); namerx.setPatternSyntax(QRegExp.RegExp); self.nameval = QtGui.QRegExpValidator(namerx, self) self.emailLineEdit.setValidator(self.nameval) self.loginViewLayout.addWidget(self.emailLineEdit) self.passwordLineEdit = QtGui.QLineEdit() self.passwordLineEdit.setStyleSheet('') self.passwordLineEdit.setPlaceholderText("Password") self.passwordLineEdit.setFont(font) self.passwordLineEdit.setAlignment(Qt.AlignCenter) self.passwordLineEdit.setFixedWidth(370) self.passwordLineEdit.setFixedHeight(60) self.passwordLineEdit.setEchoMode(QtGui.QLineEdit.Password) self.loginViewLayout.addWidget(self.passwordLineEdit) self.submitButton = QtGui.QPushButton("LET'S GO") self.submitButton.setFlat(True) self.submitButton.setFont(font) self.submitButton.clicked.connect(self._submitButtonPressed) self.submitButton.setStyleSheet('QPushButton {width: 370px; height: 60px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #83DEBD; color: white;}') self.loginViewLayout.addWidget(self.submitButton) self.loginView.setLayout(self.loginViewLayout) self.stackView.addWidget(self.loginView) ### View to handle uploading of Clips via drag-drop into a dropzone self.uploadDropzoneView = QtGui.QWidget() self.uploadDropzoneView.setAcceptDrops(True) # Not hooked up. self.uploadDropzoneLayout = QtGui.QVBoxLayout(self) self.uploadDropzoneLayout.setAlignment(Qt.AlignCenter) pixmap = QtGui.QPixmap(os.path.join(gIconPath + "uploadDropzone-64px.png")) uploadIcon = QtGui.QLabel("") uploadIcon.setPixmap(pixmap) uploadIcon.setAlignment(Qt.AlignCenter) self.uploadDropzoneLayout.addWidget(uploadIcon) self.uploadDropzoneLabel1 = QtGui.QLabel("Upload your files") self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) self.uploadDropzoneLabel1.setFont(font) self.uploadDropzoneLabel2 = QtGui.QLabel("Drag 'n Drop your files or Clips/Sequences here.") self.uploadDropzoneLabel1.setAlignment(Qt.AlignCenter) self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel1) font.setPointSize(16) self.uploadDropzoneLabel2.setFont(font) self.uploadDropzoneLayout.addWidget(self.uploadDropzoneLabel2) self.uploadDropzoneView.setLayout(self.uploadDropzoneLayout) self.stackView.addWidget(self.uploadDropzoneView) ### View to handle uploading of Clips and Timelines View self.uploadView = QtGui.QWidget() self.uploadView.setStyleSheet('QPushButton {width: 100px; height: 100px; border-width: 0px; border-radius: 50px; border-style: solid; background-color: #9974BA; color: white;}') self.uploadViewLayout = QtGui.QVBoxLayout(self) self.uploadViewLayout.setAlignment(Qt.AlignCenter) self.uploadTopButtonWidget = QtGui.QWidget() self.uploadTopButtonLayout = QtGui.QHBoxLayout(self) self.uploadTopButtonLayout.setAlignment(Qt.AlignCenter) self.uploadTimelineOptionButton = QtGui.QPushButton("Timeline") self.uploadClipOptionButton = QtGui.QPushButton("Clips") self.uploadTimelineOptionButton.setCheckable(True) self.uploadTimelineOptionButton.setChecked(False) self.uploadTimelineOptionButton.setFont(font) self.uploadClipOptionButton.setCheckable(True) self.uploadClipOptionButton.setChecked(False) self.uploadClipOptionButton.setFont(font) self.uploadTopButtonLayout.addWidget(self.uploadTimelineOptionButton) self.uploadTopButtonLayout.addWidget(self.uploadClipOptionButton) self.uploadTopButtonWidget.setLayout(self.uploadTopButtonLayout) # This will control whether annotations are uploaded into Frame.io for the item self.exportAnnotationsCheckbox = QtGui.QCheckBox("Export Tags+Annotations Text comments") self.uploadBottomButtonWidget = QtGui.QWidget() self.uploadBottomButtonLayout = QtGui.QHBoxLayout(self) self.uploadBottomButtonLayout.setAlignment(Qt.AlignCenter) self.uploadCancelButton = QtGui.QPushButton("Cancel") self.uploadCancelButton.setStyleSheet('QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #767C8E; color: white;}') self.uploadCancelButton.clicked.connect(self.showDropzoneUploadView) self.uploadTaskButton = QtGui.QPushButton("Upload") self.uploadTaskButton.setStyleSheet('QPushButton {width: 170px; height: 70px; border-width: 0px; border-radius: 4px; border-style: solid; color: white;}') self.uploadTaskButton.clicked.connect(self._uploadButtonPushed) font.setPointSize(20) self.uploadCancelButton.setFont(font) self.uploadTaskButton.setFont(font) self.uploadBottomButtonLayout.addWidget(self.uploadCancelButton) self.uploadBottomButtonLayout.addWidget(self.uploadTaskButton) self.uploadBottomButtonWidget.setLayout(self.uploadBottomButtonLayout) self.projectDropdown = QtGui.QComboBox() self.projectDropdown.setFont(font) self.projectDropdown.setEditable(True) self.projectDropdown.lineEdit().setAlignment(Qt.AlignCenter) self.projectDropdown.setEditable(False) self.projectDropdown.setStyleSheet('QComboBox {width: 350px; height: 50px; border-width: 0px; border-radius: 4px; border-style: solid; background-color: #4F535F; color: white;}') # We don't really need these FCP X style buttons because this acts upon a Selection #self.uploadViewLayout.addWidget(self.uploadTopButtonWidget) ### Enable when annotation uploads are supported #self.uploadViewLayout.addWidget(self.exportAnnotationsCheckbox) self.uploadViewLayout.addWidget(self.projectDropdown) self.uploadViewLayout.addWidget(self.uploadBottomButtonWidget) self.uploadView.setLayout(self.uploadViewLayout) self.stackView.addWidget(self.uploadView) sizeGrip = QtGui.QSizeGrip(self) sizeGrip.setStyleSheet("QSizeGrip { height:12px; }") layout.addWidget(self.stackView) layout.addWidget(sizeGrip, 0, Qt.AlignBottom | Qt.AlignRight); self.setMinimumSize(160, 160) self.setLayout(layout) self.emailLineEdit.setFocus()