示例#1
0
    def __init__(self, parent=None, img_path=None, snd_path=None):
        # Initialyze super class and set up this.
        super(textEdit, self).__init__(parent)
        self.setupUi(self)

        # Set the source directory which this program located.
        self._source_directory = parent.source_directory
        self._icon_directory = parent.icon_directory
        self._qt_image = parent.qt_image
        self._image_extensions = parent.image_extensions
        self._sound_extensions = parent.sound_extensions

        # Initialize the window.
        self.setWindowTitle(self.tr("Check Tethered Image"))
        self.setWindowState(Qt.WindowMaximized)

        if parent.skin == "grey":
            # Set the icon path.
            self._icon_directory = os.path.join(self._icon_directory, "white")

        elif skin == "white":
            # Set the icon path.
            self._icon_directory = os.path.join(self._icon_directory, "black")

        # Initialyze the list view of the thumbnails.
        self.lst_img_icon.setIconSize(QSize(200, 200))
        self.lst_img_icon.setMovement(QListView.Static)
        self.lst_img_icon.setModel(QStandardItemModel())

        # Define the return values.
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        # Create the graphic view item.
        self.graphicsView = viewer.ImageViewer()
        self.graphicsView.setObjectName("graphicsView")
        self.verticalLayout.addWidget(self.graphicsView)

        # Get the path of the tethered image.
        self.path_img = img_path

        # Initialyze the thumbnail selector.
        self.lst_img_icon.selectionModel().selectionChanged.connect(
            self.showImage)

        # Get tethered image files.
        self.getImageFiles()
示例#2
0
    def __init__(self, parent=None, sop_file=None):
        # Get the path of the tethered image.
        self._sop_file = sop_file
        self._qt_image = parent.qt_image
        self._language = parent.language
        self._source_directory = parent.source_directory
        self._root_directory = parent.root_directory
        self._database = parent.database

        # Set the source directory which this program located.
        super(imageInformationDialog, self).__init__(parent)
        self.setupUi(self)

        # Initialize the window.
        self.setWindowTitle(self.tr("File Information Dialog"))

        # Initialyze the user interface.
        # Get the proper font size from the display size and set the font size.
        font_size = skin.getFontSize()

        # Make the style sheet.
        font_style_size = 'font: regular ' + str(skin.getFontSize()) + 'px;'

        # Define the font object for Qt.
        font = QFont()
        font.setPointSize(font_size)

        self.setFont(font)

        if parent.skin == "grey":
            # Set the icon path.
            icon_path = os.path.join(parent.icon_directory, "white")

            # Set the default background and front color.
            back_color = 'background-color: #2C2C2C;'
            font_style_color = 'color: #FFFFFF;'
            font_style = font_style_color + font_style_size

            # Set the default skin for all components.
            self.setStyleSheet(back_color + font_style +
                               'border-style: none; border-color: #4C4C4C;')
            self.frame.setStyleSheet(
                back_color + font_style +
                'border-style: none; border-color: #4C4C4C;')

            # Set the default skin for text boxes.
            text_border = 'border-style: outset; border-width: 0.5px; border-color: #4C4C4C;'
            text_background = "background-color: #6C6C6C;"
            self.cmb_fil_stts.setStyleSheet(font_style_color +
                                            font_style_size + text_border +
                                            text_background)
            self.tbx_fil_ali.setStyleSheet(font_style_color + font_style_size +
                                           text_border + text_background)

            self.dte_fil_dt_cre.setStyleSheet(font_style_color +
                                              font_style_size + text_border +
                                              text_background)
            self.dte_fil_dt_mod.setStyleSheet(font_style_color +
                                              font_style_size + text_border +
                                              text_background)
            self.cmb_fil_eope.setStyleSheet(font_style_color +
                                            font_style_size + text_border +
                                            text_background)
            self.tbx_fil_ope_app.setStyleSheet(font_style_color +
                                               font_style_size + text_border +
                                               text_background)
            self.tbx_fil_dsc.setStyleSheet(font_style_color + font_style_size +
                                           text_border + text_background)
            self.tbx_fil_capt.setStyleSheet(font_style_color +
                                            font_style_size + text_border +
                                            text_background)
        elif skin == "white":
            # Set the icon path.
            icon_path = os.path.join(parent.icon_directory, "black")

            # Set the icon path.
            parent.icon_directory = os.path.join(parent.icon_directory,
                                                 "black")

        # Add the text label to the tab
        if self._language == "ja":
            self.cbx_fil_pub.setText("公開設定")
            self.cbx_fil_edit.setText("削除可能")
            self.lab_fil_sta.setText("ステータス")
            self.lab_fil_ali.setText("別 名 :")
            self.lab_fil_dt_cr.setText("作成日時 :")
            self.lab_fil_dt_mod.setText("編集日時 :")
            self.lab_fil_ope.setText("操 作 :")
            self.lab_fil_ope_app.setText("操作アプリ :")
            self.lab_fil_cap.setText("キャプション :")
            self.lbl_fil_dsc.setText("備 考 :")
            self.btn_fil_dt_cre_exif.setText("Exifから取得")
            self.btn_fil_dt_mod_exif.setText("Exifから取得")
            self.box_fil_ope.buttons()[0].setText("OK")
            self.box_fil_ope.buttons()[1].setText("キャンセル")
        elif self._language == "en":
            self.cbx_fil_pub.setText("Public")
            self.cbx_fil_edit.setText("Erasable")
            self.lab_fil_sta.setText("Status")
            self.lab_fil_ali.setText("Alias :")
            self.lab_fil_dt_cr.setText("Date of Create :")
            self.lab_fil_dt_mod.setText("Date of Edit :")
            self.lab_fil_ope.setText("Operation :")
            self.lab_fil_ope_app.setText("Application :")
            self.lab_fil_cap.setText("Caption :")
            self.lbl_fil_dsc.setText("Description :")
            self.btn_fil_dt_cre_exif.setText("Get from Exif")
            self.btn_fil_dt_mod_exif.setText("Get from Exif")
            self.box_fil_ope.buttons()[0].setText("OK")
            self.box_fil_ope.buttons()[1].setText("Cancel")

        # Change the default icons for dialoc button box.
        self.box_fil_ope.buttons()[0].setFlat(True)
        self.box_fil_ope.buttons()[1].setFlat(True)

        # Set the dialog button size.
        dlg_btn_size = QSize(125, 30)
        self.box_fil_ope.buttons()[0].setMinimumSize(dlg_btn_size)
        self.box_fil_ope.buttons()[1].setMinimumSize(dlg_btn_size)

        # Set the skin and icon.
        self.box_fil_ope.buttons()[0].setIcon(
            skin.getIconFromPath(os.path.join(icon_path, 'check.png')))
        self.box_fil_ope.buttons()[1].setIcon(
            skin.getIconFromPath(os.path.join(icon_path, 'close.png')))

        self.btn_fil_dt_cre_exif.clicked.connect(self.getCreateDateByExif)
        self.btn_fil_dt_mod_exif.clicked.connect(self.getModifiedDateByExif)

        self.tab_src.currentChanged.connect(self.toggleTab)

        # Define the return values.
        self.box_fil_ope.accepted.connect(self.accept)
        self.box_fil_ope.rejected.connect(self.reject)

        # Get the image properties from the instance.
        if self._sop_file.public == "1":
            self.cbx_fil_pub.setChecked(True)
        else:
            self.cbx_fil_pub.setChecked(False)

        if self._sop_file.lock == "1":
            self.cbx_fil_edit.setChecked(False)
            self.cbx_fil_edit.setDisabled(True)
        else:
            self.cbx_fil_edit.setChecked(True)
            self.cbx_fil_edit.setDisabled(False)

        # Set the alias name of the file object.
        self.tbx_fil_ali.setText(self._sop_file.alias)

        # Get the date of creation and modification.
        cdate = self._sop_file.created_date
        mdate = self._sop_file.modified_date

        # Set the maximum date if the given date is invalid.
        if (cdate == None or cdate == ""): cdate = "7999-12-31T23:59:59"
        if (mdate == None or mdate == ""): mdate = "7999-12-31T23:59:59"

        # Convert string date format to the PyQt date type.
        fil_dt_create = general.pyDateTimeToQDateTime(parse(cdate))
        fil_dt_modify = general.pyDateTimeToQDateTime(parse(mdate))

        # Set dates of creation and modification.
        self.dte_fil_dt_cre.setDateTime(fil_dt_create)
        self.dte_fil_dt_mod.setDateTime(fil_dt_modify)

        # Set the operating application software.
        self.tbx_fil_ope_app.setText(self._sop_file.operating_application)

        # Set the caption of the file object.
        self.tbx_fil_capt.setText(self._sop_file.caption)

        self.tbx_fil_dsc.setText(self._sop_file.description)

        # Set the status of the file object and optional values.
        self.cmb_fil_stts.addItem(self._sop_file.status)
        self.cmb_fil_stts.addItem("Original")
        self.cmb_fil_stts.addItem("Original(RAW)")
        self.cmb_fil_stts.addItem("Removed")
        self.cmb_fil_stts.addItem("Imported")
        self.cmb_fil_stts.addItem("Edited")

        # Set the operation of the file object and option values.
        self.cmb_fil_eope.addItem(self._sop_file.operation)
        self.cmb_fil_eope.addItem("Editing on GIMP")
        self.cmb_fil_eope.addItem("Rotating")
        self.cmb_fil_eope.addItem("Grayscaling")
        self.cmb_fil_eope.addItem("White balance adjusting")
        self.cmb_fil_eope.addItem("Normalizing")
        self.cmb_fil_eope.addItem("Cropping")
        self.cmb_fil_eope.addItem("Color inverting")
        self.cmb_fil_eope.addItem("Removing")
        self.cmb_fil_eope.addItem("Colorlizing")
        self.cmb_fil_eope.addItem("Unknown")
        self.cmb_fil_eope.addItem("Other")

        if self._sop_file.file_type == "image":
            # Get the path from selected image object.
            img_file_path = os.path.join(parent.root_directory,
                                         self._sop_file.filename)

            if self.imageIsValid(img_file_path) == True:
                # Add a tab for the thumbnail.
                self.tab_img_thumb = QWidget()
                self.tab_img_thumb.setLayoutDirection(Qt.LeftToRight)
                self.tab_img_thumb.setObjectName("tab_img_thumb")

                # Add a tab for the image viewer
                self.tab_img_view = QWidget()
                self.tab_img_view.setLayoutDirection(Qt.LeftToRight)
                self.tab_img_view.setObjectName("tab_img_view")
                self.tab_img_view.setAccessibleName("tab_img_view")

                # Add the layout for image viewer.
                self.lay_img_view = QVBoxLayout(self.tab_img_view)
                self.lay_img_view.setContentsMargins(0, 0, 0, 0)
                self.lay_img_view.setObjectName("lay_thm")

                # Add the layout for image viewer.
                self.lay_img_thumb = QVBoxLayout(self.tab_img_thumb)
                self.lay_img_thumb.setContentsMargins(0, 0, 0, 0)
                self.lay_img_thumb.setObjectName("lay_thm")

                self.lbl_img_thumb = QLabel()
                self.lbl_img_thumb.setAlignment(Qt.AlignCenter)
                self.lbl_img_thumb.setObjectName("lbl_img_thumb")

                self.lay_img_thumb.addWidget(self.lbl_img_thumb)

                # Add the layout to the tab.
                self.tab_src.addTab(self.tab_img_thumb, "")

                # Add the layout to the tab.
                self.tab_src.addTab(self.tab_img_view, "")

                # Create the graphic view item.
                self.graphicsView = viewer.ImageViewer()
                self.graphicsView.setObjectName("graphicsView")
                self.lay_img_view.addWidget(self.graphicsView)

                # Add the text label to the tab
                if self._language == "ja":
                    self.tab_src.setTabText(
                        self.tab_src.indexOf(self.tab_img_thumb), "サムネイル")
                    self.tab_src.setTabText(
                        self.tab_src.indexOf(self.tab_img_view), "画像ビューア")
                elif self._language == "en":
                    self.tab_src.setTabText(
                        self.tab_src.indexOf(self.tab_img_thumb), "Thumbnail")
                    self.tab_src.setTabText(
                        self.tab_src.indexOf(self.tab_img_view),
                        "Image Viewer")

                if parent.skin == "grey":
                    # Set the icon path.
                    icon_path = os.path.join(parent.icon_directory, "white")

                    # Set the default skin for tabs.
                    back_color_tab = 'QTabBar::tab {background-color: #2C2C2C; }'
                    back_color_tab_act = 'QTabBar::tab::selected {background-color: #4C4C4C;}'
                    self.tab_src.setStyleSheet(back_color_tab +
                                               back_color_tab_act)

                # Get the image file.
                self.showImage()
