make all columns sortable
This commit is contained in:
parent
1963d02b56
commit
549ca648df
7
main.py
7
main.py
@ -118,6 +118,12 @@ class DockerGUI(QMainWindow):
|
|||||||
self.networks_tree = self.create_tree_widget(["ID", "Name", "Driver"])
|
self.networks_tree = self.create_tree_widget(["ID", "Name", "Driver"])
|
||||||
self.volumes_tree = self.create_tree_widget(["Name", "Driver", "Mountpoint"])
|
self.volumes_tree = self.create_tree_widget(["Name", "Driver", "Mountpoint"])
|
||||||
|
|
||||||
|
# enable sorting
|
||||||
|
self.containers_tree.setSortingEnabled(True)
|
||||||
|
self.images_tree.setSortingEnabled(True)
|
||||||
|
self.networks_tree.setSortingEnabled(True)
|
||||||
|
self.volumes_tree.setSortingEnabled(True)
|
||||||
|
|
||||||
self.containers_tree.itemDoubleClicked.connect(self.open_terminal)
|
self.containers_tree.itemDoubleClicked.connect(self.open_terminal)
|
||||||
|
|
||||||
# Add tree widgets to tabs
|
# Add tree widgets to tabs
|
||||||
@ -427,7 +433,6 @@ class DockerGUI(QMainWindow):
|
|||||||
item = QTreeWidgetItem([id, repository, tag, size])
|
item = QTreeWidgetItem([id, repository, tag, size])
|
||||||
self.images_tree.addTopLevelItem(item)
|
self.images_tree.addTopLevelItem(item)
|
||||||
|
|
||||||
self.sort_tree_widget(self.images_tree, 0, Qt.DescendingOrder)
|
|
||||||
self.filter_tree(self.images_tree, self.images_tab.findChild(QLineEdit).text())
|
self.filter_tree(self.images_tree, self.images_tab.findChild(QLineEdit).text())
|
||||||
self.restore_selection(self.images_tree, selected_items)
|
self.restore_selection(self.images_tree, selected_items)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user