diff --git a/sohstationviewer/view/db_config/channel_dialog.py b/sohstationviewer/view/db_config/channel_dialog.py index 6a4f77344e57201dde3785c995a091ddd012d185..7a844fa7cceb386c19172aa291c5fa4da1f5ae3c 100755 --- a/sohstationviewer/view/db_config/channel_dialog.py +++ b/sohstationviewer/view/db_config/channel_dialog.py @@ -168,7 +168,7 @@ class ChannelDialog(UiDBInfoDialog): str(row_content[3])) self.data_table_widget.cellWidget(row_idx, 5).setText(row_content[4]) self.data_table_widget.cellWidget(row_idx, 6).setValue(row_content[5]) - self.data_table_widget.cellWidget(row_idx, 7).setChecked(row_content[6]) + self.data_table_widget.cellWidget(row_idx, 7).set_checked(row_content[6]) def set_row_widgets(self, row_idx, fk=False): """ diff --git a/sohstationviewer/view/db_config/db_config_dialog.py b/sohstationviewer/view/db_config/db_config_dialog.py index 22ebf089865448252127999ed7ee4072f444a36e..32aedbdc72bd7656304b698a44a350ce870769a6 100755 --- a/sohstationviewer/view/db_config/db_config_dialog.py +++ b/sohstationviewer/view/db_config/db_config_dialog.py @@ -635,6 +635,10 @@ class UiDBInfoDialog(OneWindowAtATimeDialog): # Primary key is always the first item in a row backup_rows = [r for r in self.backup_database_rows if r[0] == curr_row[0]] + if self.need_data_type_choice: + # data type is one of primary keys + backup_rows = [r for r in backup_rows + if r[-1] == curr_row[-1]] if backup_rows: # reset function available when there's backup row backup_row = backup_rows[0]