示例#3
0
def activate(ui_main):
    # Add a splitter handle between project item tree and selected object.
    spl_main = QSplitter(Qt.Horizontal)
    spl_main.addWidget(ui_main.frm_left)
    spl_main.addWidget(ui_main.frm_right)

    ui_main.frm_main_lay.addWidget(spl_main)
    ui_main.setLayout(ui_main.frm_main_lay)

    # Create the graphic view item.
    ui_main.graphicsView = viewer.ImageViewer()
    ui_main.graphicsView.setObjectName("graphicsView")
    ui_main.verticalLayout_10.addWidget(ui_main.graphicsView)

    # Add a splitter handle between the file list tree and preview screen.
    spl_fl = QSplitter(Qt.Horizontal)
    spl_fl.addWidget(ui_main.frm_fil_info_left)
    spl_fl.addWidget(ui_main.frm_fil_info_right)
    ui_main.frm_fil_info_lay.addWidget(spl_fl)
    ui_main.setLayout(ui_main.frm_fil_info_lay)

    # Activate actions on the menu bar.
    ui_main.bar_menu.setNativeMenuBar(False)
    ui_main.act_prj_open.triggered.connect(ui_main.getTheRootDirectory)
    ui_main.act_prj_open.triggered.connect(ui_main.saveCurrentSettings)
    ui_main.act_imp_csv_con.triggered.connect(ui_main.importConsolidationCSV)
    ui_main.act_imp_csv_mat.triggered.connect(ui_main.importMaterialCSV)
    ui_main.act_imp_csv_fil.triggered.connect(ui_main.importFileCSV)
    ui_main.act_exp_html.triggered.connect(ui_main.exportAsHtml)
    ui_main.act_exp_csv_con.triggered.connect(ui_main.exportConsolidationCSV)
    ui_main.act_exp_csv_mat.triggered.connect(ui_main.exportMaterialCSV)
    ui_main.act_exp_xml.triggered.connect(ui_main.exportAsXML)
    ui_main.act_exp_xml.triggered.connect(ui_main.exportAsXML)
    ui_main.act_reg_flickr.triggered.connect(ui_main.regFlickrKey)
    ui_main.act_exp_flickr.triggered.connect(ui_main.uploadToFlickr)

    ui_main.act_conf.triggered.connect(ui_main.openConfigDialog)

    ui_main.act_lan_en.triggered.connect(ui_main.setLangEn)
    ui_main.act_lan_ja.triggered.connect(ui_main.setLangJa)

    ui_main.tre_prj_item.itemSelectionChanged.connect(
        ui_main.toggleCurrentTreeObject
    )  # Handle current selection of consolidations and materials.
    ui_main.tre_fls.itemSelectionChanged.connect(
        ui_main.toggleCurrentFile
    )  # Handle current selection of consolidations and materials.

    ui_main.tab_control.setCurrentIndex(
        0)  # Initialyze the tab for source tree view and camera setting.
    ui_main.tab_target.setCurrentIndex(
        0)  # Initialyze the tab for the current object.
    ui_main.tab_src.setCurrentIndex(
        0)  # Initialyze the tab icons for source media tabs.

    ui_main.tab_target.currentChanged.connect(ui_main.toggleCurrentObjectTab)
    ui_main.tab_src.currentChanged.connect(ui_main.toggleCurrentSourceTab)

    # Initialyze objects for consolidation
    ui_main.btn_con_add.clicked.connect(
        ui_main.addConsolidation
    )  # Activate the adding a consolidation button.
    ui_main.btn_con_update.clicked.connect(
        ui_main.updateConsolidation
    )  # Activate the updating the selected consolidation button.
    ui_main.btn_con_del.clicked.connect(
        ui_main.deleteConsolidation
    )  # Activate the deleting the selected consolidation button.
    ui_main.btn_con_take.clicked.connect(
        ui_main.tetheredShooting
    )  # Activate the taking a image of the consolidation button.
    ui_main.btn_con_imp.clicked.connect(
        ui_main.importExternalData
    )  # Activate the importing files of the consolidation button.
    ui_main.btn_con_rec.clicked.connect(
        ui_main.recordWithPhoto
    )  # Activate the opening recording dialog button.

    # Initialyze objects for materials
    ui_main.btn_mat_add.clicked.connect(
        ui_main.addMaterial)  # Activate the adding a material button.
    ui_main.btn_mat_update.clicked.connect(
        ui_main.updateMaterial
    )  # Activate the updating the selected material button.
    ui_main.btn_mat_del.clicked.connect(
        ui_main.deleteMaterial)  # Activate the consolidation delete button.
    ui_main.btn_mat_take.clicked.connect(
        ui_main.tetheredShooting
    )  # Activate the taking a image of the material button.
    ui_main.btn_mat_imp.clicked.connect(
        ui_main.importExternalData
    )  # Activate the importing files of the consolidation button.
    ui_main.btn_mat_rec.clicked.connect(
        ui_main.recordWithPhoto
    )  # Activate the opening recording dialog button.

    # Activate the check boxes for publishing mode.
    ui_main.cbx_fil_pub.setChecked(False)
    ui_main.cbx_fil_pub.clicked.connect(ui_main.updateFile)
    ui_main.cbx_fil_original.clicked.connect(ui_main.toggleShowFileMode)
    ui_main.cbx_fil_deleted.setChecked(False)
    ui_main.cbx_fil_deleted.clicked.connect(ui_main.toggleShowFileMode)

    # Activate the image processing functions.
    ui_main.btn_open_gimp.clicked.connect(
        ui_main.openWithGimp)  # Activate the buttons for opening GIMP.
    ui_main.btn_img_cnt.clicked.connect(
        ui_main.extractContour
    )  # Activate the image proccessing tool button of cropping.
    ui_main.btn_img_inv.clicked.connect(
        ui_main.negativeToPositive
    )  # Activate the image processing tool button for inverting.
    ui_main.btn_img_del.clicked.connect(
        ui_main.deleteSelectedFile
    )  # Activate the image processing tool button for deleting.
    ui_main.btn_img_rot_r.clicked.connect(
        ui_main.rotateImageRight
    )  # Activate the image processing tool button for rotating clockwise.
    ui_main.btn_img_rot_l.clicked.connect(
        ui_main.rotateImageLeft
    )  # Activating the image processing tool button for rotating anti-clockwise.
    ui_main.btn_img_rot_u.clicked.connect(
        ui_main.rotateImageInvert
    )  # Activating the image processing tool button for ratating 180 degree.
    ui_main.btn_img_mno.clicked.connect(
        ui_main.makeMonoImage
    )  # Activating the image processing tool button for making monochrome image.
    ui_main.btn_img_enh.clicked.connect(
        ui_main.enhanceImage
    )  # Activating the image processing tool button for enhancing.
    ui_main.btn_img_sav.clicked.connect(
        ui_main.saveImageAs
    )  # Activating the image processing tool button for export the selected image.
    ui_main.btn_img_awb.clicked.connect(
        ui_main.adjustWhiteBalance
    )  # Activating the image processing tool button for adjusting image white balance.
    ui_main.btn_img_col.clicked.connect(
        ui_main.colorlize
    )  # Activating the image processing tool button for adjusting image white balance.

    # Activate the map functions.
    ui_main.btn_geo_coding.clicked.connect(ui_main.addGeometryByGeocoding)
    ui_main.btn_map_reload.clicked.connect(ui_main.refreshMap)
    ui_main.btn_map_search.clicked.connect(ui_main.searchLocationOnMap)

    # Activate the extra functions.
    ui_main.btn_fil_edit.clicked.connect(
        ui_main.editImageInformation
    )  # Activate the editing the file informatin button.
    ui_main.btn_cam_detect.clicked.connect(
        ui_main.detectCamera)  # Activate detecting a connected camera button.

    #========================
    # Media player
    #========================
    ui_main.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface)

    ui_main.mlt_btn_play.setEnabled(False)
    ui_main.mlt_btn_play.clicked.connect(ui_main.playMedia)

    ui_main.mlt_sld_play.setRange(0, 0)
    ui_main.mlt_sld_play.sliderMoved.connect(ui_main.setPosition)

    ui_main.mediaPlayer.setVideoOutput(ui_main.mlt_video_widget)
    ui_main.mediaPlayer.stateChanged.connect(ui_main.mediaStateChanged)
    ui_main.mediaPlayer.positionChanged.connect(ui_main.positionChanged)
    ui_main.mediaPlayer.durationChanged.connect(ui_main.durationChanged)
    ui_main.mediaPlayer.error.connect(ui_main.handleError)
