Exemplo n.º 1
0
            def actions(self):
                minilab = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/openalealogo.png"),
                    "MiniLab", self.mainwindow)
                lab3d = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/openalealogo.png"),
                    "3DLab", self.mainwindow)
                plantlab = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/openalealogo.png"),
                    "PlantLab", self.mainwindow)
                tissuelab = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/openalealogo.png"),
                    "TissueLab", self.mainwindow)

                QtCore.QObject.connect(minilab,
                                       QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow._mini)
                QtCore.QObject.connect(lab3d, QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow._lab3d)
                QtCore.QObject.connect(plantlab,
                                       QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow._plant)
                QtCore.QObject.connect(tissuelab,
                                       QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow._tissue)

                _actions = [["Extension", "Select an Extension", minilab, 0],
                            ["Extension", "Select an Extension", lab3d, 0],
                            ["Extension", "Select an Extension", plantlab, 0],
                            ["Extension", "Select an Extension", tissuelab, 0]]
                return None
Exemplo n.º 2
0
            def actions(self):
                actionDefault = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/layout_blue.png"),
                    "Load Default", self.mainwindow)
                actionRestorePref = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/layout_green.png"),
                    "Load Prefered", self.mainwindow)
                actionSetPref = QtGui.QAction(
                    QtGui.QIcon(":/images/resources/layout_red.png"),
                    "Save Prefered", self.mainwindow)

                QtCore.QObject.connect(actionDefault,
                                       QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow.defaultSettings)
                QtCore.QObject.connect(actionRestorePref,
                                       QtCore.SIGNAL('triggered(bool)'),
                                       self.mainwindow.preferedSettings)
                QtCore.QObject.connect(
                    actionSetPref, QtCore.SIGNAL('triggered(bool)'),
                    self.mainwindow.registerPreferedSettings)

                _actions = [["Help", "Window Layout", actionDefault, 1],
                            ["Help", "Window Layout", actionRestorePref, 1],
                            ["Help", "Window Layout", actionSetPref, 1]]
                return _actions
Exemplo n.º 3
0
 def mouseDoubleClickEvent(self,event):
     if event.modifiers() == QtCore.Qt.NoModifier:
         if event.button()  == QtCore.Qt.LeftButton:
             self.select(event.pos())
             selection = self.selectedName()
             if selection == -1:
                 npoint = self.pointOnEditionPlane(event.pos())
                 res = self.pointsConstraints.addPointEvent(npoint,self.curveAccessor)
                 if res:
                     index,npoint = res
                     self.curveAccessor.insertPoint(index,npoint)
                     self.emit(QtCore.SIGNAL('valueChanged()'))
         elif event.button()  == QtCore.Qt.RightButton:
             self.select(event.pos())
             selection = self.selectedName()
             if selection != -1 :
                 self.curveAccessor.delPoint(selection)
                 self.emit(QtCore.SIGNAL('valueChanged()'))
         self.createControlPointsRep()
         self.updateGL()
     elif event.modifiers() == QtCore.Qt.ShiftModifier:
         self.select(event.pos())
         selection = self.selectedName()
         if selection != -1 :
             self.curveAccessor.delPoint(selection)
             self.emit(QtCore.SIGNAL('valueChanged()'))
             self.createControlPointsRep()
             self.updateGL()
     else:
         QGLViewer.mouseDoubleClickEvent(self,event)
Exemplo n.º 4
0
    def __init__(self, session=None, controller=None, parent=None):
        super(HelpWidget, self).__init__(parent=parent)
        self.setAccessibleName("HelpWidget")

        actionHelpOpenAlea = QtGui.QAction(
            QtGui.QIcon(":/images/resources/openalealogo.png"),
            "OpenAlea WebSite", self)
        actionHelpGForge = QtGui.QAction(
            QtGui.QIcon(":/images/resources/git.png"), "Submit Issues", self)
        actionHelpTasks = QtGui.QAction(
            QtGui.QIcon(":/images/resources/gforge.png"), "See Tasks", self)
        actionEditPref = QtGui.QAction(
            QtGui.QIcon(":/images/resources/node.png"), "Preferences", self)

        self.connect(actionHelpOpenAlea, QtCore.SIGNAL('triggered(bool)'),
                     self.openWebsiteOpenalea)
        self.connect(actionHelpGForge, QtCore.SIGNAL('triggered(bool)'),
                     self.openOALabIssues)
        self.connect(actionHelpTasks, QtCore.SIGNAL('triggered(bool)'),
                     self.openOALabTasks)
        actionEditPref.triggered.connect(self.open_preferences)

        self._actions = [
            ["Help", "Website", actionHelpOpenAlea, 0],
            ["Help", "Website", actionHelpGForge, 0],
            ["Help", "Settings", actionEditPref, 0],
        ]
        self.setText(default_text)
        register_helper(self)
Exemplo n.º 5
0
    def __init__(self, parent=None, session=None):
        super(SearchWidget, self).__init__(parent)

        self._editor = parent
        self.hiden = True

        self.setMinimumSize(100, 100)
        self.setWindowTitle("Search")

        self.actionSearch = QtGui.QAction("Search Next", self)
        self.actionBackSearch = QtGui.QAction("Search Previous", self)
        self.actionReplace = QtGui.QAction("Replace All", self)
        self.lineEdit = QtGui.QLineEdit()
        self.lineEditReplace = QtGui.QLineEdit()
        self.textSearch = QtGui.QLabel("Search :")
        self.textReplaceBy = QtGui.QLabel("Replace by :")

        self.btnNext = QtGui.QToolButton()
        self.btnPrev = QtGui.QToolButton()
        self.btnReplace = QtGui.QToolButton()
        self.btnReplace.setMinimumSize(100, 40)
        self.btnNext.setMinimumSize(100, 40)
        self.btnPrev.setMinimumSize(100, 40)
        self.btnReplace.setDefaultAction(self.actionReplace)
        self.btnPrev.setDefaultAction(self.actionBackSearch)
        self.btnNext.setDefaultAction(self.actionSearch)

        self.caseBtn = QtGui.QCheckBox("Match Case")
        self.wholeBtn = QtGui.QCheckBox(
            "Whole Word (Disabled if case sensitive)")

        QtCore.QObject.connect(self.actionBackSearch,
                               QtCore.SIGNAL('triggered(bool)'),
                               self.searchBack)
        QtCore.QObject.connect(self.actionSearch,
                               QtCore.SIGNAL('triggered(bool)'), self.search)
        QtCore.QObject.connect(self.actionReplace,
                               QtCore.SIGNAL('triggered(bool)'),
                               self.replaceall)
        QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL('returnPressed()'),
                               self.search)

        layout = QtGui.QGridLayout()
        layout.setAlignment(QtCore.Qt.AlignLeft)

        layout.addWidget(self.textSearch, 0, 0)
        layout.addWidget(self.lineEdit, 0, 1, 1, 2)
        layout.addWidget(self.textReplaceBy, 1, 0)
        layout.addWidget(self.lineEditReplace, 1, 1, 1, 2)

        layout.addWidget(self.caseBtn, 2, 0)
        layout.addWidget(self.wholeBtn, 2, 1)

        layout.addWidget(self.btnReplace, 3, 0)
        layout.addWidget(self.btnPrev, 3, 1)
        layout.addWidget(self.btnNext, 3, 2)

        self.setLayout(layout)
Exemplo n.º 6
0
 def __updateStatus(self, i=None):
     if not i is None and i >= 0:
         if int(i) < int(len(self.view.objects)):
             if self.view.objects[i][0].managePrimitive():
                 self.emit(QtCore.SIGNAL('valueChanged(bool)'), True)
             else:
                 self.emit(QtCore.SIGNAL('valueChanged(bool)'), False)
         else:
             self.emit(QtCore.SIGNAL('valueChanged(bool)'), False)
     else:
         self.emit(QtCore.SIGNAL('valueChanged(bool)'), False)
