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
def get_model(cls, full_path): if os.path.exists(full_path): model = BTreeModel.load_file(full_path) return model else: return None
def action_new_handler(self): tmp_path = self.find_non_existing_name() m = BTreeModel() vm = BTreeInstanceVM(m, self, tmp_path) vm.set_modified(True)