diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-29 10:28:47 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-29 10:29:14 +0200 |
commit | 0d5c18204b73ccb0d7c07f90c52de31edc25e28e (patch) | |
tree | 1b7f279d2caaef9c6d804d99d5a93f6e2da743fb /src/qt/guiutil.cpp | |
parent | a9024a42fcece274c094cc537275ab0c55bbce15 (diff) | |
parent | 2b18fd2242a589988fbb68205dae4afa0b8b3d34 (diff) |
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 dce186884b..4afec1b474 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()); |