def __init__(self):
     super(custom_lab_widget, self).__init__()
     self.setupUi(self)
     self.add_tab_pushButton.clicked.connect(self._add_lab_on_click)
     self.confirm_pushButton.clicked.connect(self._confirm_pushButton_on_click)
     custom_tag_str = str(CommonUtils.get_setting_ini_('DEFAULT', 'custom_tag', ""))
     for tag in custom_tag_str.split(","):
         if tag.strip() == '':
             continue
         self.checkBox = QCheckBox(tag)
         self.checkBox.setChecked(False)
         self.flowLayout.addWidget(self.checkBox)
Example #2
0
 def _openfolder(self):
     try:
         directory = QFileDialog.getExistingDirectory(
             None, "选取文件夹",
             CommonUtils.get_setting_ini_('DEFAULT', 'last_open_folder',
                                          "./"))  # 起始路径
         if directory.strip() == "":
             return
         CommonUtils.update_setting_ini_('DEFAULT', 'last_open_folder',
                                         directory)
         self.process_folder(directory)
     except Exception as e:
         print(e)
         pass
Example #3
0
 def _openfiles(self):
     try:
         files, file_type = QFileDialog.getOpenFileNames(
             None, "多文件选择",
             CommonUtils.get_setting_ini_('DEFAULT', 'last_open_folder',
                                          "./"), "All Files (*)")
         # files, file_type = QFileDialog.getOpenFileName(self, 'Open File', '',  "All Files (*)",options = QFileDialog.DontUseNativeDialog)
         if len(files) == 0:
             return
         CommonUtils.update_setting_ini_('DEFAULT', 'last_open_folder',
                                         files[0])
         # self._save_last_open_folder(files[0])
         self.process_files(files)
     except Exception as e:
         print(e)
         pass
 def __init__(self, video_hash, parentWidget):
     super(edit_video_custom_tab, self).__init__()
     self.video_hash = video_hash
     self.setupUi(self)
     self.parentWidget = parentWidget
     self.confirm_pushButton.clicked.connect(
         self._confirm_pushButton_on_click)
     custom_tag_str = str(
         CommonUtils.get_setting_ini_('DEFAULT', 'custom_tag', ""))
     video_tag_str = SqlUtils._select_(
         "SELECT custom_tag from video where hash = " + '\'' + video_hash +
         '\'')[0][0]
     if video_tag_str == None:
         video_tag_str = ''
     video_tag_list = video_tag_str.split(",")
     for tag in custom_tag_str.split(","):
         if tag.strip() == '':
             continue
         self.checkBox = QCheckBox(tag)
         self.checkBox.setChecked(False)
         if tag in video_tag_list:
             self.checkBox.setChecked(True)
         self.flowLayout.addWidget(self.checkBox)