open file dialog in folder of currently open file
This commit is contained in:
13
tabs.py
13
tabs.py
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
from typing import Mapping
|
||||
from typing import Mapping, Optional
|
||||
|
||||
from PyQt6.QtWidgets import *
|
||||
from PyQt6.QtCore import *
|
||||
@@ -13,7 +13,6 @@ from settings import Settings
|
||||
|
||||
|
||||
class Tabs(QWidget):
|
||||
tabs_by_index = {}
|
||||
tabs_by_filename = {}
|
||||
|
||||
def __init__(self, settings: Settings):
|
||||
@@ -69,3 +68,13 @@ class Tabs(QWidget):
|
||||
def destruct(self):
|
||||
while self.tabs.count() > 0:
|
||||
self._close_tab(0)
|
||||
|
||||
def _current_tab(self) -> int:
|
||||
return self.tabs.currentIndex()
|
||||
|
||||
def current_file(self) -> Optional[str]:
|
||||
if self.tabs.currentIndex() < 0:
|
||||
return None
|
||||
|
||||
full_tab: FullTabWidget = self.tabs.widget(self.tabs.currentIndex())
|
||||
return full_tab.get_file()
|
||||
|
||||
Reference in New Issue
Block a user