示例#1
0
 def action_open_handler(self):
     p = QFileDialog()
     p.setViewMode(QFileDialog.List)
     p.setFileMode(QFileDialog.ExistingFiles)
     p.setDirectory(config.src_path)
     p.exec()
     paths = p.selectedFiles()
     for pth in paths:
         i = self.file_already_open(pth)
         if i:
             self.mdi.setActiveSubWindow(i.sub_window)
         else:
             try:
                 m = BTreeModel.load_file(pth)
                 vm = BTreeInstanceVM(m, self, pth)
             except PermissionError:
                 pass
示例#2
0
 def action_open_handler(self):
     p = QFileDialog()
     p.setViewMode(QFileDialog.List)
     p.setFileMode(QFileDialog.ExistingFiles)
     p.setDirectory(config.src_path)
     p.exec()
     paths = p.selectedFiles()
     for pth in paths:
         i = self.file_already_open(pth)
         if i:
             self.mdi.setActiveSubWindow(i.sub_window)
         else:
             try:
                 m = BTreeModel.load_file(pth)
                 vm = BTreeInstanceVM(m, self, pth)
             except PermissionError:
                 pass
示例#3
0
 def get_model(cls, full_path):
     if os.path.exists(full_path):
         model = BTreeModel.load_file(full_path)
         return model
     else:
         return None
示例#4
0
 def action_new_handler(self):
     tmp_path = self.find_non_existing_name()
     m = BTreeModel()
     vm = BTreeInstanceVM(m, self, tmp_path)
     vm.set_modified(True)
示例#5
0
 def get_model(cls, full_path):
     if os.path.exists(full_path):
         model = BTreeModel.load_file(full_path)
         return model
     else:
         return None