feat: 1.1版本更新 - 优化UI界面和激活流程
This commit is contained in:
@@ -365,13 +365,44 @@ class MainWindow(QMainWindow):
|
||||
QMessageBox.warning(self, "提示", "请输入激活码")
|
||||
return
|
||||
|
||||
# TODO: 实现激活逻辑
|
||||
logging.info(f"正在处理激活请求,激活码: {activation_code}")
|
||||
QMessageBox.information(self, "提示", "激活功能即将实现")
|
||||
# 禁用激活按钮,防止重复点击
|
||||
self.activate_input.setEnabled(False)
|
||||
self.update_button.setEnabled(False)
|
||||
|
||||
# 显示处理中的提示
|
||||
QApplication.processEvents()
|
||||
|
||||
# 调用激活接口
|
||||
success, message, account_info = self.updater.check_activation_code(activation_code)
|
||||
|
||||
if success:
|
||||
# 更新界面显示
|
||||
self.member_info.clear()
|
||||
self.member_info.append(f"会员状态: 已激活")
|
||||
self.member_info.append(f"到期时间: {account_info['expire_time']}")
|
||||
self.member_info.append(f"剩余天数: {account_info['days_left']}天")
|
||||
|
||||
# 显示成功消息
|
||||
QMessageBox.information(self, "激活成功",
|
||||
f"设备已成功激活!\n"
|
||||
f"到期时间: {account_info['expire_time']}\n"
|
||||
f"剩余天数: {account_info['days_left']}天")
|
||||
|
||||
# 清空激活码输入框
|
||||
self.activate_input.clear()
|
||||
|
||||
logging.info(f"设备激活成功,到期时间: {account_info['expire_time']}")
|
||||
else:
|
||||
QMessageBox.warning(self, "激活失败", message)
|
||||
logging.error(f"激活失败: {message}")
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"激活过程中发生错误: {str(e)}")
|
||||
QMessageBox.warning(self, "错误", f"激活失败: {str(e)}")
|
||||
QMessageBox.critical(self, "错误", f"激活过程发生错误: {str(e)}")
|
||||
finally:
|
||||
# 恢复按钮状态
|
||||
self.activate_input.setEnabled(True)
|
||||
self.update_button.setEnabled(True)
|
||||
|
||||
def disable_cursor_update(self):
|
||||
"""禁用Cursor版本更新"""
|
||||
|
||||
Reference in New Issue
Block a user