Пример #1
0
 def __init__(self, node=None):
     self.node = node
     if isinstance(self.node, NXlink):
         self._linked = QtGui.QIcon(
             pkg_resources.resource_filename('nexpy.gui',
                                             'resources/link-icon.png'))
     elif isinstance(self.node, NXroot):
         self._locked = QtGui.QIcon(
             pkg_resources.resource_filename('nexpy.gui',
                                             'resources/lock-icon.png'))
         self._unlocked = QtGui.QIcon(
             pkg_resources.resource_filename('nexpy.gui',
                                             'resources/unlock-icon.png'))
     super(NXTreeItem, self).__init__(self.node.nxname)
Пример #2
0
 def init_gui(self):
     """Initialize the GUI."""
     self.app = guisupport.get_app_qt4()
     self.window = MainWindow(self.app, self.tree, config=self.config)
     self.window.log = self.log
     global _mainwindow
     _mainwindow = self.window
     if 'svg' in QtGui.QImageReader.supportedImageFormats():
         self.app.icon = QtGui.QIcon(
             pkg_resources.resource_filename('nexpy.gui',
                                             'resources/icon/NeXpy.svg'))
     else:
         self.app.icon = QtGui.QIcon(
             pkg_resources.resource_filename('nexpy.gui',
                                             'resources/icon/NeXpy.png'))
     QtGui.QApplication.setWindowIcon(self.app.icon)