-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Copy to Clipboard for VersionInfo dialog #3318
base: dev
Are you sure you want to change the base?
Conversation
For this window I would prefer if selection and copying was functioning normally. No need to add a separate button, otherwise you could end up adding a copy button in every possible UI screen which will be cluttered a mess. In my opinion there are few rare exceptions where dedicated copy button is acceptable and even preferred, but this is not one of them. Allowing multiline selection should be trivial. Not sure about copying part, but that should also be solvable. |
the issue itself had a |
I get your point @karliss. This issue was a request for a |
First of all feature request by random user shouldn't be taken as truth for what the best solution to their problem is, considering rest of program is. And even if you consider what that issue author said for me it doesn't seem obvious that custom "copy all" button is what he asked.
The way I interpret it "less fancy rendering" means non broken selection/multiline copy which functions just like you would expect multiline selection to work. The about window he mentioned as preferred solution doesn't even have "copy-all". It simply has regular label with selectable text. And all the context menu actions like "Select all" and "Copy" are the default actions available to any text field with same configuration. Also rest of the issue describes the problem as having selection behavior lacking ability to select multiple lines and copying them.
I have no idea where did you both saw that it requested "Copy all" button. |
Note enabling multiline selection isn't any complicated than what's already written in this PR. It's a matter of setting appropriate QTReeWidget::selectionMode, you can even do it in the UI file. As for copying you can do something like this:
That way there is no need for additional header inserted in copied text to distinguish between left and right side, code for left and right side gets reused, no need for additional button panel. No need for additional popup confirming that copying succeeded since Ctrl+C (or equivalent platform specific shortcut) working everywhere is the expected normal behavior. |
That is true, my bad. @r3yc0n1c please follow the directives that @karliss has proposed, it will vastly improve the feature! |
Got it... I'll update this ASAP! |
hi, I've been experimenting with different approaches for this implementation. Here's the recent update: dev...r3yc0n1c:cutter:exp-copy-feat-versioninfo I'm facing - only 1st item is selected/sometimes 'QAction::event: Ambiguous shortcut overload: Ctrl+C' error... could you please review this? |
A couple of potential issues all from the fact that you are creating a new action each time a context menu is opened:
The actions should be created during initialization of window. That way the keyboard shortcuts can work before context menu is opened. Afterwards if necessary you can add the existing action to a context menu if necessary. Although in this case you could set the contextMenuPolicy to In general (but not this specific situation) you can create the actions for context menu in the contextMenuEvent callback, and a lot of places in Cutter do that, but there are a few things you need to take into. If you create the actions for context menu in the callback, they should be associated with the temporary menu object instead of the dialog. That way they will be destroyed together with temporary menu, instead of accumulating each time you open the context menu. |
7c209ad
to
84fac11
Compare
7fb3965
to
fb44d0c
Compare
fb44d0c
to
d8fc874
Compare
@r3yc0n1c In case you missed it, the comment for column constants is still opened. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it on Windows, and it works. But once I close the Version window and open it again, the selection is still active. I think it should be dropped/reset upon window closure, so once you open it again, nothing is selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more new objections from me. Would be good to fix the thing XVilka said before merging.
.gitmodules
Outdated
@@ -3,4 +3,4 @@ | |||
url = https://github.com/rizinorg/rizin | |||
[submodule "src/translations"] | |||
path = src/translations | |||
url = https://github.com/rizinorg/cutter-translations | |||
url = https://github.com/rizinorg/cutter-translations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this considered resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot test right now, but from the code perspective I don't have any objections.
625784f
to
4448ce1
Compare
4448ce1
to
1085a91
Compare
.gitmodules
Outdated
@@ -3,4 +3,4 @@ | |||
url = https://github.com/rizinorg/rizin | |||
[submodule "src/translations"] | |||
path = src/translations | |||
url = https://github.com/rizinorg/cutter-translations | |||
url = https://github.com/rizinorg/cutter-translations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this considered resolved?
Your checklist for this pull request
Detailed description
Adds a Copy, Close button in the VersionInfo Dialog to copy the formatted info to Clipboard.
Also adds translations support.
Test plan (required)
Closing issues
Closes #3103
Screenshots