Ejemplo n.º 1
0
    def getImageFiles(self):
        print("recordWithPhoto::getImageFiles(self)")

        try:
            # Get the file list with given path.
            img_lst_main = general.getFilesWithExtensionList(
                self.path_img, self._image_extensions)

            # Add each image file name to the list box.
            if img_lst_main > 0:
                for img_main in img_lst_main:
                    # Check the image file can be displayed directry.
                    img_base, img_ext = os.path.splitext(img_main)

                    # Get th ful path of the image.
                    img_path = os.path.join(self.path_img, img_main)

                    # Get images that can be shown as QPixmap object.
                    for qt_ext in self._qt_image:
                        # Exit loop if extension is matched with Qt supported image.
                        if img_ext.lower() == qt_ext.lower(): break

                    # Create the QPixmap object
                    pixmap = QPixmap(img_path)

                    # Create the list view item.
                    item = QStandardItem(QIcon(pixmap), img_main)

                    # Append the list view item to the list view.
                    self.lst_img_icon.model().appendRow(item)
        except Exception as e:
            print("Error in RecordWithImage::getImageFiles(self)")
            print(str(e))
Ejemplo n.º 2
0
 def getImageFiles(self):
     print("CheckImageDialog::getImageFiles(self)")
     
     try:
         # Get the file list with given path.
         img_lst_main = general.getFilesWithExtensionList(self.tethered, self._image_extensions)
         img_lst_raw = general.getFilesWithExtensionList(self.tethered, self._raw_image_extensions)
         
         # Add each image file name to the list box.
         if img_lst_main > 0:
             for img_main in img_lst_main:
                 img_item = QListWidgetItem(img_main)
                 self.lst_fls.addItem(img_item)
                 
         # Add each RAW file name to the list box.
         if img_lst_raw > 0:
             for img_raw in img_lst_raw:
                 img_item = QListWidgetItem(img_raw)
                 self.lst_fls.addItem(img_raw)
     except Exception as e:
         print("Error occured in CheckImageDialog::getImageFiles(self)")
         print(str(e))
Ejemplo n.º 3
0
    def getSoundFiles(self):
        print("recordWithPhoto::getSoundFiles")

        try:
            # Clear itmes if exists.
            self.lst_snd_fls.clear()

            # Get the file list with given path.
            snd_lst = general.getFilesWithExtensionList(
                self.path_snd, self._sound_extensions)

            # Add each image file name to the list box.
            if snd_lst > 0:
                for snd_fl in snd_lst:
                    snd_item = QListWidgetItem(snd_fl)
                    self.lst_snd_fls.addItem(snd_item)
        except Exception as e:
            print("Error in RecordWithImage::stopping(self)")
            print(str(e))