def createLogSidePanel(self): position = Workspace.Bottom logWindow = LogWindow() logWindow.setStyleSheet('border-top: 1px solid #818A9A; background: #FFF') Log.connect(logWindow) toolbar = ToolBar('日志') application.addToolBar(toolbar.id(), position, 0) container = SideContainer() container.setStyleSheet('SideContainer {border-top: 1px solid #818A9A;}') container.setToolBar(toolbar) container.setContentWidget(logWindow) logButton = ChoiceButton(u'日志', QIcon('images/logo.png')) self.addPanel(logButton, container, position, ChoiceBar.ChoiceBar_Bottom)
def createLogSidePanel(self): position = Workspace.Bottom logWindow = LogWindow() logWindow.setStyleSheet( 'border-top: 1px solid #818A9A; background: #FFF') Log.connect(logWindow) toolbar = ToolBar('日志') application.addToolBar(toolbar.id(), position, 0) container = SideContainer() container.setStyleSheet( 'SideContainer {border-top: 1px solid #818A9A;}') container.setToolBar(toolbar) container.setContentWidget(logWindow) logButton = ChoiceButton(u'日志', QIcon('images/logo.png')) self.addPanel(logButton, container, position, ChoiceBar.ChoiceBar_Bottom)
def createVmListSidePanel(self): position = Workspace.Left vmList = VMList() vmList.startOrGotoVm.connect(self.startOrGotoVm) mapButton = ChoiceButton(u'虚拟机', QIcon('images/virtualbox.png')) container = SideContainer() container.setContentWidget(vmList) container.setStyleSheet('QTreeView {border: none}') toolbar = ToolBar('虚拟机') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 0) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-left.png')) minimizeButton.clicked.connect( self.sideAreas[position].hidePanelClicked) refreshButton = ToolButton(u'刷新', QIcon('images/refresh.png')) toolbar.addButton(refreshButton) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(mapButton, container, position, ChoiceBar.ChoiceBar_Top)
def createControlSidePanel(self): position = Workspace.Right panel = ControlSidePanel() controlButton = ChoiceButton(u'控制', QIcon('images/control.png')) container = SideContainer() container.setContentWidget(panel) toolbar = ToolBar('控制') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 0) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-right.png')) minimizeButton.clicked.connect( self.sideAreas[position].hidePanelClicked) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(controlButton, container, position)
def createHistorySidePanel(self): position = Workspace.Left gMap = GMap() mapButton = ChoiceButton(u'历史', QIcon('images/history.png')) container = SideContainer() container.setContentWidget(gMap) toolbar = ToolBar('历史') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 1) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-left.png')) minimizeButton.clicked.connect( self.sideAreas[position].hidePanelClicked) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(mapButton, container, position)
def createVmListSidePanel(self): position = Workspace.Left vmList = VMList() vmList.startOrGotoVm.connect(self.startOrGotoVm) mapButton = ChoiceButton(u'虚拟机', QIcon('images/virtualbox.png')) container = SideContainer() container.setContentWidget(vmList) container.setStyleSheet( 'QTreeView {border: none}' ) toolbar = ToolBar('虚拟机') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 0) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-left.png')) minimizeButton.clicked.connect(self.sideAreas[position].hidePanelClicked) refreshButton = ToolButton(u'刷新', QIcon('images/refresh.png')) toolbar.addButton(refreshButton) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(mapButton, container, position, ChoiceBar.ChoiceBar_Top)
def createControlSidePanel(self): position = Workspace.Right panel = ControlSidePanel() controlButton = ChoiceButton(u'控制', QIcon('images/control.png')) container = SideContainer() container.setContentWidget(panel) toolbar = ToolBar('控制') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 0) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-right.png')) minimizeButton.clicked.connect(self.sideAreas[position].hidePanelClicked) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(controlButton, container, position)
def createHistorySidePanel(self): position = Workspace.Left gMap = GMap() mapButton = ChoiceButton(u'历史', QIcon('images/history.png')) container = SideContainer() container.setContentWidget(gMap) toolbar = ToolBar('历史') toolbar.setStyleSheet('ToolBar{border-bottom: 1px solid #818A9A}') application.addToolBar(toolbar.id(), position, 1) minimizeButton = ToolButton(u'最小化', QIcon('images/hide-left.png')) minimizeButton.clicked.connect(self.sideAreas[position].hidePanelClicked) toolbar.addButton(minimizeButton) container.setToolBar(toolbar) self.addPanel(mapButton, container, position)