Skip to content
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

gui: Add beaconExpired() to researchermodel #2498

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1841,15 +1841,24 @@ void BitcoinGUI::updateBeaconIcon()
labelBeaconIcon->show();
labelBeaconIcon->setPixmap(GRC::ScaleStatusIcon(this, researcherModel->getBeaconStatusIcon()));

labelBeaconIcon->setToolTip(tr(
"CPID: %1\n"
"Beacon age: %2\n"
"Expires: %3\n"
"%4")
.arg(researcherModel->formatCpid())
.arg(researcherModel->formatBeaconAge())
.arg(researcherModel->formatTimeToBeaconExpiration())
.arg(researcherModel->formatBeaconStatus()));
if (researcherModel->beaconExpired()) {
labelBeaconIcon->setToolTip(tr("CPID: %1\n"
"Beacon age: %2\n"
"Current beacon expired!\n"
"%3")
.arg(researcherModel->formatCpid())
.arg(researcherModel->formatBeaconAge())
.arg(researcherModel->formatBeaconStatus()));
} else {
labelBeaconIcon->setToolTip(tr("CPID: %1\n"
"Beacon age: %2\n"
"Expires: %3\n"
"%4")
.arg(researcherModel->formatCpid())
.arg(researcherModel->formatBeaconAge())
.arg(researcherModel->formatTimeToBeaconExpiration())
.arg(researcherModel->formatBeaconStatus()));
}
}

void BitcoinGUI::handleNewPoll()
Expand Down
5 changes: 5 additions & 0 deletions src/qt/researcher/researchermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ bool ResearcherModel::hasRenewableBeacon() const
return m_beacon && m_beacon->Renewable(GetAdjustedTime());
}

bool ResearcherModel::beaconExpired() const
{
return m_beacon->Expired(GetAdjustedTime());
}

bool ResearcherModel::hasMagnitude() const
{
return m_researcher->Magnitude() != 0;
Expand Down
1 change: 1 addition & 0 deletions src/qt/researcher/researchermodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ResearcherModel : public QObject
bool hasActiveBeacon() const;
bool hasPendingBeacon() const;
bool hasRenewableBeacon() const;
bool beaconExpired() const;
bool hasMagnitude() const;
bool hasRAC() const;
bool hasSplitCpid() const;
Expand Down