Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media opening (slight reorder & tidy of #1058) #1223

Merged

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented May 16, 2022

What does this PR do?

This is a slight tidy and re-ordering of #1058, which itself has quite a lot of history via earlier PRs. I've left #1058 as it is right now, other than the changes I made semi-recently to make it cleanly mergeable via a rebase onto then-main. When this is merged then that and a few other PRs can be closed too.

This functions fairly well right now and fulfills a feature, though I can foresee quite a few updates following this, which I'll push out to another issue. For now I'm keen to get this merged.

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

Notes & Questions

I'd like to merge this very soon, but feedback is welcome, as it was on #1058 - the functionality should not have changed from that.

Ezio-Sarthak and others added 5 commits May 15, 2022 17:25
The return codes for GUI commands, are interpreted as 1 for WSL and 0
for others. This commit wraps the expected return codes into a helper in
`platform_code` - `successful_GUI_return_code()`.

Tests added.
There is a difference in path types for Windows and Unix systems.
Windows uses backward slashes, whereas other systems use forward
slashes. Since a media link in WSL will need an absolute path, such
normalization is required.  This commit place the logic to normalize a
file path in a helper in `platform_code`.

Tests added.
Tests added and amendments made by Preet Mishra to make it usable for
MessageLinkButton and PopUpConfirmationView later.

Tests and code further amended by Sarthak Garg to support using report_*
methods for UI calls, and refactoring *_media() methods.

Co-authored-by: Preet Mishra <ipreetmishra@gmail.com>
Co-authored-by: Sarthak Garg <grgsrthk.dev20@gmail.com>
This commit adds a method `process_media` to handle media links, i.e.,
it Downloads and Shows the media in the default OS-specific explorer.

Tests added and amended.
Amendment made by Sarthak Garg to use new `report_*` methods for
footer notifications. These are to show download status in footer.

Co-authored by: Sarthak Garg <grgsrthk.dev20@gmail.com>
@neiljp neiljp added the PR soon to be merged PR has been reviewed & is ready to be merged label May 16, 2022
@neiljp neiljp added this to the Next Release milestone May 16, 2022
@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label May 16, 2022
The parameter is useful for prompts that have long descriptions.
Use 'center' location for show_media_confirmation_popup() for better
visibility of the popup message.

Test amended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR soon to be merged PR has been reviewed & is ready to be merged size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants