diff options
| author | Jonas Schnelli <[email protected]> | 2020-05-29 10:28:47 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2020-05-29 10:29:14 +0200 |
| commit | 0d5c18204b73ccb0d7c07f90c52de31edc25e28e (patch) | |
| tree | 1b7f279d2caaef9c6d804d99d5a93f6e2da743fb /src/qt/guiutil.cpp | |
| parent | Merge #17918: qt: Hide non PKHash-Addresses in signing address book (diff) | |
| parent | Disable unavailable context menu items in transactions tab (diff) | |
| download | discoin-0d5c18204b73ccb0d7c07f90c52de31edc25e28e.tar.xz discoin-0d5c18204b73ccb0d7c07f90c52de31edc25e28e.zip | |
Merge #17956: gui: Disable unavailable context menu items in transactions tab
2b18fd2242a589988fbb68205dae4afa0b8b3d34 Disable unavailable context menu items in transactions tab (Kristaps Kaupe)
Pull request description:
Fixes #9192.
ACKs for top commit:
jonatack:
Re-ACK 2b18fd2242a5899
jonasschnelli:
codereview utACK 2b18fd2242a589988fbb68205dae4afa0b8b3d34
Tree-SHA512: 4ea19c7b5976f1f0b1baecccb3077cf82f078af7257f92162686bcce2188efe49511a5f557853bc5fe0b10616708957d61c006944babbe60b8105e78751e865f
Diffstat (limited to 'src/qt/guiutil.cpp')
| -rw-r--r-- | src/qt/guiutil.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index dce186884..4afec1b47 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -232,7 +232,7 @@ QString HtmlEscape(const std::string& str, bool fMultiLine) return HtmlEscape(QString::fromStdString(str), fMultiLine); } -void copyEntryData(QAbstractItemView *view, int column, int role) +void copyEntryData(const QAbstractItemView *view, int column, int role) { if(!view || !view->selectionModel()) return; @@ -245,13 +245,20 @@ void copyEntryData(QAbstractItemView *view, int column, int role) } } -QList<QModelIndex> getEntryData(QAbstractItemView *view, int column) +QList<QModelIndex> getEntryData(const QAbstractItemView *view, int column) { if(!view || !view->selectionModel()) return QList<QModelIndex>(); return view->selectionModel()->selectedRows(column); } +bool hasEntryData(const QAbstractItemView *view, int column, int role) +{ + QModelIndexList selection = getEntryData(view, column); + if (selection.isEmpty()) return false; + return !selection.at(0).data(role).toString().isEmpty(); +} + QString getDefaultDataDirectory() { return boostPathToQString(GetDefaultDataDir()); |