From f19c9f23076bade5a5933c8084b8779e065ee42e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 29 Oct 2019 17:43:09 +0000 Subject: [PATCH 1/2] util: allow newlines in string to be split --- src/common/util.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/common/util.cpp b/src/common/util.cpp index 57e747837..747235646 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -1239,7 +1239,7 @@ std::string get_nix_version_display_string() return get_string_prefix_by_width(s, 999999999).second; }; - std::vector> split_string_by_width(const std::string &s, size_t columns) + std::vector> split_line_by_width(const std::string &s, size_t columns) { std::vector words; std::vector> lines; @@ -1279,4 +1279,17 @@ std::string get_nix_version_display_string() return lines; } + std::vector> split_string_by_width(const std::string &s, size_t columns) + { + std::vector lines; + std::vector> all_lines; + boost::split(lines, s, boost::is_any_of("\n"), boost::token_compress_on); + for (const auto &e: lines) + { + std::vector> new_lines = split_line_by_width(e, columns); + for (auto &l: new_lines) + all_lines.push_back(std::move(l)); + } + return all_lines; + } } From 88b82befc7735125c13f04a1c48f7de5c76dba4d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 29 Oct 2019 17:43:27 +0000 Subject: [PATCH 2/2] simplewallet: point to "set help" in the lock screen message --- src/simplewallet/simplewallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index ea8f6f2f5..b96050cd8 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -6175,7 +6175,7 @@ void simple_wallet::check_for_inactivity_lock(bool user) m_in_command = true; if (!user) { - const std::string speech = tr("I locked your Monero wallet to protect you while you were away"); + const std::string speech = tr("I locked your Monero wallet to protect you while you were away\nsee \"help_advanced set\" to configure/disable"); std::vector> lines = tools::split_string_by_width(speech, 45); size_t max_len = 0;