Esempio n. 1
0
 def set_filters_and_actions( self, filters_and_actions ):
     """sets filters for the tableview"""
     assert object_thread( self )
     filters, actions = filters_and_actions
     from camelot.view.controls.filterlist import FilterList
     from camelot.view.controls.actionsbox import ActionsBox
     logger.debug( 'setting filters for tableview' )
     filters_widget = self.findChild(FilterList, 'filters')
     actions_widget = self.findChild(ActionsBox, 'actions')
     if filters_widget:
         filters_widget.filters_changed_signal.disconnect( self.rebuild_query )
         self.filters_layout.removeWidget(filters_widget)
         filters_widget.deleteLater()
     if actions_widget:
         self.filters_layout.removeWidget(actions_widget)
         actions_widget.deleteLater()
     if filters:
         splitter = self.findChild( QtGui.QWidget, 'splitter' )
         filters_widget = FilterList( filters, parent=splitter )
         filters_widget.setObjectName('filters')
         self.filters_layout.addWidget( filters_widget )
         filters_widget.filters_changed_signal.connect( self.rebuild_query )
     #
     # filters might have default values, so we can only build the queries now
     #
     self.rebuild_query()
     if actions:
         actions_widget = ActionsBox( parent = self,
                                      gui_context = self.gui_context )
         actions_widget.setObjectName( 'actions' )
         actions_widget.set_actions( actions )
         self.filters_layout.addWidget( actions_widget )
Esempio n. 2
0
 def set_actions(self, actions):
     layout = self.findChild(QtGui.QLayout, "form_and_actions_layout")
     if actions and layout:
         side_panel_layout = QtGui.QVBoxLayout()
         actions_widget = ActionsBox(parent=self, gui_context=self.gui_context)
         actions_widget.setObjectName("actions")
         actions_widget.set_actions(actions)
         side_panel_layout.addWidget(actions_widget)
         side_panel_layout.addStretch()
         layout.addLayout(side_panel_layout)
Esempio n. 3
0
 def set_actions(self, actions):
     form = self.findChild(QtGui.QWidget, 'form' )
     layout = self.findChild(QtGui.QLayout, 'form_and_actions_layout' )
     if actions and form and layout:
         side_panel_layout = QtGui.QVBoxLayout()
         from camelot.view.controls.actionsbox import ActionsBox
         LOGGER.debug('setting Actions for formview')
         actions_widget = ActionsBox( parent = self, 
                                      gui_context = self.gui_context )
         actions_widget.setObjectName('actions')
         actions_widget.set_actions( actions )
         side_panel_layout.addWidget( actions_widget )
         side_panel_layout.addStretch()
         layout.addLayout( side_panel_layout )
Esempio n. 4
0
 def setActions(self, actions):
     form = self.findChild(QtGui.QWidget, 'form')
     layout = self.findChild(QtGui.QLayout, 'form_and_actions_layout')
     if actions and form and layout:
         side_panel_layout = QtGui.QVBoxLayout()
         from camelot.view.controls.actionsbox import ActionsBox
         logger.debug('setting Actions for formview')
         actions_widget = ActionsBox(self, self.getEntity)
         actions_widget.setObjectName('actions')
         action_widgets = actions_widget.setActions(actions)
         for action_widget in action_widgets:
             form.changed_signal.connect(action_widget.changed)
             action_widget.changed()
         side_panel_layout.insertWidget(1, actions_widget)
         side_panel_layout.addStretch()
         layout.addLayout(side_panel_layout)
Esempio n. 5
0
 def setActions(self, actions):
     form = self.findChild(QtGui.QWidget, 'form' )
     layout = self.findChild(QtGui.QLayout, 'form_and_actions_layout' )
     if actions and form and layout:
         side_panel_layout = QtGui.QVBoxLayout()
         from camelot.view.controls.actionsbox import ActionsBox
         logger.debug('setting Actions for formview')
         actions_widget = ActionsBox(self, self.getEntity)
         actions_widget.setObjectName('actions')
         action_widgets = actions_widget.setActions(actions)
         for action_widget in action_widgets:
             form.changed_signal.connect( action_widget.changed )
             action_widget.changed()
         side_panel_layout.insertWidget(1, actions_widget)
         side_panel_layout.addStretch()
         layout.addLayout(side_panel_layout)
Esempio n. 6
0
 def set_filters_and_actions(self, filters_and_actions):
     """sets filters for the tableview"""
     assert object_thread(self)
     filters, actions = filters_and_actions
     from camelot.view.controls.filterlist import FilterList
     from camelot.view.controls.actionsbox import ActionsBox
     logger.debug('setting filters for tableview')
     filters_widget = self.findChild(FilterList, 'filters')
     actions_widget = self.findChild(ActionsBox, 'actions')
     if filters_widget:
         filters_widget.filters_changed_signal.disconnect(
             self.rebuild_query)
         self.filters_layout.removeWidget(filters_widget)
         filters_widget.deleteLater()
     if actions_widget:
         self.filters_layout.removeWidget(actions_widget)
         actions_widget.deleteLater()
     if filters:
         splitter = self.findChild(QtGui.QWidget, 'splitter')
         filters_widget = FilterList(filters, parent=splitter)
         filters_widget.setObjectName('filters')
         self.filters_layout.addWidget(filters_widget)
         filters_widget.filters_changed_signal.connect(self.rebuild_query)
     #
     # filters might have default values, so we can only build the queries now
     #
     self.rebuild_query()
     if actions:
         actions_widget = ActionsBox(parent=self,
                                     gui_context=self.gui_context)
         actions_widget.setObjectName('actions')
         actions_widget.set_actions(actions)
         self.filters_layout.addWidget(actions_widget)
