ui: use const defines for tab indexes
This commit is contained in:
parent
86730024f6
commit
8705777203
28
main.go
28
main.go
@ -13,6 +13,12 @@ import (
|
|||||||
|
|
||||||
const AutoRefreshInterval = 1 * time.Second
|
const AutoRefreshInterval = 1 * time.Second
|
||||||
|
|
||||||
|
const (
|
||||||
|
ContainersTab int = 0
|
||||||
|
ImagesTab int = 1
|
||||||
|
NetworksTab int = 2
|
||||||
|
VolumesTab int = 3
|
||||||
|
)
|
||||||
func NewStatusDelegate(status string) *qt.QWidget {
|
func NewStatusDelegate(status string) *qt.QWidget {
|
||||||
mw := qt.NewQWidget2()
|
mw := qt.NewQWidget2()
|
||||||
|
|
||||||
@ -318,23 +324,23 @@ func (self *DockerGUI) update_toolbar_buttons(index int) {
|
|||||||
// Show actions based on the current tab
|
// Show actions based on the current tab
|
||||||
|
|
||||||
// Containers tab
|
// Containers tab
|
||||||
self.start_action.SetVisible(index == 0)
|
self.start_action.SetVisible(index == ContainersTab)
|
||||||
self.stop_action.SetVisible(index == 0)
|
self.stop_action.SetVisible(index == ContainersTab)
|
||||||
self.remove_action.SetVisible(index == 0)
|
self.remove_action.SetVisible(index == ContainersTab)
|
||||||
self.terminal_action.SetVisible(index == 0)
|
self.terminal_action.SetVisible(index == ContainersTab)
|
||||||
self.logs_action.SetVisible(index == 0)
|
self.logs_action.SetVisible(index == ContainersTab)
|
||||||
|
|
||||||
// Images tab
|
// Images tab
|
||||||
self.pull_image_action.SetVisible(index == 1)
|
self.pull_image_action.SetVisible(index == ImagesTab)
|
||||||
self.remove_image_action.SetVisible(index == 1)
|
self.remove_image_action.SetVisible(index == ImagesTab)
|
||||||
|
|
||||||
// Networks tab
|
// Networks tab
|
||||||
self.create_network_action.SetVisible(index == 2)
|
self.create_network_action.SetVisible(index == NetworksTab)
|
||||||
self.remove_network_action.SetVisible(index == 2)
|
self.remove_network_action.SetVisible(index == NetworksTab)
|
||||||
|
|
||||||
// Volumes tab
|
// Volumes tab
|
||||||
self.create_volume_action.SetVisible(index == 3)
|
self.create_volume_action.SetVisible(index == VolumesTab)
|
||||||
self.remove_volume_action.SetVisible(index == 3)
|
self.remove_volume_action.SetVisible(index == VolumesTab)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *DockerGUI) create_menu_bar() {
|
func (self *DockerGUI) create_menu_bar() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user