Exemplo n.º 7
0
    def __init__(self, node, parent):

        QtGui.QDialog.__init__(self, parent)
        NodeWidget.__init__(self, node)

        self.gridlayout = QtGui.QGridLayout(self)
        self.gridlayout.setContentsMargins(3, 3, 3, 3)
        self.gridlayout.setSpacing(5)

        self.package_lineedit_label = QtGui.QLabel('1. Set the package', self)
        self.gridlayout.addWidget(self.package_lineedit_label, 0, 0)

        self.package_lineedit = QtGui.QLineEdit(self)
        self.gridlayout.addWidget(self.package_lineedit, 0, 1, 1, 3)
        self.connect(self.package_lineedit, QtCore.SIGNAL("textChanged()"),
                     self.package_changed)

        self.datadir_lineedit = QtGui.QLineEdit(self)
        self.datadir_lineedit.setReadOnly(True)
        self.gridlayout.addWidget(self.datadir_lineedit, 1, 1, 1, 3)

        self.metadata_textedit = QtGui.QTextEdit('', self)
        self.metadata_textedit.setReadOnly(True)
        self.metadata_textedit.setTextInteractionFlags(
            QtCore.Qt.TextBrowserInteraction)
        self.gridlayout.addWidget(self.metadata_textedit, 2, 1, 1, 3)

        self.glob_lineedit_label = QtGui.QLabel(
            '2.Filter the data: (e.g., *.dat)', self)
        self.gridlayout.addWidget(self.glob_lineedit_label, 3, 0)

        self.glob_lineedit = QtGui.QLineEdit(self)
        self.gridlayout.addWidget(self.glob_lineedit, 3, 1, 1, 2)
        self.connect(self.glob_lineedit, QtCore.SIGNAL("textChanged()"),
                     self.glob_changed)

        self.filenames_combobox_label = QtGui.QLabel(
            '3. Select the data file:', self)
        self.gridlayout.addWidget(self.filenames_combobox_label, 4, 0)

        self.filenames_combobox = QtGui.QComboBox(self)
        self.connect(self.filenames_combobox, QtCore.SIGNAL("activated()"),
                     self.filename_changed)
        self.gridlayout.addWidget(self.filenames_combobox, 4, 1, 1, 3)

        self.setWindowTitle("SharedDatabrowser")
        self.setGeometry(250, 200, 350, 550)

        self.updating = False

        self.notify(node, ("input_modified", 0))
        self.notify(node, ("caption_modified", node.get_caption()))
Exemplo n.º 8
0
            def __init__(self, node, parent):

                LPyWindow.__init__(self, parent)
                NodeWidget.__init__(self, node)
                QtCore.QObject.connect(self.codeeditor,
                                       QtCore.SIGNAL('textChanged()'),
                                       self.updateNode)
Exemplo n.º 9
0
 def init(self):
     self.defaultColor = self.backgroundColor()
     self.updateSceneDimension()
     self.setHandlerKeyboardModifiers(QGLViewer.CAMERA,
                                      QtCore.Qt.AltModifier)
     self.setHandlerKeyboardModifiers(QGLViewer.FRAME, QtCore.Qt.NoModifier)
     self.setHandlerKeyboardModifiers(QGLViewer.CAMERA,
                                      QtCore.Qt.ControlModifier)
     self.setMouseBinding(QtCore.Qt.LeftButton, QGLViewer.FRAME,
                          QGLViewer.TRANSLATE)
     self.setMouseBinding(QtCore.Qt.RightButton, QGLViewer.FRAME,
                          QGLViewer.NO_MOUSE_ACTION)
     self.setMouseBinding(QtCore.Qt.ControlModifier + QtCore.Qt.LeftButton,
                          QGLViewer.CAMERA, QGLViewer.TRANSLATE)
     self.setMouseBinding(QtCore.Qt.ControlModifier + QtCore.Qt.RightButton,
                          QGLViewer.CAMERA, QGLViewer.NO_MOUSE_ACTION)
     self.camera().setUpVector(Vec(0, 1, 0))
     self.camera().setType(Camera.ORTHOGRAPHIC)
     self.camConstraint = WorldConstraint()
     self.camConstraint.setRotationConstraintType(
         AxisPlaneConstraint.FORBIDDEN)
     self.camera().frame().setConstraint(self.camConstraint)
     self.showEntireScene()
     self.setSelectRegionWidth(5)
     self.setSelectRegionHeight(5)
     self.manipulator = ManipulatedFrame()
     self.setManipulatedFrame(self.manipulator)
     QtCore.QObject.connect(self.manipulator,
                            QtCore.SIGNAL('manipulated()'),
                            self.updatePoints)
