-
Notifications
You must be signed in to change notification settings - Fork 38.7k
gui: Paste button in Open URI dialog #17955
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
Conversation
src/qt/forms/openuridialog.ui
Outdated
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.
Why this shortcut instead of traditional Ctrl+V?
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.
To make it coherent with the other paste buttons
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.
Is it worth to present the shortcut to a user somehow? In placeholderText?
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.
Honestly I don't see value in the shortcut, I'd remove it from the others and make sure the line edit has focus.
01602e4 to
cd5afee
Compare
|
Linter should be happy now |
kristapsk
left a comment
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.
ACK cd5afeeaa9c90cc024eedf470a6055491e2b4b23
hebasto
left a comment
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.
Concept NACK as Ctrl+V for "paste" works fine in this dialog already.
src/qt/openuridialog.cpp
Outdated
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.
The on_pasteButton_clicked() slot with automatic connection seems simpler and more explicit.
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.
What's wrong with this? The lambda functions brings it on the point
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.
What's wrong with this?
I did not say "wrong" ;)
Yes, it works.
The lambda functions brings it on the point
Capturing [=] seems an unnecessary overhead. Traditional on_pasteButton_clicked() slot seems more expected for a such simple functionality.
You only need to define this slot. Qt makes a proper connection to &QPushButton::clicked signal automagically.
Refs:
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 kind of dislike automatic connections since it's easy to break them - for instance renaming the item.
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 kind of dislike automatic connections since it's easy to break them - for instance renaming the item.
Make sense. Maybe just a standard connection to a named slot? (01602e453a7a731fa4a6f409cae2ffa2e31709c6 was good except old syntax).
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.
Agree with @hebasto
connect(ui->pasteButton, &QPushButton::clicked, ui->uriEdit, &QLineEdit::paste);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.
@emilengler I guess @promag's approach seems simpler... interested to implement it that way?
I know this but why do we have already many paste buttons in bitcoin-qt then. |
This dialog has the only input field and it is already focused when dialog is opened. That is not the case for other dialogs you mentioned. |
|
Yeah. Why not. Concept ACK. |
|
Concept ACK |
promag
left a comment
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.
Concept ACK adding the button, more user friendly for mouse/touch. For users that use keyboard there's already the native paste shortcut.
src/qt/forms/openuridialog.ui
Outdated
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.
Honestly I don't see value in the shortcut, I'd remove it from the others and make sure the line edit has focus.
src/qt/openuridialog.cpp
Outdated
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 kind of dislike automatic connections since it's easy to break them - for instance renaming the item.
src/qt/openuridialog.h
Outdated
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.
Just forward declare PlatformStyle.
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.
Honestly I don't see value in the shortcut, I'd remove it from the others and make sure the line edit has focus.
The line has focus. I copied the shortcut from the other occurrences of this button
I kind of dislike automatic connections since it's easy to break them - for instance renaming the item.
Renaming them would cause an error
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.
What error? The doc at https://doc.qt.io/qt-5/qmetaobject.html#connectSlotsByName doesn't mention it.
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.
Nevermind, I only changed the occurrence in the .cpp file and not the qt file
cd5afee to
fa5887c
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
Github-Pull: bitcoin#17955 Rebased-From: fa5887c
|
Needs rebase. Otherwise ready for merge. |
fa5887c to
0139b42
Compare
|
Rebased |
|
@emilengler: once #17955 (comment) is addressed, this should be ready for merge. |
|
Given there has been no follow up for the last month (in regards to the different implementation), and this is purely a qt-only change, I'm going to close this, and suggest you reopen the new version in the https://github.com/bitcoin-core/gui repo. |
|
@emilengler You don't plant to re-open this in the https://github.com/bitcoin-core/gui ? |
No, I currently lack time and motivation for this but feel free to pick it up :^) |
dbde055 gui: Paste button in Open URI dialog (Kristaps Kaupe) Pull request description: Picking up bitcoin/bitcoin#17955, with some review comments addressed. ACKs for top commit: shaavan: tACK dbde055 jarolrod: ACK dbde055 promag: Tested ACK dbde055. Tree-SHA512: db47f19673aff6becd6d1f938cd2aa5dc2291d6e80150d2b99f435674330a5eae678b20e42ef327ea9b05c44925a941fc251e622c73b3585018fc7c1d245edb5
This adds a button to paste a URI from the clipboard. Other forms also have this and it would be useful to have this here as well.
