Example #1
0
    def __init__(self, parent=None):
        super(FfmpegConfig, self).__init__(parent)
        layouts_helper.configure_default_params(self)
        self.setWindowFlags(QtCore.Qt.WindowSystemMenuHint |
                            QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
        # self.MainWindow: MainDialog = parent
        self.ffmpeg_found = False
        self.verify = False
        self.save_button.setEnabled(self.ffmpeg_found)
        self.ffmpeg_version = '0.0.0'
        self.appSettings = QSettings()
        self.openLocation = ''
        self.ffmpeg_location = self.appSettings.value(
            constants.FFMPEG_LOCATION, 'ffmpeg', type='QStringList')[0]

        self.ffmpeg_exec_button.clicked.connect(self.getNewFFMPEG)
        self.ffmpeg_exec_tb.setText(self.ffmpeg_location)
        self.ffmpeg_exec_tb.textChanged.connect(
            functools.partial(self.save_button.setEnabled, False))
        self.cancel_button.clicked.connect(self.close)
        self.save_button.clicked.connect(self.saveSettings)
        self.verify_button.clicked.connect(self.checkFFMPEGVersion)
        self.checkFFMPEGVersion()
        if self.ffmpeg_found == False:
            self.show()
Example #2
0
 def __init__(self, ldap_user, parent=None):
     super(QueryUserSimple, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.ldap = ldap_user
     self.actionExit.setShortcut("Ctrl+Q")
     self.actionExit.triggered.connect(self.close)
     # self.member_since_field.setDisabled(True)
     self.export_query.setDisabled(True)
     self.query_user.setEnabled(False)
     self.first_name_field.textChanged.connect(self.enable_query_button)
     self.last_name_field.textChanged.connect(self.enable_query_button)
     self.email_field.textChanged.connect(self.enable_query_button)
     self.login_user_text = QtWidgets.QLabel(self.layoutWidget)
     self.login_user_text.setObjectName("login_user_text")
     self.login_user_text.setText(
         f"Authenticated as: {self.ldap.bind_user}")
     self.statusBar.addPermanentWidget(self.login_user_text, 1)
     self.time_in_session = QtWidgets.QLabel(self.layoutWidget)
     self.time_in_session.setObjectName("time_in_session")
     self.time_in_session.setText("Time left in session: {time_in_session}")
     self.time_in_session.setAlignment(QtCore.Qt.AlignRight)
     self.statusBar.addPermanentWidget(self.time_in_session, 1)
     license_view_dialog = LicenseWindow()
     processes.add(license_view_dialog)
     # print(license_view_dialog)
     # license_view_dialog.show()
     self.actionAbout.triggered.connect(license_view_dialog.show)
     self.actionLogout.triggered.connect(self.logout)
     self.query_user.clicked.connect(self.query)
     # self.timer_start_logout()
     # self.update_time_left()
     self.first_name_field.installEventFilter(self)
     self.last_name_field.installEventFilter(self)
     self.email_field.installEventFilter(self)
Example #3
0
    def __init__(self, parent=None):
        super(LicenseWindow, self).__init__(parent)
        layouts_helper.configure_default_params(self)
        self.viewLicenseOnlineButton.clicked.connect(self.viewLicense)
        self.visitWebsiteButton.clicked.connect(self.viewWebsite)
        self.license_url = 'https://raw.githubusercontent.com/dgaiero/cpieee-member-GUI/master/LICENSE'
        license_text = requests.get(self.license_url)

        self.licenseText.setPlainText(license_text.text)
Example #4
0
 def __init__(self, parent=None):
     super(ChangePassowrd, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.phone_field.setInputMask('999-999-9999')
     self.old_password_field.setEchoMode(QtWidgets.QLineEdit.Password)
     self.new_password_field.setEchoMode(QtWidgets.QLineEdit.Password)
     self.new_password_field_confirm.setEchoMode(
         QtWidgets.QLineEdit.Password)
     self.cancel_button.clicked.connect(self.close)
Example #5
0
    def __init__(self, parent=None):
        super(ImageViewer, self).__init__(parent)
        layouts_helper.configure_default_params(self)
        self.qScene = QGraphicsScene()
        self.MainWindow: MainDialog = parent

        nextShortcut = QShortcut(QKeySequence('Ctrl+N'), self)
        nextShortcut.activated.connect(self.MainWindow.showNextFrame)

        nextShortcut2 = QShortcut(QKeySequence('N'), self)
        nextShortcut2.activated.connect(self.MainWindow.showNextFrame)

        prevShortcut = QShortcut(QKeySequence('Ctrl+P'), self)
        prevShortcut.activated.connect(self.MainWindow.showPreviousFrame)

        prevShortcut2 = QShortcut(QKeySequence('P'), self)
        prevShortcut2.activated.connect(self.MainWindow.showPreviousFrame)

        refreshShortcut = QShortcut(QKeySequence('Ctrl+R'), self)
        refreshShortcut.activated.connect(self.MainWindow.refreshVideo)

        refreshShortcut2 = QShortcut(QKeySequence('R'), self)
        refreshShortcut2.activated.connect(self.MainWindow.refreshVideo)

        fullScreenShortcut = QShortcut(QKeySequence('Ctrl+F'), self)
        fullScreenShortcut.activated.connect(self.toggleFullScreen)

        fullScreenShortcut2 = QShortcut(QKeySequence('F'), self)
        fullScreenShortcut2.activated.connect(self.toggleFullScreen)

        playPausePreviewShortcut = QShortcut(QKeySequence('Space'), self)
        playPausePreviewShortcut.activated.connect(self.MainWindow.playPreview)

        skipToBeginningShortcut = QShortcut(QKeySequence('Ctrl+B'), self)
        skipToBeginningShortcut.activated.connect(self.MainWindow.resetPreview)

        skipToBeginningShortcut2 = QShortcut(QKeySequence('B'), self)
        skipToBeginningShortcut2.activated.connect(self.MainWindow.resetPreview)

        skipToEndShortcut = QShortcut(QKeySequence('Ctrl+E'), self)
        skipToEndShortcut.activated.connect(self.MainWindow.skipToEnd)

        skipToEndShortcut2 = QShortcut(QKeySequence('E'), self)
        skipToEndShortcut2.activated.connect(self.MainWindow.skipToEnd)

        muteShortcut = QShortcut(QKeySequence('Ctrl+M'), self)
        muteShortcut.activated.connect(self.MainWindow.checkPreviewMute)

        muteShortcut2 = QShortcut(QKeySequence('M'), self)
        muteShortcut2.activated.connect(self.MainWindow.checkPreviewMute)

        self.preview_graphic.setRenderHint(
            QtGui.QPainter.SmoothPixmapTransform)
Example #6
0
 def __init__(self, parent=None):
     super(LoginWindow, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.setFixedSize(self.width(), self.height())
     self.username_field.setInputMask('999-999-9999')
     self.password_field.setEchoMode(QtWidgets.QLineEdit.Password)
     self.cancel_button.clicked.connect(self.close)
     self.options_button.clicked.connect(self.showOptions)
     self.setSizeGripEnabled(False)
     self.login_button.setEnabled(False)
     self.password_field.textChanged.connect(self.enable_login_button)
     self.username_field.textChanged.connect(self.enable_login_button)
     self.login_button.clicked.connect(self.login)
Example #7
0
    def __init__(self, parent=None):
        super(FileNotFound, self).__init__(parent)
        layouts_helper.configure_default_params(self)
        self.MainWindow: MainDialog = parent
        self.closeButton.clicked.connect(self.close)
        self.file_locator_view.setColumnCount(3)
        self.configure_headers()

        self.file_locator_view.cellClicked.connect(self.actionRow)
        self.file_locator_view.cellDoubleClicked.connect(self.locateFile)

        self.locateButton.setEnabled(False)
        self.clearFileButton.setEnabled(False)

        self.locateButton.clicked.connect(self.locateFile)
        self.clearFileButton.clicked.connect(self.initalizeFileValue)
Example #8
0
 def __init__(self, parent=None):
     super(LicenseWindow, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.setWindowFlags(QtCore.Qt.WindowSystemMenuHint |
                         QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
     self.version = Version()
     self.version.read_file()
     self.viewLicenseOnlineButton.clicked.connect(self.viewLicense)
     self.viewAddendumOnlineButton.clicked.connect(self.viewAddendum)
     license_text = open(layouts_helper.resource_path('LICENSE.LGPL')).read()
     addendum_text = open(layouts_helper.resource_path('COPYING.LESSER')).read()
     self.license_url = 'https://raw.githubusercontent.com/dgaiero/SubVid/master/LICENSE.LGPL'
     self.addendum_url = 'https://raw.githubusercontent.com/dgaiero/SubVid/master/COPYING.LESSER'
     self.licenseText.setPlainText(license_text)
     self.addendumText.setPlainText(addendum_text)
     id = QFontDatabase.addApplicationFont(":/fonts/FiraCode-Regular.ttf")
     _fontstr = QFontDatabase.applicationFontFamilies(id)[0]
     _font = QFont(_fontstr, 8)
     self.licenseText.setFont(_font)
     self.addendumText.setFont(_font)
     self.versionText.setText(f'Version: {self.version}')
     _translate = QtCore.QCoreApplication.translate
     self.label.setText(_translate("Dialog", f"<html><head/><body><h1 style=\" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:xx-large; font-weight:600;\">Copyright &copy; Dominic Gaiero {datetime.datetime.now().year}</span></h1><p>Developed and Designed by Dominic Gaiero This program is licensed under the GNU General Public License v3.0. This license is shown below and is generated from the online version. For an online version, click the button below.</p></body></html>"))
Example #9
0
 def __init__(self, parent=None):
     super(UserLookup, self).__init__(parent)
     layouts_helper.configure_default_params(self)
Example #10
0
 def __init__(self, parent=None):
     super(QueryUser, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.actionExit.setShortcut("Ctrl+Q")
     self.actionExit.triggered.connect(self.close)
Example #11
0
    def __init__(self, app, uuid, parent=None):
        super(MainDialog, self).__init__(parent)
        layouts_helper.configure_default_params(self)
        self.app = app
        self.uuid = uuid
        self.settings: Settings = Settings(
            constants.ORGANIZATION_NAME, constants.APPLICATION_NAME)
        self.appSettings = QSettings()
        self.ffmpeg_config = FfmpegConfig()
        processes.add(self.ffmpeg_config)
        self.fileOpenDialogDirectory = os.path.expanduser('~')
        self.bindLicenseActions()
        self.source_time_button.clicked.connect(self.getSourceTime)
        self.sound_track_button.clicked.connect(self.getSoundTrack)
        self.font_button.clicked.connect(self.getParamFont)
        self.font_size_tb.valueChanged.connect(self.setFontSize)
        self.red_spin_box_2.valueChanged.connect(self.changeFontPickerRed)
        self.green_spin_box.valueChanged.connect(self.changeFontPickerGreen)
        self.blue_spin_box.valueChanged.connect(self.changeFontPickerBlue)

        self.red_spin_box_text_box.valueChanged.connect(self.changeBackgroundPickerRed)
        self.green_spin_box_text_box.valueChanged.connect(self.changeBackgroundPickerGreen)
        self.blue_spin_box_text_box.valueChanged.connect(
            self.changeBackgroundPickerBlue)
        self.show_bounding_box.clicked.connect(self.toggleBoundingBox)

        self.background_button.clicked.connect(self.getBackgroundImage)
        self.generate_video_button.clicked.connect(self._generateVideo)
        self.refresh_button.clicked.connect(self.refreshVideo)
        self.video_location_button.clicked.connect(self.getVideoOutputLocation)
        self.frame_next_button.clicked.connect(self.showNextFrame)
        self.frame_previous_button.clicked.connect(self.showPreviousFrame)
        self.source_time_tb.textChanged.connect(self.updateSourceTimeTextBox)
        self.sound_track_tb.textChanged.connect(self.updateSoundTrackTextBox)
        self.font_tb.textChanged.connect(self.updateFontTextBox)
        self.video_location_tb.textChanged.connect(
            self.updateVideoLocationTextBox)
        self.theme_actions = {}
        self.themes = (list(map(theme_set, QtWidgets.QStyleFactory.keys())) +
                       [layouts_helper.Theme("Dark Style", qdarkstyle.load_stylesheet_pyqt5(), True)])

        self.videoThread: QThread = GenerateVideo()
        self.videoThread.update.connect(self.updateProgress)
        self.videoThread.text.connect(self.updateVideoGenerationStatusText)
        self.videoThread.image.connect(self.updatePreviewWindowVG)
        self.videoThread.success.connect(self.generationSuccessCheck)
        self.videoThread.finished.connect(self.cleanupVideoGeneration)

        self.actionOpen.triggered.connect(self.openConfig)
        self.actionOpen.setIcon(
            self.style().standardIcon(QStyle.SP_DialogOpenButton))
        self.actionSave_As.triggered.connect(self.saveAsConfig)
        self.actionSave.triggered.connect(self.saveConfig)
        self.actionSave.setIcon(
            self.style().standardIcon(QStyle.SP_DialogSaveButton))
        self.actionNew.triggered.connect(self.newWindow)
        self.actionNew.setIcon(self.style().standardIcon(QStyle.SP_FileIcon))

        self.recently_opened = RecentlyOpened(self)
        self.recently_opened.buildRecentlyOpenedDict()
        self.recently_opened.build_dropdown()
        self.actionExit.triggered.connect(self.close)

        self.align_text_top_radial.toggled.connect(self.setTextPosition)
        self.align_text_center_radial.toggled.connect(self.setTextPosition)
        self.align_text_bottom_radial.toggled.connect(self.setTextPosition)

        self.reset_preview_button.setIcon(
            self.style().standardIcon(QStyle.SP_MediaSkipBackward))
        self.reset_preview_button.clicked.connect(self.resetPreview)

        self.skip_to_end_button.setIcon(
            self.style().standardIcon(QStyle.SP_MediaSkipForward))
        self.skip_to_end_button.clicked.connect(self.skipToEnd)

        self.player = QMediaPlayer()

        self.isMuted = False
        self.mute_preview_button.setIcon(
            self.style().standardIcon(QStyle.SP_MediaVolume))
        self.mute_preview_button.clicked.connect(self.checkPreviewMute)

        self.isPlayingPreview = False
        self.play_preview_button.setIcon(
            self.style().standardIcon(QStyle.SP_MediaPlay))
        self.play_preview_button.clicked.connect(self.playPreview)

        self.background_preview.setRenderHint(
            QtGui.QPainter.SmoothPixmapTransform)
        self.preview_graphic.setRenderHint(
            QtGui.QPainter.SmoothPixmapTransform)

        self.actionClear_all_settings.triggered.connect(self.appSettings.clear)

        self.text_align_left.setDisabled(True)
        self.text_align_center.setDisabled(True)
        self.text_align_right.setDisabled(True)

        self.text_x_pos.valueChanged.connect(self.update_text_x_pos)
        self.text_y_pos.valueChanged.connect(self.update_text_y_pos)

        self.currentFrame = 0

        self.actionConfigure_FFMPEG_location.triggered.connect(
            self.showFFMPEGConfigureDialog)
        self.checkFFMPEGVersion(onStart=True)
        self.setThemeOptions()
        self.setTheme()
        # self.actionTheme.triggered.connect(self.changeTheme)

        self.updateColors()

        self.preview_dialog = ImageViewer(self)
        processes.add(self.preview_dialog)
        self.previewClicked.connect(self.bindLargePreviewActions)

        self.checkFramePosition()
        self.preview_frame_buffer = list()

        timer100ms = QtCore.QTimer(self)
        timer100ms.timeout.connect(self.runUpdateEvents100ms)
        timer100ms.start(100)  # 100 ms refesh rate

        self.file_not_found = FileNotFound(self)
        processes.add(self.file_not_found)
Example #12
0
 def __init__(self, parent=None):
     super(ConfigurationWindow, self).__init__(parent)
     layouts_helper.configure_default_params(self)
     self.default_password_field.setEchoMode(QtWidgets.QLineEdit.Password)
     self.field_registration()