示例#4
0
 def __init__(self, parent=None, path=None):
     # Set the source directory which this program located.
     self._source_directory = parent.source_directory
     self._icon_directory = parent.icon_directory
     self._qt_image = parent.qt_image
     self._image_extensions = parent.image_extensions
     self._raw_image_extensions = parent.raw_image_extensions
     self._sound_extensions = parent.sound_extensions
     
     super(CheckImageDialog, self).__init__(parent)
     self.setupUi(self)
     
     # Create the graphic view item.        
     self.graphicsView = viewer.ImageViewer()
     self.graphicsView.setObjectName("graphicsView")
     self.horizontalLayout_2.addWidget(self.graphicsView)
     
     # Initialize the window.
     self.setWindowTitle(self.tr("Check Tethered Image"))
     self.setWindowState(Qt.WindowMaximized)
     
     # Initialyze the user interface.
     # Get the proper font size from the display size and set the font size.
     font_size = skin.getFontSize()
     
     # Make the style sheet.
     font_style_size = 'font: regular ' + str(skin.getFontSize()) + 'px;'
     
     # Define the font object for Qt.
     font = QFont()
     font.setPointSize(font_size)
     
     self.setFont(font)
     
     if parent.skin == "grey":
         # Set the icon path.
         self._icon_directory = os.path.join(self._icon_directory, "white")
         
         # Set the default background and front color.
         back_color = 'background-color: #2C2C2C;'
         font_style_color = 'color: #FFFFFF;'
         font_style = font_style_color + font_style_size
         
         # Set the default skin for all components.
         self.setStyleSheet(back_color + font_style + 'border-color: #4C4C4C;')
         
     elif skin == "white":
         # Set the icon path.
         self._icon_directory = os.path.join(self._icon_directory, "black")
     
     # Get the path of the tethered image.
     self.tethered = path
     
     # Define the return values.
     self.buttonBox.accepted.connect(self.accept)
     self.buttonBox.rejected.connect(self.reject)
     
     # Initialyze the image info view.
     self.tre_img_info.setMaximumSize(QSize(600, 16777215))
     
     # Initialyze the file information view.
     self.lst_fls.setMaximumSize(QSize(16777215, 100))
     self.lst_fls.itemSelectionChanged.connect(self.getImageFileInfo)
     
     # Get tethered image files.
     self.getImageFiles()