Esempio n. 7
0
    def set_filters_and_actions(self, filters_and_actions):
        """sets filters for the tableview"""
        filters, actions = filters_and_actions
        from camelot.view.controls.filterlist import FilterList
        from camelot.view.controls.actionsbox import ActionsBox

        logger.debug("setting filters for tableview")
        filters_widget = self.findChild(FilterList, "filters")
        actions_widget = self.findChild(ActionsBox, "actions")
        if filters_widget:
            filters_widget.filters_changed_signal.disconnect(self.rebuild_query)
            self.filters_layout.removeWidget(filters_widget)
            filters_widget.deleteLater()
        if actions_widget:
            self.filters_layout.removeWidget(actions_widget)
            actions_widget.deleteLater()
        if filters:
            splitter = self.findChild(QtGui.QWidget, "splitter")
            filters_widget = FilterList(filters, parent=splitter)
            filters_widget.setObjectName("filters")
            self.filters_layout.addWidget(filters_widget)
            filters_widget.filters_changed_signal.connect(self.rebuild_query)
        #
        # filters might have default values, so we can only build the queries now
        #
        self.rebuild_query()
        if actions:
            #
            # Attention, the ActionBox should only contain a reference to the
            # table, and not to the table model, since this will cause the
            # garbage collector to collect them both in random order, causing
            # segfaults (see the test_qt_bindings)
            #
            actions_widget = ActionsBox(self, self.get_collection, self.get_selection)
            actions_widget.setObjectName("actions")
            actions_widget.setActions(actions)
            self.filters_layout.addWidget(actions_widget)
Esempio n. 8
0
 def set_actions(self, actions):
     layout = self.findChild(QtGui.QLayout, 'form_and_actions_layout' )
     if actions and layout:
         side_panel_layout = QtGui.QVBoxLayout()
         actions_widget = ActionsBox( parent = self, 
                                      gui_context = self.gui_context )
         actions_widget.setObjectName('actions')
         actions_widget.set_actions( actions )
         side_panel_layout.addWidget( actions_widget )
         side_panel_layout.addStretch()
         layout.addLayout( side_panel_layout )
Esempio n. 9
0
 def set_actions(self, actions):
     form = self.findChild(QtWidgets.QWidget, 'form' )
     layout = self.findChild(QtGui.QLayout, 'form_and_actions_layout' )
     if actions and form and layout:
         side_panel_layout = QtWidgets.QVBoxLayout()
         from camelot.view.controls.actionsbox import ActionsBox
         LOGGER.debug('setting Actions for formview')
         actions_widget = ActionsBox( parent = self, 
                                      gui_context = self.gui_context )
         actions_widget.setObjectName('actions')
         actions_widget.set_actions( actions )
         side_panel_layout.addWidget( actions_widget )
         side_panel_layout.addStretch()
         layout.addLayout( side_panel_layout )
Esempio n. 10
0
 def set_filters_and_actions(self, filters_and_actions):
     """sets filters for the tableview"""
     filters, actions = filters_and_actions
     from camelot.view.controls.filterlist import FilterList
     from camelot.view.controls.actionsbox import ActionsBox
     logger.debug('setting filters for tableview')
     filters_widget = self.findChild(FilterList, 'filters')
     actions_widget = self.findChild(ActionsBox, 'actions')
     if filters_widget:
         filters_widget.filters_changed_signal.disconnect(
             self.rebuild_query)
         self.filters_layout.removeWidget(filters_widget)
         filters_widget.deleteLater()
     if actions_widget:
         self.filters_layout.removeWidget(actions_widget)
         actions_widget.deleteLater()
     if filters:
         splitter = self.findChild(QtGui.QWidget, 'splitter')
         filters_widget = FilterList(filters, parent=splitter)
         filters_widget.setObjectName('filters')
         self.filters_layout.addWidget(filters_widget)
         filters_widget.filters_changed_signal.connect(self.rebuild_query)
     #
     # filters might have default values, so we can only build the queries now
     #
     self.rebuild_query()
     if actions:
         #
         # Attention, the ActionBox should only contain a reference to the
         # table, and not to the table model, since this will cause the
         # garbage collector to collect them both in random order, causing
         # segfaults (see the test_qt_bindings)
         #
         actions_widget = ActionsBox(self, self.get_collection,
                                     self.get_selection)
         actions_widget.setObjectName('actions')
         actions_widget.setActions(actions)
         self.filters_layout.addWidget(actions_widget)