Exemplo n.º 10
0
 def createSelectionManipulator(self):
     """ ensure that the selection manipulator is existing and valid """
     if not self.selectionManipulator:
         self.selectionManipulator = SelectionManipulator()
         QtCore.QObject.connect(self.selectionManipulator,
                                QtCore.SIGNAL("valueChanged()"),
                                self.__propagate_valuechanged__)
Exemplo n.º 11
0
    def __init__(self, node, parent, parameter_str, interface):
        """Constructor

        :Parameters:
            - `node` (Node) - node that own the widget
            - `parent` (QWidget) - parent widget
            - `parameter_str` (str) - the parameter key the widget is associated to
            - `interface` (Ismth) - instance of interface object
        """

        QtGui.QMainWindow.__init__(self, parent)
        IInterfaceWidget.__init__(self, node, parent, parameter_str, interface)
        self.setMinimumSize(100, 50)

        #ui
        self._lab = ScalableLabel()
        self.setCentralWidget(self._lab)

        self._bot_toolbar = QtGui.QToolBar("slider")

        self._img_slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        self._img_slider.setEnabled(False)
        QtCore.QObject.connect(self._img_slider,
                               QtCore.SIGNAL("valueChanged(int)"),
                               self.slice_changed)

        self._bot_toolbar.addWidget(self._img_slider)
        self.addToolBar(QtCore.Qt.BottomToolBarArea, self._bot_toolbar)
        self._bot_toolbar.hide()

        #update
        self.notify(node, ("input_modified", self.param_str))
Exemplo n.º 12
0
    def __init__(self,
                 parent=None,
                 scene=None,
                 statefilename='.temp_scene.xml',
                 shareWidget=None):
        QGLViewer.__init__(self, parent, shareWidget)
        self.set_bg_white()
        # set the scene
        if scene == None:
            scene = self.defaultScene()
        self.scene = scene
        # set some parameters
        self.setAxisIsDrawn(False)  # show axis
        self.setGridIsDrawn(True)  # show grid

        orientation = Quaternion(0.475117, 0.472505, 0.524479, 0.525286)
        position = Vec(2.91287, -0.0109797, 0.659613)
        self.camera().setPosition(position)
        self.camera().setOrientation(orientation)

        self.camera().setSceneRadius(1)  # Size of vectors x,y,z
        # connection
        self.connect(self, QtCore.SIGNAL("drawNeeded()"), self.draw)
        self.orientation_initiale = self.camera().orientation()
        self.position_initiale = self.camera().position()
        # Block "*.xml" save
        self.setStateFileName("")
        # Disable Quit in clicking on 'Escape'
        # Set "show_axis" instead of "kill_application"
        self.setShortcut(0, QtCore.Qt.Key_Escape)
Exemplo n.º 13
0
 def clearSelectionManipulator(self):
     """ clear the selection manipulator """
     if self.selectionManipulator:
         self.selectionManipulator.clear()
         QtCore.QObject.disconnect(self.selectionManipulator,
                                   QtCore.SIGNAL("valueChanged()"),
                                   self.__propagate_valuechanged__)
         self.selectionManipulator = None
def connect(widget, signal, method):
    if signal:
        if hasattr(signal, 'connect') and hasattr(signal, 'disconnect'):
            signal.connect(method)
        elif isinstance(signal, basestring):
            widget.connect(widget, QtCore.SIGNAL(signal), method)
        else:
            raise NotImplementedError, 'Signal %s support is not implemented' % signal
Exemplo n.º 15
0
 def _connect(self, method):
     signal = self.value_changed_signal
     if signal:
         if hasattr(signal, 'connect') and hasattr(signal, 'disconnect'):
             signal.connect(method)
         elif isinstance(signal, basestring):
             self.connect(self, QtCore.SIGNAL(signal), method)
         else:
             raise NotImplementedError, 'Signal %s support is not implemented' % signal
    def __init__(self):
        QtGui.QWidget.__init__(self)
        self._im_view = PixmapStackView()
        self._label = ScalableLabel()

        self._layout = QtGui.QVBoxLayout(self)
        self._layout.addWidget(self._label)

        self._label.setMouseTracking(True)
        self._last_mouse_x = 0
        self._last_mouse_y = 0

        self.connect(self._label, QtCore.SIGNAL("mouse_press"), self.mouse_pressed)
        self.connect(self._label, QtCore.SIGNAL("mouse_move"), self.mouse_pressed)

        self.axis = 2
        self.inc = 1 # index increment
        self._palette_name = None
Exemplo n.º 17
0
    def __init__(self):
        QtGui.QTreeView.__init__(self)

        self._model = ProjectManagerModel()
        self.pm = ProjectManager()
        self.setModel(self._model)

        self._model.dataChanged.connect(self._on_model_changed)

        self.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.connect(self, QtCore.SIGNAL('doubleClicked(const QModelIndex&)'),
                     self.open)

        self.setHeaderHidden(True)
        self.setDragEnabled(True)
        self.setDropIndicatorShown(True)
        self.setAcceptDrops(True)

        self._actions = []
        self._new_file_actions = {}
        self.paradigms_actions = []
        self.paradigms = {}

        self.actionEditMeta = QtGui.QAction(qicon("book.png"),
                                            "Edit Project Information", self)
        self.actionEditMeta.triggered.connect(self.edit_metadata)

        self.actionImportFile = QtGui.QAction(qicon("open.png"), "Import file",
                                              self)
        self.actionImportFile.triggered.connect(self.import_file)

        self.actionSaveProjAs = QtGui.QAction(qicon("save.png"), "Save As",
                                              self)
        self.actionSaveProjAs.triggered.connect(self.save_as)

        self.actionSaveProj = QtGui.QAction(qicon("save.png"), "Save project",
                                            self)
        self.actionSaveProj.triggered.connect(self.save)
        self.actionSaveProj.setShortcut(
            QtGui.QApplication.translate("MainWindow", "Ctrl+Shift+S", None,
                                         QtGui.QApplication.UnicodeUTF8))

        self.actionCloseProj = QtGui.QAction(qicon("closeButton.png"),
                                             "Close project", self)
        self.actionCloseProj.triggered.connect(self.close)
        self.actionCloseProj.setShortcut(self.tr("Ctrl+Shift+W"))

        self.actionNewProj = QtGui.QAction(qicon("new.png"), "New Project",
                                           self)
        self.actionNewProj.triggered.connect(self.new_project)
        self.actionNewProj.setShortcut(self.tr("Ctrl+Shift+N"))

        self.actionOpenProj = QtGui.QAction(qicon("open.png"), "Open Project",
                                            self)
        self.actionOpenProj.triggered.connect(self.open_project)
        self.actionOpenProj.setShortcut(self.tr('Ctrl+Shift+O'))
Exemplo n.º 18
0
 def updatePoints(self):
     sel = self.selection
     if sel != -1:
         p = self.manipulator.getPosition()
         p = (p[0],p[1])
         p = self.pointsConstraints.movePointEvent(p,self.selection,self.curveAccessor)
         self.curveAccessor.setPoint(self.selection,p)
         self.createControlPointsRep()
         self.updateGL()
         self.emit(QtCore.SIGNAL('valueChanged()'))
Exemplo n.º 19
0
    def contextMenuEvent(self, event):
        """ Context menu event : Display the menu"""


        menu = QtGui.QMenu(self)
        action = menu.addAction("Remove")
        self.connect(action, QtCore.SIGNAL("triggered()"), self.remove_element)

        menu.move(event.globalPos())
        menu.show()
Exemplo n.º 20
0
    def create_buttons(self):
        """ Remove old buttons and add new ones.
        """
        inlist = self.node.func.get_selection_list()
        select = self.node.func.get_selected_flags()
        layout = self.layout()
        
        # add missing button
        for i in range(len(inlist)-len(self.widgets)):
            button = QtGui.QRadioButton("NEW") ##QtGui.QCheckBox(elt_name) ##
            self.btGroup.addButton(button)
            self.widgets.append(button)
            self.connect(button, QtCore.SIGNAL("clicked()"), lambda index=i: self.reactToClick(index))
            layout.addWidget(button)
            
        # hide unnecessary button
        for i in range(len(self.widgets)-len(inlist)):
            self.widgets[-i-1].setHidden(True)
            
        # sert name, visible and state
        for i, name in enumerate(inlist):
            bt = self.widgets[i]
            bt.setHidden(False)
            bt.setText(str(name))
            bt.setChecked(select[i])
            
        return
  
        for w in self.widgets:
            layout.removeWidget(w)
        
        layout = self.layout()
        layout.addWidget(self.btGroup)

        self.widgets = []

        for i, elt in enumerate(self.node.func.get_selection_list()):
            elt_name = str(elt)
            button = QtGui.QRadioButton(elt_name) ##QtGui.QCheckBox(elt_name) ##
            self.btGroup.addButton(button)
            button.setChecked(self.node.func.selected[i])

            self.connect(button, QtCore.SIGNAL("clicked()"), lambda index=i: self.reactToClick(index))
Exemplo n.º 21
0
    def __init__(self, num):
        """ overwrite the FigureManageAt.__init__ """
        #focused = QtGui.QApplication.focusWidget()
        self.window = MplTabWidget.get_singleton()
        self.canvas, self.widget = self.window.add_tab_canvas(
            num, self._widgetclosed)
        FigureManagerBase.__init__(self, self.canvas, num)

        # self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        ##image = os.path.join( mpl.rcParams['datapath'],'images','matplotlib.png' )
        ##self.window.setWindowIcon(QtGui.QIcon( image ))

        # Give the keyboard focus to the figure instead of the
        # manager; StrongFocus accepts both tab and click to focus and
        # will enable the canvas to process event w/o clicking.
        # ClickFocus only takes the focus is the window has been
        # clicked
        # on. http://developer.qt.nokia.com/doc/qt-4.8/qt.html#FocusPolicy-enum
        self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus)
        # self.canvas.setFocus()

        # QtCore.QObject.connect( self.widget, QtCore.SIGNAL( 'destroyed()' ),
        # self._widgetclosed )
        self.window._destroying = False

        self.toolbar = self._get_toolbar(self.canvas, self.widget)
        if self.toolbar is not None:
            self.widget.addToolBar(self.toolbar)
            QtCore.QObject.connect(self.toolbar, QtCore.SIGNAL("message"),
                                   self._show_message)
            tbs_height = self.toolbar.sizeHint().height()
        else:
            tbs_height = 0

        # resize the main window so it will display the canvas with the
        # requested size:
        ##cs = canvas.sizeHint()
        ##sbs = self.window.statusBar().sizeHint()
        ##self._status_and_tool_height = tbs_height+sbs.height()
        ##height = cs.height() + self._status_and_tool_height
        ##self.window.resize(cs.width(), height)
        ##
        # self.window.setCentralWidget(self.canvas)

        if mpl.is_interactive():
            self.window.show()

        def notify_axes_change(fig):
            # This will be called whenever the current axes is changed
            self.window.setCurrentWidget(self.widget)
            if self.toolbar is not None:
                self.toolbar.update()

        self.canvas.figure.add_axobserver(notify_axes_change)
    def __init__(self, node, parent=None):

        PointSelection.__init__(self)
        NodeWidget.__init__(self, node)

        self.notify(node, ('input_modified', ))

        self.connect(self, QtCore.SIGNAL("points_changed"), \
                     self.pointsChanged)

        self.window().setWindowTitle(node.get_caption())
Exemplo n.º 23
0
    def __init__(self):
        AbstractListener.__init__(self)
        super(WorldBrowser, self).__init__()
        self.world = None

        QtCore.QObject.connect(self.tree, QtCore.SIGNAL('doubleClicked(const QModelIndex&)'), self.show_world_object)

        actionClearWorld = QtGui.QAction(QtGui.QIcon(":/images/resources/plant.png"), "Clear World", self)
        actionClearWorld.triggered.connect(self.clear)
        self._actions = [["Project", "World", actionClearWorld, 0]]

        add_drop_callback(self, 'openalea/interface.IImage', self.drop_object)
Exemplo n.º 24
0
    def __init__(self, node, parent):
        """
        """
        Curve2DEditor.__init__(self, parent)
        NodeWidget.__init__(self, node)

        self.notify(node, ('input_modified', ))

        self.connect(self, QtCore.SIGNAL("valueChanged()"), \
                     self.valueChanged)

        self.window().setWindowTitle(node.get_caption())
Exemplo n.º 25
0
    def __init__(self, parent=None):
        super(ParadigmContainer, self).__init__(parent=parent)

        self.setTabsClosable(True)

        self.applets = []

        self._open_tabs = {}
        self.paradigm = ParadigmCreator()
        self.paradigm.paradigm_clicked.connect(self.new_paradigm)
        self.welcome_actions = self.paradigm.actions()

        self._open_objects = {}

        self.connect(self, QtCore.SIGNAL('tabCloseRequested(int)'),
                     self.auto_close)
        self.connect(self, QtCore.SIGNAL('currentChanged(int)'),
                     self.safe_display_help)

        self.add_default_tab()
        self.fine_tune()
Exemplo n.º 26
0
    def __init__(self, parent, name, panelmanager=None):
        super(LPyPanelWidget, self).__init__(None)
        self.panelmanager = panelmanager
        self.setObjectName(name.replace(' ', '_'))
        self.setName(name)
        self.verticalLayout = QtGui.QVBoxLayout(parent)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName(name + "verticalLayout")

        self.objectpanel = QtGui.QScrollArea(parent)
        self.view = ObjectListDisplay(self, panelmanager)
        self.view.dock = self  # ?

        self.objectpanel.setWidget(self.view)
        self.objectpanel.setWidgetResizable(True)
        self.objectpanel.setObjectName(name + "panelarea")

        self.verticalLayout.addWidget(self.objectpanel)
        self.objectNameEdit = QtGui.QLineEdit(self)
        self.objectNameEdit.setObjectName(name + "NameEdit")
        self.verticalLayout.addWidget(self.objectNameEdit)
        self.objectNameEdit.hide()
        self.setLayout(self.verticalLayout)

        QtCore.QObject.connect(self.view, QtCore.SIGNAL('valueChanged(int)'),
                               self.__updateStatus)
        QtCore.QObject.connect(self.view, QtCore.SIGNAL('AutomaticUpdate()'),
                               self.__transmit_autoupdate)
        QtCore.QObject.connect(self.view,
                               QtCore.SIGNAL('selectionChanged(int)'),
                               self.endNameEditing)
        QtCore.QObject.connect(self.view, QtCore.SIGNAL('renameRequest(int)'),
                               self.displayName)
        QtCore.QObject.connect(self.objectNameEdit,
                               QtCore.SIGNAL('editingFinished()'),
                               self.updateName)
        self.dockNameEdition = False
        self.nameEditorAutoHide = True
        self.setAcceptDrops(True)
Exemplo n.º 27
0
    def __init__(self, parent=None):
        super(HistoryWidget, self).__init__(parent=parent)
        Highlighter(self)
        self.setAccessibleName("HistoryWidget")
        self.setText("")
        self.setLineWrapMode(QtGui.QTextEdit.NoWrap)

        clear_action = QtGui.QAction(
            QtGui.QIcon(":/images/resources/editraise.png"), "Clear History",
            self)
        QtCore.QObject.connect(clear_action, QtCore.SIGNAL('triggered(bool)'),
                               self.clear)
        self._actions = [["Edit", "History", clear_action, 0]]
Exemplo n.º 28
0
    def __init__(self, node, parent):
        """
        @param node
        @param parent
        """

        QtGui.QListWidget.__init__(self, parent)
        NodeWidget.__init__(self, node)
        self.connect(self, QtCore.SIGNAL("currentRowChanged(int)"),
                     self.changed)

        self.mode = None
        self.notify(node, ("input_modified", 0))
        self.notify(node, ("input_modified", 1))
Exemplo n.º 29
0
    def setCompleter(self, completer):
        logger.debug("set completer " + str(completer))
        if self.completer:
            self.disconnect(self.completer, 0, self, 0)
        if not completer:
            return

        completer.setWidget(self)
        completer.setCompletionMode(QtGui.QCompleter.PopupCompletion)
        completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
        self.completer = completer
        QtCore.QObject.connect(self.completer,
                               QtCore.SIGNAL("activated(const QString&)"),
                               self.insertCompletion)
Exemplo n.º 30
0
    def monitor_file(self, filename):
        """ Enable file monitoring """
        try:
            # TODO : Try to remove qt dependencie here
            from openalea.vpltk.qt import QtCore

            self.watch = QtCore.QFileSystemWatcher()
            QtCore.QCoreApplication.instance().connect(
                self.watch, QtCore.SIGNAL("fileChanged(const QString&)"),
                self.changed)

            self.watch.addPath(filename)

        except:
            print "File monitoring is not available"