From ed29774c26567686fca55a0635475140b6a2e0d3 Mon Sep 17 00:00:00 2001 From: James Coxon Date: Fri, 14 Apr 2017 09:44:49 +0100 Subject: [PATCH 1/5] Switched default unit to Mrai not krai Finding that automatically switch to Mrai so changed to default --- rai/qt/qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rai/qt/qt.cpp b/rai/qt/qt.cpp index 73d705c8..d815a0a9 100644 --- a/rai/qt/qt.cpp +++ b/rai/qt/qt.cpp @@ -115,7 +115,7 @@ wallet (wallet_a) this->wallet.change_rendering_ratio (rai::rai_ratio); } }); - krai->click (); + mrai->click (); } void rai_qt::self_pane::refresh_balance () From 00b13365fb187b67f61455984b4344835849590c Mon Sep 17 00:00:00 2001 From: James Coxon Date: Fri, 14 Apr 2017 10:02:19 +0100 Subject: [PATCH 2/5] Added block count to status bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added block count to status bar when ‘Running’ and ‘Sync’ to allow easy visualisation of updates etc. --- rai/qt/qt.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rai/qt/qt.cpp b/rai/qt/qt.cpp index d815a0a9..2f76efa3 100644 --- a/rai/qt/qt.cpp +++ b/rai/qt/qt.cpp @@ -628,6 +628,11 @@ std::string rai_qt::status::text () { assert (!active.empty ()); std::string result; + rai::transaction transaction (wallet.wallet_m->node.store.environment, nullptr, false); + auto size (wallet.wallet_m->node.store.block_count (transaction)); + auto unchecked (wallet.wallet_m->node.store.unchecked_count (transaction)); + auto count_string (std::to_string (size.sum ())); + switch (*active.begin ()) { case rai_qt::status_types::disconnected: @@ -637,7 +642,12 @@ std::string rai_qt::status::text () result = "Status: Generating proof of work"; break; case rai_qt::status_types::synchronizing: - result = "Status: Synchronizing"; + result = "Status: Synchronizing, Block: "; + if (unchecked != 0) + { + count_string += " (" + std::to_string (unchecked) + ")"; + } + result += count_string.c_str (); break; case rai_qt::status_types::locked: result = "Status: Wallet locked"; @@ -649,7 +659,12 @@ std::string rai_qt::status::text () result = "Status: Wallet active"; break; case rai_qt::status_types::nominal: - result = "Status: Running"; + result = "Status: Running, Block: "; + if (unchecked != 0) + { + count_string += " (" + std::to_string (unchecked) + ")"; + } + result += count_string.c_str (); break; default: assert (false); From 9868031a9c242a8e4e3012c90bfe1965141283b2 Mon Sep 17 00:00:00 2001 From: James Coxon Date: Sat, 15 Apr 2017 07:34:52 +0100 Subject: [PATCH 3/5] Displays block count for all states, simplified code Due to the frequency of refreshing can appear out of sync with the block count display in Advanced (when catching up) - minor issue --- rai/qt/qt.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/rai/qt/qt.cpp b/rai/qt/qt.cpp index 2f76efa3..d9f23821 100644 --- a/rai/qt/qt.cpp +++ b/rai/qt/qt.cpp @@ -642,12 +642,7 @@ std::string rai_qt::status::text () result = "Status: Generating proof of work"; break; case rai_qt::status_types::synchronizing: - result = "Status: Synchronizing, Block: "; - if (unchecked != 0) - { - count_string += " (" + std::to_string (unchecked) + ")"; - } - result += count_string.c_str (); + result = "Status: Synchronizing"; break; case rai_qt::status_types::locked: result = "Status: Wallet locked"; @@ -659,17 +654,20 @@ std::string rai_qt::status::text () result = "Status: Wallet active"; break; case rai_qt::status_types::nominal: - result = "Status: Running, Block: "; - if (unchecked != 0) - { - count_string += " (" + std::to_string (unchecked) + ")"; - } - result += count_string.c_str (); + result = "Status: Running"; break; default: assert (false); break; } + + result += ", Block: "; + if (unchecked != 0) + { + count_string += " (" + std::to_string (unchecked) + ")"; + } + result += count_string.c_str (); + return result; } From db58c8fcbc9e466b964874ca92fc987d368f7dee Mon Sep 17 00:00:00 2001 From: James Coxon Date: Sat, 15 Apr 2017 08:01:24 +0100 Subject: [PATCH 4/5] Added tooltip to help interpretation of status bar --- rai/qt/qt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rai/qt/qt.cpp b/rai/qt/qt.cpp index d9f23821..42401a82 100644 --- a/rai/qt/qt.cpp +++ b/rai/qt/qt.cpp @@ -622,6 +622,7 @@ void rai_qt::status::set_text () { wallet.status->setText (text ().c_str ()); wallet.status->setStyleSheet ((std::string ("QLabel {") + color () + "}").c_str ()); + wallet.status->setToolTip("Wallet status and wallet block count (blocks remaining to sync)"); } std::string rai_qt::status::text () From 4308b5319e9082caac0c708050173e75f8aa1dd2 Mon Sep 17 00:00:00 2001 From: James Coxon Date: Sat, 15 Apr 2017 22:49:37 +0100 Subject: [PATCH 5/5] Added if clause to check if new password is empty linked to #87 --- rai/qt/qt.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/rai/qt/qt.cpp b/rai/qt/qt.cpp index d815a0a9..2fdddbcb 100644 --- a/rai/qt/qt.cpp +++ b/rai/qt/qt.cpp @@ -1087,17 +1087,27 @@ wallet (wallet_a) rai::transaction transaction (this->wallet.wallet_m->store.environment, nullptr, true); if (this->wallet.wallet_m->store.valid_password (transaction)) { - if (new_password->text () == retype_password->text ()) + if (new_password->text ().isEmpty()) { - this->wallet.wallet_m->store.rekey (transaction, std::string (new_password->text ().toLocal8Bit ())); new_password->clear (); - retype_password->clear (); - retype_password->setPlaceholderText ("Retype password"); + new_password->setPlaceholderText ("Empty Password - try again: New password"); + retype_password->clear (); + retype_password->setPlaceholderText ("Empty Password - try again: Retype password"); } else { - retype_password->clear (); - retype_password->setPlaceholderText ("Password mismatch"); + if (new_password->text () == retype_password->text ()) + { + this->wallet.wallet_m->store.rekey (transaction, std::string (new_password->text ().toLocal8Bit ())); + new_password->clear (); + retype_password->clear (); + retype_password->setPlaceholderText ("Retype password"); + } + else + { + retype_password->clear (); + retype_password->setPlaceholderText ("Password mismatch"); + } } } });