新增更新状态按钮及其快捷键,优化用户操作体验
This commit is contained in:
@ -36,7 +36,8 @@ ButtonState = {
|
||||
"pushButton_save": False,
|
||||
"pushButton_prev_move": False,
|
||||
"pushButton_pause": False,
|
||||
"pushButton_next_move": False
|
||||
"pushButton_next_move": False,
|
||||
"pushButton_update_state": False
|
||||
},
|
||||
"Current": {
|
||||
"pushButton_input_setting": True,
|
||||
@ -44,7 +45,8 @@ ButtonState = {
|
||||
"pushButton_save": False,
|
||||
"pushButton_prev_move": False,
|
||||
"pushButton_pause": False,
|
||||
"pushButton_next_move": False
|
||||
"pushButton_next_move": False,
|
||||
"pushButton_update_state": False
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,6 +259,9 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.point_peak_corrected = None
|
||||
self.annotation_tableWidget = None
|
||||
|
||||
self.move_state = None
|
||||
self.last_move_state = None
|
||||
|
||||
self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }")
|
||||
PublicFunc.__styleAllButton__(self, ButtonState)
|
||||
|
||||
@ -332,6 +337,7 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.ui.pushButton_prev_move.clicked.connect(self.__slot_btn_move__)
|
||||
self.ui.pushButton_pause.clicked.connect(self.__slot_btn_move__)
|
||||
self.ui.pushButton_next_move.clicked.connect(self.__slot_btn_move__)
|
||||
self.ui.pushButton_update_state.clicked.connect(self.__update_state__)
|
||||
self.ui.radioButton_move_preset_1.toggled.connect(self.__change_autoplay_args__)
|
||||
self.ui.radioButton_move_preset_2.toggled.connect(self.__change_autoplay_args__)
|
||||
self.ui.radioButton_move_preset_3.toggled.connect(self.__change_autoplay_args__)
|
||||
@ -354,6 +360,12 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.ui.pushButton_pause.setShortcut(
|
||||
QCoreApplication.translate("MainWindow", Params.LABEL_CHECK_BTN_PAUSE_SHORTCUT_KEY)
|
||||
)
|
||||
self.ui.pushButton_update_state.setShortcut(
|
||||
QCoreApplication.translate("MainWindow", Params.LABEL_CHECK_BTN_UPDATE_STATE_SHORTCUT_KEY)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@overrides
|
||||
def closeEvent(self, event):
|
||||
@ -584,6 +596,8 @@ class MainWindow_label_check(QMainWindow):
|
||||
ButtonState["Current"]["pushButton_prev_move"] = True
|
||||
ButtonState["Current"]["pushButton_next_move"] = True
|
||||
ButtonState["Current"]["pushButton_pause"] = True
|
||||
ButtonState["Current"]["pushButton_update_state"] = True
|
||||
|
||||
PublicFunc.finish_operation(self, ButtonState)
|
||||
|
||||
def __slot_btn_save__(self):
|
||||
@ -603,6 +617,20 @@ class MainWindow_label_check(QMainWindow):
|
||||
PublicFunc.msgbox_output(self, result.info, Constants.TIPS_TYPE_INFO)
|
||||
PublicFunc.finish_operation(self, ButtonState)
|
||||
|
||||
def __update_state__(self):
|
||||
if self.move_state == "moving":
|
||||
self.ui.pushButton_pause.click()
|
||||
self.move_state = "pause"
|
||||
else:
|
||||
if self.last_move_state == "prev":
|
||||
self.ui.pushButton_prev_move.click()
|
||||
elif self.last_move_state == "next":
|
||||
self.ui.pushButton_next_move.click()
|
||||
else:
|
||||
self.ui.pushButton_next_move.click()
|
||||
self.move_state = "moving"
|
||||
|
||||
|
||||
def __slot_btn_move__(self):
|
||||
if self.data is None:
|
||||
return
|
||||
@ -610,6 +638,8 @@ class MainWindow_label_check(QMainWindow):
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.pushButton_prev_move:
|
||||
self.last_move_state = "prev"
|
||||
self.move_state = "moving"
|
||||
Config["AutoplayArgs"]["AutoplayMode"] = "prev"
|
||||
self.autoplay_xlim_start = int(self.ax0.get_xlim()[1] - Config["AutoplayArgs"]["MaxRange"])
|
||||
self.autoplay_xlim_end = int(self.ax0.get_xlim()[1])
|
||||
@ -621,6 +651,8 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.timer_autoplay.start(Config["AutoplayArgs"]["MoveSpeed"])
|
||||
PublicFunc.text_output(self.ui, Constants.LABEL_CHECK_PREV_MOVE, Constants.TIPS_TYPE_INFO)
|
||||
elif sender == self.ui.pushButton_next_move:
|
||||
self.last_move_state = "next"
|
||||
self.move_state = "moving"
|
||||
Config["AutoplayArgs"]["AutoplayMode"] = "next"
|
||||
self.autoplay_xlim_start = int(self.ax0.get_xlim()[0])
|
||||
self.autoplay_xlim_end = int(self.ax0.get_xlim()[0] + Config["AutoplayArgs"]["MaxRange"])
|
||||
|
||||
Reference in New Issue
Block a user