iptux-src / iptux

A software for sharing in LAN
GNU General Public License v2.0
432 stars 128 forks source link

#604: cop/save image not work under Linux #607

Closed lidaobing closed 2 weeks ago

lidaobing commented 2 weeks ago

Summary by Sourcery

This pull request addresses the issue with the 'Save Image' functionality not working under Linux by properly managing the image popup menu. Additionally, it refactors the image context menu creation to be initialized once after the window is created, enhancing code maintainability.

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request refactors the image context menu handling in the DialogBase class to fix the issue of saving images not working under Linux. The changes include introducing a new method, afterWindowCreated, to initialize the image context menu and updating the OnImageButtonPress, OnSaveImage, and OnCopyImage methods to use class members for the menu and active image. Additionally, the afterWindowCreated method is called in the CreateMainWindow methods of DialogGroup and DialogPeer to ensure proper initialization.

File-Level Changes

Files Changes
src/iptux/DialogBase.cpp
src/iptux/DialogBase.h
Refactored image context menu handling by introducing afterWindowCreated method and using class members for menu and active image.
src/iptux/DialogGroup.cpp
src/iptux/DialogPeer.cpp
Ensured afterWindowCreated is called after main window creation to initialize image context menu.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes missing coverage. Please review.

Project coverage is 51.47%. Comparing base (0b47207) to head (f780bc2).

Files Patch % Lines
src/iptux/DialogBase.cpp 47.61% 11 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #607 +/- ## ========================================== + Coverage 51.37% 51.47% +0.10% ========================================== Files 64 64 Lines 8345 8354 +9 ========================================== + Hits 4287 4300 +13 + Misses 4058 4054 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.