Skip to content

Conversation

@cvengler
Copy link
Contributor

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.
grafik

@fanquake fanquake added the GUI label Jan 18, 2020
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor

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.

@cvengler cvengler force-pushed the 2020-01-paste-bitcoin-uri-button branch from 01602e4 to cd5afee Compare January 18, 2020 13:07
@cvengler
Copy link
Contributor Author

Linter should be happy now

Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

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

ACK cd5afeeaa9c90cc024eedf470a6055491e2b4b23

Copy link
Member

@hebasto hebasto left a 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.

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

@hebasto hebasto Jan 19, 2020

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:

Copy link
Contributor

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.

Copy link
Member

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).

Copy link
Contributor

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);

Copy link
Contributor

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?

@cvengler
Copy link
Contributor Author

Concept NACK as Ctrl+V for "paste" works fine in this dialog already.

I know this but why do we have already many paste buttons in bitcoin-qt then.

@hebasto
Copy link
Member

hebasto commented Jan 19, 2020

Concept NACK as Ctrl+V for "paste" works fine in this dialog already.

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.

@jonasschnelli
Copy link
Contributor

Yeah. Why not.
We also have the paste button in the address field in the send coins dialog. Since people paste here (the URI field) some sort of a payment-request, it makes the paste-button-approach more consistent.

Concept ACK.

@laanwj
Copy link
Member

laanwj commented Jan 20, 2020

Concept ACK

Copy link
Contributor

@promag promag left a 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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just forward declare PlatformStyle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@promag

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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

@cvengler cvengler force-pushed the 2020-01-paste-bitcoin-uri-button branch from cd5afee to fa5887c Compare January 21, 2020 13:44
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 24, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Feb 9, 2020
@jonasschnelli
Copy link
Contributor

Needs rebase. Otherwise ready for merge.

@cvengler cvengler force-pushed the 2020-01-paste-bitcoin-uri-button branch from fa5887c to 0139b42 Compare May 29, 2020 09:07
@cvengler
Copy link
Contributor Author

Rebased

@jonasschnelli
Copy link
Contributor

@emilengler: once #17955 (comment) is addressed, this should be ready for merge.

@fanquake
Copy link
Member

fanquake commented Jul 9, 2020

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.

@fanquake fanquake closed this Jul 9, 2020
@kristapsk
Copy link
Contributor

@emilengler You don't plant to re-open this in the https://github.com/bitcoin-core/gui ?

@cvengler
Copy link
Contributor Author

cvengler commented May 4, 2021

@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 :^)

hebasto added a commit to bitcoin-core/gui that referenced this pull request Nov 21, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants