Skip to content

fix: Update save button tooltip and add new save options#755

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:commit_20251117
Nov 17, 2025
Merged

fix: Update save button tooltip and add new save options#755
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:commit_20251117

Conversation

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member
  • Enhanced the tooltip for the save button to reflect new save options: "Save to Desktop" and "Save to Pictures".
  • Updated the save button functionality to dynamically change the tooltip based on user settings.
  • Added translations for the new save options in multiple languages, improving accessibility for international users.

This update enriches the user experience by providing clearer save options and enhancing the overall functionality of the save button.

bug: https://pms.uniontech.com/bug-view-337125.html

https://pms.uniontech.com/bug-view-339555.html

- Enhanced the tooltip for the save button to reflect new save options: "Save to Desktop" and "Save to Pictures".
- Updated the save button functionality to dynamically change the tooltip based on user settings.
- Added translations for the new save options in multiple languages, improving accessibility for international users.

This update enriches the user experience by providing clearer save options and enhancing the overall functionality of the save button.

bug: https://pms.uniontech.com/bug-view-337125.html

https://pms.uniontech.com/bug-view-339555.html
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这段代码变更进行审查:

  1. 代码逻辑改进:
  • 在main_window.cpp中,将AI助手快捷键的触发条件从单一截图模式扩展为支持滚动截图模式,这是一个合理的功能扩展。
  • 在subtoolwidget.cpp中,移除了事件过滤器中处理tooltip的代码,改用信号槽机制来更新tooltip,这是一个更好的设计模式,减少了事件过滤器的复杂性。
  1. 代码质量提升:
  • 添加了更多的日志输出(qCWarning)来帮助调试,特别是在updateSaveButtonTip()函数中。
  • 使用switch语句替代了if-else链,使代码结构更清晰。
  • 添加了空指针检查(m_saveLocalDirButton)提高了代码的健壮性。
  1. 性能优化:
  • 使用信号槽机制替代事件过滤器来处理tooltip更新,减少了事件过滤器的开销。
  • tooltip的更新逻辑更集中,避免了重复代码。
  1. 安全性改进:
  • 添加了路径存在性检查(QFileInfo::exists)来确保保存路径的有效性。
  • 对用户输入的保存路径进行了验证。
  1. 建议改进:
  • 在updateSaveButtonTip()函数中的日志输出可能过于详细,建议在生产环境中减少日志输出。
  • 可以考虑将tooltip文本的生成逻辑提取到一个单独的工具类中,提高代码的可维护性。
  • 建议为新增的翻译字符串添加注释,说明其用途和上下文。
  1. 国际化支持:
  • 添加了新的翻译字符串"Save to Desktop"和"Save to Pictures"到所有语言文件中,确保了多语言支持。

总的来说,这次代码变更在功能、性能和可维护性方面都有所提升,是一个良好的重构。主要改进了tooltip的处理机制,使其更加集中和可维护,同时扩展了AI助手的功能范围。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot deepin-bot Bot merged commit 74de9a6 into linuxdeepin:develop/snipe Nov 17, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants