def __init__(self, source, context, parent=None): super(HomeToolDirItemsCopyHelperWidget, self).__init__(source, context, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.new_or_existing = widgets.NewOrExistingWidget() layout.addWidget(self.new_or_existing) invalid_names = [item.name for item in source.get_sources(context)] self.name_widget = widgets.CopyItemNameWidget( invalid_names=invalid_names) layout.addWidget(self.name_widget) self.table = widgets.BasicSourceItemTable(source, context) layout.addWidget(self.table) self.new_or_existing.currentIndexChanged.connect(self._mode_changed) self._mode_changed(0) self.name_widget.valid_source_signal.connect( self.valid_source_signal.emit) self.table.valid_sources_signal.connect(self.valid_source_signal.emit)
def __init__(self, source, context, parent=None): super(HomeToolDirItemsPasteHelperWidget, self).__init__(source, context, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) # We want to be able to multi-select, delete and double click on items. self.table = widgets.BasicSourceItemTable( source, context, selection_mode=QtWidgets.QAbstractItemView.ExtendedSelection, allow_delete=True, allow_double_click=True, ) layout.addWidget(self.table) self.table.perform_operation_signal.connect(self.perform_operation_signal.emit) self.table.valid_sources_signal.connect(self.valid_sources_signal.emit)