示例#5
0
    def __init__(self, parent=None, img_path=None, snd_path=None):
        # Initialyze super class and set up this.
        super(RecordWithImage, self).__init__(parent)
        self.setupUi(self)

        # Set the source directory which this program located.
        self._source_directory = parent.source_directory
        self._icon_directory = parent.icon_directory
        self._qt_image = parent.qt_image
        self._image_extensions = parent.image_extensions
        self._sound_extensions = parent.sound_extensions

        # Initialize the window.
        self.setWindowTitle(self.tr("Check Tethered Image"))
        self.setWindowState(Qt.WindowMaximized)

        # Setup labels with designated language.
        if parent.language == "ja":
            self.lbl_fl_snd.setText("音声ファイル")
            self.btn_rec_start.setText("録音開始")
            self.btn_rec_stop.setText("録音停止")
            self.lbl_img.setText("画像一覧")
        elif parent.language == "en":
            self.lbl_fl_snd.setText("Sound Files")
            self.btn_rec_start.setText("Rec")
            self.btn_rec_stop.setText("Stop")
            self.lbl_img.setText("Image File List")

        # Initialyze the list view of the thumbnails.
        self.lst_img_icon.setIconSize(QSize(200, 200))
        self.lst_img_icon.setMovement(QListView.Static)
        self.lst_img_icon.setModel(QStandardItemModel())

        # Initialyze the record button.
        self.btn_rec_start.setIcon(
            QIcon(QPixmap(os.path.join(self._icon_directory, 'record.png'))))
        self.btn_rec_start.setIconSize(QSize(24, 24))
        self.btn_rec_start.clicked.connect(self.startRecording)

        # Initialyze the stop button.
        self.btn_rec_stop.setIcon(
            QIcon(QPixmap(os.path.join(self._icon_directory, 'pause.png'))))
        self.btn_rec_stop.setIconSize(QSize(24, 24))

        # Define the return values.
        self.bbx_rec_pht.accepted.connect(self.accept)
        self.bbx_rec_pht.rejected.connect(self.reject)

        # Create the graphic view item.
        self.graphicsView = viewer.ImageViewer()
        self.graphicsView.setObjectName("graphicsView")
        self.verticalLayout.addWidget(self.graphicsView)

        # Get the path of the tethered image.
        self.path_img = img_path
        self.path_snd = snd_path

        # Initialyze the thumbnail selector.
        self.lst_img_icon.selectionModel().selectionChanged.connect(
            self.showImage)

        # Create recording thread.
        self.recThread = RecordThreading(parent=self, path=self.path_snd)

        # Get tethered image files.
        self.getImageFiles()
        self.getSoundFiles()

        # Initialyze the user interface.
        # Get the proper font size from the display size and set the font size.
        font_size = skin.getFontSize()

        # Make the style sheet.
        font_style_size = 'font: regular ' + str(skin.getFontSize()) + 'px;'

        # Define the font object for Qt.
        font = QFont()
        font.setPointSize(font_size)

        self.setFont(font)

        if parent.skin == "grey":
            # Set the icon path.
            self._icon_directory = os.path.join(self._icon_directory, "white")

            # Set the default background and front color.
            back_color = 'background-color: #2C2C2C;'
            font_style_color = 'color: #FFFFFF;'
            font_style = font_style_color + font_style_size

            # Set the default skin for all components.
            self.setStyleSheet(back_color + font_style +
                               'border-style: none; border-color: #4C4C4C;')
            #self.frm_photo_view.setStyleSheet('border-style: solid; border-width: 0.5px; border-color: #FFFFFF;')
            self.graphicsView.setStyleSheet(
                'border-style: outset; border-width: 0.5px; border-color: #FFFFFF;'
            )

            self.lst_snd_fls.setStyleSheet(
                'border-style: outset; border-width: 0.5px; border-color: #FFFFFF;'
            )
            self.lst_img_icon.setStyleSheet(
                'border-style: outset; border-width: 0.5px; border-color: #FFFFFF;'
            )
        elif skin == "white":
            # Set the icon path.
            self._icon_directory = os.path.join(self._icon_directory, "black")

        # Set the dialog button size.
        dlg_btn_size = QSize(125, 30)
        self.bbx_rec_pht.buttons()[0].setMinimumSize(dlg_btn_size)
        self.bbx_rec_pht.buttons()[1].setMinimumSize(dlg_btn_size)

        # Set the skin and icon.
        self.bbx_rec_pht.buttons()[0].setIcon(
            skin.getIconFromPath(
                os.path.join(self._icon_directory, 'check.png')))
        self.bbx_rec_pht.buttons()[1].setIcon(
            skin.getIconFromPath(
                os.path.join(self._icon_directory, 'close.png')))

        # Change the icon color red to black.
        self.btn_rec_start.setIcon(
            QIcon(QPixmap(os.path.join(self._icon_directory, 'record.png'))))
        self.btn_rec_stop.setIcon(
            QIcon(QPixmap(os.path.join(self._icon_directory, 'pause.png'))))