Skip to content

fix: disable open-file menu action on success/failure pages - #490

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/pms-bug-bot/078c9722d02b
Sep 18, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/pms-bug-bot/078c9722d02b

Conversation

@LiHua000

@LiHua000 LiHua000 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

In refreshPage(), the PI_Success and PI_Failure branches only called setTitleButtonStyle(false, false) to hide custom title bar buttons but did not disable the m_pOpenAction menu action. This left the 'Open file' menu item clickable on the compression success/failure pages, and since slotChoosefiles() has no PI_Success/PI_Failure branch, the selected files were silently discarded.

Add m_pOpenAction->setEnabled(false) to both branches, consistent with the PI_UnCompress branch (line 329) which already manages m_pOpenAction state.

Fixes: PMS-248123

Summary by Sourcery

Prevent file selection from being available on compression result pages and restore the action when returning to an active workflow.

Bug Fixes:

  • Disable the Open file action on compression success and failure pages to prevent unsupported file selection.
  • Ignore file-selection requests on success and failure pages instead of silently discarding selected files.
  • Restore the Open file action when resetting the main window.

Enhancements:

  • Keep the Open file action state consistent with the current uncompression page permissions.

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates refreshPage() so the Open file action is disabled on both success and failure pages, preventing users from invoking an unsupported file-selection flow whose selections would otherwise be discarded.

Flow diagram for disabling Open file on terminal pages

flowchart TD
    Refresh["refreshPage()"] --> Page{Current page}
    Page -->|PI_Success| Success["Show success page"]
    Page -->|PI_Failure| Failure["Show failure page"]
    Success --> DisableSuccess["m_pOpenAction.setEnabled(false)"]
    Failure --> DisableFailure["m_pOpenAction.setEnabled(false)"]
Loading

File-Level Changes

Change Details Files
Disable the Open file menu action on compression success and failure pages.
  • Disable m_pOpenAction in the PI_Success refresh branch.
  • Disable m_pOpenAction in the PI_Failure refresh branch.
  • Keep action state consistent with the existing PI_UnCompress behavior.
src/source/mainwindow.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

In refreshPage(), the PI_Success and PI_Failure branches only called
setTitleButtonStyle(false, false) to hide custom title bar buttons but
did not disable the m_pOpenAction menu action. This left the 'Open file'
menu item clickable on the compression success/failure pages, and since
slotChoosefiles() has no PI_Success/PI_Failure branch, the selected files
were silently discarded.

Add m_pOpenAction->setEnabled(false) to both branches, consistent with
the PI_UnCompress branch which already manages m_pOpenAction state.

Since m_pOpenAction is shared state, also restore it when leaving these
pages: resetMainwindow() re-enables it (covers returning to home), the
PI_UnCompress branch re-enables it from bModifiable in non-external
permission mode (covers failure retry), and slotChoosefiles() now returns
early on success/failure as a defensive guard.

Fixes: PMS-248123
@LiHua000
LiHua000 force-pushed the agent/pms-bug-bot/078c9722d02b branch from f9e5665 to 0133b9e Compare September 18, 2026 08:32
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiHua000, max-lvs

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

@LiHua000

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit c96bf45 into linuxdeepin:release/eagle Sep 18, 2026
14 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