示例#1
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
示例#2
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 _confirm_pushButton_on_click(self):
     tag_list = ""
     for item in self.flowLayout.itemList:
         tag_list = tag_list + "," + item.widget().text()
     CommonUtils.update_setting_ini_('DEFAULT', 'custom_tag', tag_list)
     self.close()