When a file opens, it now also opens the file's tab.

This commit is contained in:
The Wobbler 2024-11-30 22:32:18 +01:00
parent ae049233c5
commit c838b99946

View file

@ -1,7 +1,7 @@
#!/usr/bin/python3 #!/usr/bin/python3
import os.path import os.path
from PyQt6.QtWidgets import QFileDialog from PyQt6.QtWidgets import QFileDialog, QTabWidget
from editor import BitEditor from editor import BitEditor
MAX_FILE_SIZE = 262144 # 2^18 MAX_FILE_SIZE = 262144 # 2^18
@ -97,6 +97,8 @@ class File:
self.app.settings.last_opened_file = self.path self.app.settings.last_opened_file = self.path
self.app.gui.main_window.openFileTabs.setCurrentIndex(self.app.gui.main_window.openFileTabs.count() - 1)
def close(self): def close(self):
self.app.gui.main_window.openFileTabs.removeTab(self.bit_editor.tab_index) self.app.gui.main_window.openFileTabs.removeTab(self.bit_editor.tab_index)
del self.app.open_files[self.path] del self.app.open_files[self.path]