Пример #1
0
class CodeEditorDialog(QtGui.QDialog,
                       ui.ui_CodeEditor.Ui_CodeEditor):
    def __init__(self, commandProcessor, parent = None):
        QtGui.QDialog.__init__(self, parent)
        
        self.commandProcessor = commandProcessor    

        self.nodes = None
                
        # build the gui
        self.buildGui()
        
        # create a controller
        from controller import CodeEditorDialogController
        self.controller = CodeEditorDialogController(self, commandProcessor)
        
        # install filter
        self.tabWidget.installEventFilter(self.controller.tabWidgetFilter)
        
        # connect signals
        self.connectSignals()
    
    def buildGui(self):
        # build the gui created with QtDesigner
        self.setupUi(self)            
        
        self.splitter.setStretchFactor(0, 1) 
        self.splitter.setStretchFactor(1, 7)
        self.tabWidget.clear()
                
        # min size
        self.setMinimumSize(800, 600)

    def setNodes(self, nodes):
        self.controller.onSetNodes(nodes)
        
        for editor in self.editors.values():
            editor.textChanged.connect(self.controller.onEditorTextChanged)
            # self.connect(editor, QtCore.SIGNAL('textChanged()'),
            #              self.controller.onEditorTextChanged)
        
    def closeEvent(self, event):
        self.closeAllEditors()
        event.accept()
        
    def closeAllEditors(self):
        self.controller.closeAllEditors()
        
    def connectSignals(self):
        self.connect(self.nodesLW, QtCore.SIGNAL('itemDoubleClicked(QListWidgetItem*)'), 
                     self.controller.onNodesLWItemDoubleClicked)
        self.connect(self.tabWidget, QtCore.SIGNAL('tabCloseRequested'), 
                     self.controller.onTabCloseRequested)
        self.connect(self.tabWidget, QtCore.SIGNAL('saveRequested'), 
                     self.controller.onSaveRequested)  
Пример #2
0
class CodeEditorDialog(QtGui.QDialog, ui.ui_CodeEditor.Ui_CodeEditor):
    def __init__(self, commandProcessor, parent=None):
        QtGui.QDialog.__init__(self, parent)

        self.commandProcessor = commandProcessor

        self.nodes = None

        # build the gui
        self.buildGui()

        # create a controller
        from controller import CodeEditorDialogController
        self.controller = CodeEditorDialogController(self, commandProcessor)

        # install filter
        self.tabWidget.installEventFilter(self.controller.tabWidgetFilter)

        # connect signals
        self.connectSignals()

    def buildGui(self):
        # build the gui created with QtDesigner
        self.setupUi(self)

        self.splitter.setStretchFactor(0, 1)
        self.splitter.setStretchFactor(1, 7)
        self.tabWidget.clear()

        # min size
        self.setMinimumSize(800, 600)

    def setNodes(self, nodes):
        self.controller.onSetNodes(nodes)

        for editor in self.editors.values():
            editor.textChanged.connect(self.controller.onEditorTextChanged)
            # self.connect(editor, QtCore.SIGNAL('textChanged()'),
            #              self.controller.onEditorTextChanged)

    def closeEvent(self, event):
        self.closeAllEditors()
        event.accept()

    def closeAllEditors(self):
        self.controller.closeAllEditors()

    def connectSignals(self):
        self.connect(self.nodesLW,
                     QtCore.SIGNAL('itemDoubleClicked(QListWidgetItem*)'),
                     self.controller.onNodesLWItemDoubleClicked)
        self.connect(self.tabWidget, QtCore.SIGNAL('tabCloseRequested'),
                     self.controller.onTabCloseRequested)
        self.connect(self.tabWidget, QtCore.SIGNAL('saveRequested'),
                     self.controller.onSaveRequested)
Пример #3
0
    def __init__(self, commandProcessor, parent=None):
        QtGui.QDialog.__init__(self, parent)

        self.commandProcessor = commandProcessor

        self.nodes = None

        # build the gui
        self.buildGui()

        # create a controller
        from controller import CodeEditorDialogController
        self.controller = CodeEditorDialogController(self, commandProcessor)

        # install filter
        self.tabWidget.installEventFilter(self.controller.tabWidgetFilter)

        # connect signals
        self.connectSignals()
Пример #4
0
    def __init__(self, commandProcessor, parent = None):
        QtGui.QDialog.__init__(self, parent)
        
        self.commandProcessor = commandProcessor    

        self.nodes = None
                
        # build the gui
        self.buildGui()
        
        # create a controller
        from controller import CodeEditorDialogController
        self.controller = CodeEditorDialogController(self, commandProcessor)
        
        # install filter
        self.tabWidget.installEventFilter(self.controller.tabWidgetFilter)
        
        # connect signals
        self.connectSignals()