@@ -83,7 +83,7 @@ def __init__(self, parent=None):
83
83
self .tabWidget = QTabWidget (self .splitter )
84
84
self .initTabWidget ()
85
85
self .splitter .setSizes ([self .width () // 5 , self .width () * 4 // 5 ])
86
- self .initDirectoryTree (globalSettings .showDirectoryTree , globalSettings . directoryPath )
86
+ self .initDirectoryTree (globalSettings .showDirectoryTree )
87
87
self .setCentralWidget (self .splitter )
88
88
self .tabWidget .currentChanged .connect (self .changeIndex )
89
89
self .tabWidget .tabCloseRequested .connect (self .closeTab )
@@ -211,6 +211,10 @@ def __init__(self, parent=None):
211
211
self .actionWebEngine .setEnabled (False )
212
212
self .actionWebEngine .setChecked (globalSettings .useWebEngine )
213
213
self .actionShow = self .act (self .tr ('Show directory' ), 'system-file-manager' , self .showInDir )
214
+ self .actionShowDirectoryTree = self .act (self .tr ('Show directory tree' ),
215
+ trigbool = self .initDirectoryTree ,
216
+ shct = Qt .Key .Key_F9 )
217
+ self .actionShowDirectoryTree .setChecked (globalSettings .showDirectoryTree )
214
218
self .actionFind = self .act (self .tr ('Next' ), 'go-next' , self .find ,
215
219
shct = QKeySequence .StandardKey .FindNext )
216
220
self .actionFindPrev = self .act (self .tr ('Previous' ), 'go-previous' ,
@@ -274,6 +278,7 @@ def __init__(self, parent=None):
274
278
self .menuRecentFiles = menuFile .addMenu (self .tr ('Open recent' ))
275
279
self .menuRecentFiles .aboutToShow .connect (self .updateRecentFiles )
276
280
menuFile .addAction (self .actionShow )
281
+ menuFile .addAction (self .actionShowDirectoryTree )
277
282
menuFile .addAction (self .actionSetEncoding )
278
283
menuFile .addAction (self .actionReload )
279
284
menuFile .addSeparator ()
@@ -440,7 +445,8 @@ def dropEvent(e):
440
445
self .tabWidget .dropEvent = dropEvent
441
446
self .tabWidget .setTabBarAutoHide (globalSettings .tabBarAutoHide )
442
447
443
- def initDirectoryTree (self , visible , path ):
448
+ def initDirectoryTree (self , visible ):
449
+ path = globalSettings .directoryPath
444
450
if visible :
445
451
self .fileSystemModel = QFileSystemModel (self .treeView )
446
452
self .fileSystemModel .setRootPath (path )
0 commit comments