Ejemplo n.º 1
0
    def __init__(self, app, systemtype, parent=None):
        QtGui.QWidget.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.systemtype = systemtype
        self.transition = None
        self.app = app
        self.double_ended_connect_runs = []
        self.pick_count = 0

        self.minima_selection = MySelection()

        # set up the list manager
        self.list_manager = ListViewManager(self)

        # define the system
        self.NewSystem()

        # finish setting up the list manager (this must be done after NewSystem() is called)
        self.list_manager.finish_setup()

        #try to load the pymol viewer.
        try:
            self.usepymol = self.system.params.gui.use_pymol
        except (KeyError, AttributeError):
            self.usepymol = config.getboolean("gui", "use_pymol")
        if self.usepymol:
            try:
                from pymol_viewer import PymolViewer
                self.pymolviewer = PymolViewer(self.system.load_coords_pymol)
            except (ImportError or NotImplementedError):
                self.usepymol = False

        if self.usepymol == False:
            #note: glutInit() must be called exactly once.  pymol calls it
            #during pymol.finish_launching(), so if we call it again it will
            #give an error. On the other hand, if we're not using pymol we
            #must call it.
            from OpenGL.GLUT import glutInit
            glutInit()