diff --git a/file.py b/file.py index 31c6594..3182824 100644 --- a/file.py +++ b/file.py @@ -17,6 +17,8 @@ class FileActions: if dialog.exec(): for file_path in dialog.selectedFiles(): self.app.open_files.append(File(self.app, file_path, file_path.split("/")[-1])) + if not file_path in self.app.open_files: # dont open file twice + self.app.open_files[file_path] = File(self.app, file_path, file_path.split("/")[-1]) class File: diff --git a/main.py b/main.py index c56a1d8..9ca6e73 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ class BreadEditor: self.utils = Utils(self) self.file_actions = FileActions(self) - self.open_files = [] + self.open_files = {} self.qt_app = QApplication(sys.argv)