Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
straks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
straks
straks
Commits
efa35254
Unverified
Commit
efa35254
authored
Feb 25, 2018
by
squbs
Committed by
GitHub
Feb 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25 from SharkWipf/master
Add "Copy address" to the context menu on the "Receive" tab.
parents
f58c99cd
ec1d7fdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
receivecoinsdialog.cpp
src/qt/receivecoinsdialog.cpp
+16
-0
receivecoinsdialog.h
src/qt/receivecoinsdialog.h
+1
-0
No files found.
src/qt/receivecoinsdialog.cpp
View file @
efa35254
...
...
@@ -44,6 +44,7 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
}
// context menu actions
QAction
*
copyAddressAction
=
new
QAction
(
tr
(
"Copy address"
),
this
);
QAction
*
copyURIAction
=
new
QAction
(
tr
(
"Copy URI"
),
this
);
QAction
*
copyLabelAction
=
new
QAction
(
tr
(
"Copy label"
),
this
);
QAction
*
copyMessageAction
=
new
QAction
(
tr
(
"Copy message"
),
this
);
...
...
@@ -51,6 +52,7 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
// context menu
contextMenu
=
new
QMenu
(
this
);
contextMenu
->
addAction
(
copyAddressAction
);
contextMenu
->
addAction
(
copyURIAction
);
contextMenu
->
addAction
(
copyLabelAction
);
contextMenu
->
addAction
(
copyMessageAction
);
...
...
@@ -58,6 +60,7 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
// context menu signals
connect
(
ui
->
recentRequestsView
,
SIGNAL
(
customContextMenuRequested
(
QPoint
)),
this
,
SLOT
(
showMenu
(
QPoint
)));
connect
(
copyAddressAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
copyAddress
()));
connect
(
copyURIAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
copyURI
()));
connect
(
copyLabelAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
copyLabel
()));
connect
(
copyMessageAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
copyMessage
()));
...
...
@@ -263,6 +266,19 @@ void ReceiveCoinsDialog::showMenu(const QPoint &point)
contextMenu
->
exec
(
QCursor
::
pos
());
}
// context menu action: copy address
void
ReceiveCoinsDialog
::
copyAddress
()
{
QModelIndex
sel
=
selectedRow
();
if
(
!
sel
.
isValid
())
{
return
;
}
const
RecentRequestsTableModel
*
const
submodel
=
model
->
getRecentRequestsTableModel
();
const
QString
address
=
submodel
->
entry
(
sel
.
row
()).
recipient
.
address
;
GUIUtil
::
setClipboard
(
address
);
}
// context menu action: copy URI
void
ReceiveCoinsDialog
::
copyURI
()
{
...
...
src/qt/receivecoinsdialog.h
View file @
efa35254
...
...
@@ -72,6 +72,7 @@ private Q_SLOTS:
void
recentRequestsView_selectionChanged
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
);
void
updateDisplayUnit
();
void
showMenu
(
const
QPoint
&
point
);
void
copyAddress
();
void
copyURI
();
void
copyLabel
();
void
copyMessage
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment