aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-03-18 15:58:12 +0200
committerRiccardo Spagni <ric@spagni.net>2018-03-18 15:58:12 +0200
commitdf91d7bcbda144a37cee5eca1d1cd7fe114777b5 (patch)
tree8a767613e2d33f8664fbd9dfe7eb15cc35187b80 /src/simplewallet
parentMerge pull request #3419 (diff)
parentsimplewallet: new --use-english-language-names flag (diff)
downloadmonero-df91d7bcbda144a37cee5eca1d1cd7fe114777b5.tar.xz
Merge pull request #3426
8ea3c4d5 simplewallet: new --use-english-language-names flag (moneromooo-monero)
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp11
-rw-r--r--src/simplewallet/simplewallet.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index b5a568a14..97dadb126 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -135,6 +135,7 @@ namespace
const command_line::arg_descriptor<bool> arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the monero network"), false};
const command_line::arg_descriptor<bool> arg_create_address_file = {"create-address-file", sw::tr("Create an address file for new wallets"), false};
const command_line::arg_descriptor<std::string> arg_subaddress_lookahead = {"subaddress-lookahead", tools::wallet2::tr("Set subaddress lookahead sizes to <major>:<minor>"), ""};
+ const command_line::arg_descriptor<bool> arg_use_english_language_names = {"use-english-language-names", sw::tr("Display English language names"), false};
const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""};
@@ -2341,7 +2342,10 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
{
if (args.empty())
{
- success_msg_writer() << "seed = " << m_wallet->get_seed_language();
+ std::string seed_language = m_wallet->get_seed_language();
+ if (m_use_english_language_names)
+ seed_language = crypto::ElectrumWords::get_english_name_for(seed_language);
+ success_msg_writer() << "seed = " << seed_language;
success_msg_writer() << "always-confirm-transfers = " << m_wallet->always_confirm_transfers();
success_msg_writer() << "print-ring-members = " << m_wallet->print_ring_members();
success_msg_writer() << "store-tx-info = " << m_wallet->store_tx_info();
@@ -3130,6 +3134,7 @@ bool simple_wallet::handle_command_line(const boost::program_options::variables_
m_restore_height = command_line::get_arg(vm, arg_restore_height);
m_do_not_relay = command_line::get_arg(vm, arg_do_not_relay);
m_subaddress_lookahead = command_line::get_arg(vm, arg_subaddress_lookahead);
+ m_use_english_language_names = command_line::get_arg(vm, arg_use_english_language_names);
m_restoring = !m_generate_from_view_key.empty() ||
!m_generate_from_spend_key.empty() ||
!m_generate_from_keys.empty() ||
@@ -3176,8 +3181,9 @@ std::string simple_wallet::get_mnemonic_language()
std::vector<std::string> language_list;
std::string language_choice;
int language_number = -1;
- crypto::ElectrumWords::get_language_list(language_list);
+ crypto::ElectrumWords::get_language_list(language_list, m_use_english_language_names);
std::cout << tr("List of available languages for your wallet's seed:") << std::endl;
+ std::cout << tr("If your display freezes, exit blind with ^C, then run again with --use-english-language-names") << std::endl;
int ii;
std::vector<std::string>::iterator it;
for (it = language_list.begin(), ii = 0; it != language_list.end(); it++, ii++)
@@ -7444,6 +7450,7 @@ int main(int argc, char* argv[])
command_line::add_arg(desc_params, arg_do_not_relay);
command_line::add_arg(desc_params, arg_create_address_file);
command_line::add_arg(desc_params, arg_subaddress_lookahead);
+ command_line::add_arg(desc_params, arg_use_english_language_names);
po::positional_options_description positional_options;
positional_options.add(arg_command.name, -1);
diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h
index f45018b60..f26f69353 100644
--- a/src/simplewallet/simplewallet.h
+++ b/src/simplewallet/simplewallet.h
@@ -335,6 +335,7 @@ namespace cryptonote
bool m_restoring; // are we restoring, by whatever method?
uint64_t m_restore_height; // optional
bool m_do_not_relay;
+ bool m_use_english_language_names;
epee::console_handlers_binder m_cmd_binder;