Commit 036fd365 authored by 3Yan's avatar 3Yan

Sort order of the file tree can be changed

parent 0910b01b
......@@ -12,7 +12,7 @@ from . import zcetools
from . import zcetools_help
__version__ = "0.0.17"
__version__ = "0.0.18"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'filetools',
......
......@@ -94,7 +94,19 @@ def treeDockWidget(actionname, cfval, update, loadfnc, parent,
treeview.expand(activeDir)
dirview = QtWidgets.QListView()
dirview.setModel(fileModel)
sortorder = QtWidgets.QComboBox()
sortorder.addItems(("name","time"))
sortorder.currentIndexChanged.connect(lambda index:
fileModel.sort(index and 3, 1))
orderlayout = QtWidgets.QHBoxLayout()
orderlayout.addStretch(1)
for i in (QtWidgets.QLabel("Sort by:"), sortorder):
orderlayout.addWidget(i)
dock = AugDock("Folder View", actionname, cfval)
dock.layout.addLayout(orderlayout)
[dock.layout.addWidget(i) for i in (treeview, dirview)]
def scrolltoonce():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment