本文整理汇总了Python中Main.getIconPath方法的典型用法代码示例。如果您正苦于以下问题:Python Main.getIconPath方法的具体用法?Python Main.getIconPath怎么用?Python Main.getIconPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.getIconPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Main [as 别名]
# 或者: from Main import getIconPath [as 别名]
def __init__(self):
#Build out UI
QtGui.QMainWindow.__init__(self)
self.setupUi(self)
#Setup Inherited Tab Classes
ManagementTasks.ManagementTasks.__init__(self)
Slabs.Slabs.__init__(self)
Stats.Stats.__init__(self)
self.currentTab = 'MTasks'
#Startup the Dialogs
self.addDialog = Add.AddServersClusters()
self.preferencesDialog = Preferences.Preferences()
self.aboutDialog = About.About()
self.cachedItemDialog = CachedItem.CachedItem()
#Load Settings
self.settings = Settings()
#Bind to events
self.connect(self.actionAddClusterServer, QtCore.SIGNAL("triggered()"), self.displayAdd)
self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.displayAbout)
self.connect(self.addDialog, QtCore.SIGNAL('savedCluster'), self.addCluster)
self.connect(self.actionSave, QtCore.SIGNAL('triggered()'), self.save)
self.connect(self.actionPreferences, QtCore.SIGNAL('triggered()'), self.displayPreferences)
self.connect(self.tabsMain, QtCore.SIGNAL('currentChanged(QWidget*)'), self.mainTabChanged)
self.treeCluster.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.connect(self.treeCluster, QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem*, int)'), self.setClusterByTree)
self.connect(self.treeCluster, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.displayTreeContextMenu)
self.currentCluster = None
#Build out Cluster Tree
for cluster in self.settings.servers.getClusters():
self.addCluster(cluster)
#Create the Icons
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(Main.getIconPath("memLogo.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
addIcon = QtGui.QIcon()
addIcon.addPixmap(QtGui.QPixmap(Main.getIconPath("Add.png")), QtGui.QIcon.Normal, QtGui.QIcon.On)
removeIcon = QtGui.QIcon()
removeIcon.addPixmap(QtGui.QPixmap(Main.getIconPath("Remove.png")), QtGui.QIcon.Normal, QtGui.QIcon.On)
activeIcon = QtGui.QIcon()
activeIcon.addPixmap(QtGui.QPixmap(Main.getIconPath("Active.png")), QtGui.QIcon.Normal, QtGui.QIcon.On)
#Reset the Window Icon as paths change
self.setWindowIcon(icon)
#Build out the Cluster Tree Context Menus
self.treeCMServer = QtGui.QMenu()
self.treeCMServerActions = {"addServer": QtGui.QAction(self),
"deleteServer": QtGui.QAction(self)}
self.treeCMServerActions['addServer'].setText("Add Server/Cluster")
self.treeCMServerActions['addServer'].setIcon(addIcon)
self.treeCMServer.addAction(self.treeCMServerActions['addServer'])
self.treeCMServerActions['deleteServer'].setText("Delete")
self.treeCMServerActions['deleteServer'].setIcon(removeIcon)
self.treeCMServer.addAction(self.treeCMServerActions['deleteServer'])
self.connect(self.treeCMServerActions['addServer'], QtCore.SIGNAL("triggered()"), self.displayAdd)
self.connect(self.treeCMServerActions['deleteServer'], QtCore.SIGNAL("triggered()"), self.deleteServer)
self.treeCMCluster = QtGui.QMenu()
self.treeCMClusterActions = {"addServer": QtGui.QAction(self),
"deleteCluster": QtGui.QAction(self),
"makeActive": QtGui.QAction(self)}
self.treeCMClusterActions['addServer'].setText("Add Server/Cluster")
self.treeCMClusterActions['addServer'].setIcon(addIcon)
self.treeCMCluster.addAction(self.treeCMClusterActions['addServer'])
self.treeCMClusterActions['deleteCluster'].setText("Delete")
self.treeCMClusterActions['deleteCluster'].setIcon(removeIcon)
self.treeCMCluster.addAction(self.treeCMClusterActions['deleteCluster'])
self.treeCMClusterActions['makeActive'].setText("Make Active")
self.treeCMClusterActions['makeActive'].setIcon(activeIcon)
self.treeCMCluster.addAction(self.treeCMClusterActions['makeActive'])
self.connect(self.treeCMClusterActions['addServer'], QtCore.SIGNAL("triggered()"), self.displayAdd)
self.connect(self.treeCMClusterActions['deleteCluster'], QtCore.SIGNAL("triggered()"), self.deleteCluster)
self.connect(self.treeCMClusterActions['makeActive'], QtCore.SIGNAL("triggered()"), self.setClusterByContextMenu)