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

Add ability to clear stats from Qt wallet #2099

Merged
merged 2 commits into from
Jun 20, 2019
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
7 changes: 7 additions & 0 deletions nano/qt/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ nano_qt::stats_viewer::stats_viewer (nano_qt::wallet & wallet_a) :
window (new QWidget),
layout (new QVBoxLayout),
refresh (new QPushButton ("Refresh")),
clear (new QPushButton ("Clear Statistics")),
model (new QStandardItemModel),
view (new QTableView),
back (new QPushButton ("Back")),
Expand All @@ -795,6 +796,7 @@ wallet (wallet_a)
layout->setContentsMargins (0, 0, 0, 0);
layout->addWidget (view);
layout->addWidget (refresh);
layout->addWidget (clear);
layout->addWidget (back);
window->setLayout (layout);

Expand All @@ -805,6 +807,11 @@ wallet (wallet_a)
refresh_stats ();
});

QObject::connect (clear, &QPushButton::released, [this]() {
this->wallet.node.stats.clear ();
refresh_stats ();
});

refresh_stats ();
}

Expand Down
1 change: 1 addition & 0 deletions nano/qt/qt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ class stats_viewer
QWidget * window;
QVBoxLayout * layout;
QPushButton * refresh;
QPushButton * clear;
QStandardItemModel * model;
QTableView * view;
QPushButton * back;
Expand Down