def __init__(self, source_model, parent=None): QtGui.QDialog.__init__(self, parent=parent) self.df_model = source_model self.setupUi(self) self.configure_model() cols = source_model.dataFrame().columns.tolist() self.handler_split_on = PushGridHandler(left_button=self.btnSplitOnPushLeft, left_view=self.listViewSplitOnLeft, right_button=self.btnSplitOnPushRight, right_view=self.listViewSplitOnRight, left_model=cols) self.handler_use_cols = PushGridHandler(left_button=self.btnUseColsPushLeft, left_view=self.listViewUseColsLeft, right_button=self.btnUseColsPushRight, right_view=self.listViewUseColsRight, left_model=cols) self.configure()
def set_handler_dedupe_on(self, column_model=None, default_model=None): if column_model is None: column_model = self.get_source_columns_model() self.dedupeOnHandler = PushGridHandler( left_model=column_model, left_view=self.dedupeOnLeftView, left_button=self.dedupeOnLeftButton, left_delete=True, right_model=default_model, right_view=self.dedupeOnRightView, right_button=self.dedupeOnRightButton)
def set_handler_unique_fields(self, column_model=None, default_model=None): if column_model is None: column_model = self.get_source_columns_model() self.uniqueFieldsHandler = PushGridHandler( left_model=column_model, left_view=self.uniqueFieldsListViewLeft, left_button=self.uniqueFieldsPushButtonLeft, left_delete=True, right_model=default_model, right_view=self.uniqueFieldsListViewRight, right_button=self.uniqueFieldsPushButtonRight)
def set_handler_sort_asc(self, default_model=None, overwrite=False): if self.sortAscHandler is None or default_model is not None or overwrite: sort_asc = QtGui.QStandardItemModel() sort_asc.appendRow(QtGui.QStandardItem('True')) sort_asc.appendRow(QtGui.QStandardItem('False')) self.sortAscHandler = PushGridHandler( left_model=sort_asc, left_view=self.sortAscLeftView, left_button=self.sortAscLeftButton, left_delete=False, right_model=default_model, right_view=self.sortAscRightView, right_button=self.sortAscRightButton)