为SA打标界面添加自动保存选项并重构按钮布局

This commit is contained in:
marques
2025-08-28 20:41:10 +08:00
parent 6395529d3d
commit da05fcfb2d
3 changed files with 51 additions and 31 deletions

View File

@ -1193,7 +1193,7 @@ class MainWindow_SA_label(QMainWindow):
mask = (self.data.df_revised["Index"] > origin_max_index) & (self.data.df_revised["score"] == 3)
self.data.df_revised = self.data.df_revised[~mask].reset_index(drop=True)
self.data.df_revised.to_csv(self.config["Path"]["SA_Label_Revised"], index=False)
self.data.df_revised.to_csv(self.config["Path"]["SA_Label_Revised"], index=False, encoding="gbk")
except Exception as e:
return Result().failure(info=Constants.SAVE_FAILURE +
Constants.FAILURE_REASON["Save_revised_csv_Exception"] + "\n" + format_exc())
@ -1335,6 +1335,9 @@ class MainWindow_SA_label(QMainWindow):
else:
self.edit_event(index)
if self.ui.checkBox_auto_save.isChecked():
self.__save_revise_df__()
def __update_label_from_ui__(self, event_info, is_new=False):
# Update the event type
if self.ui.radioButton_OSA.isChecked():