From 978239f32f6bd67f7d026d98501f04343e01f2a9 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 11 Jun 2015 20:42:01 +0000 Subject: [PATCH] forgot this from previous commit git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8416 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libresapi/src/api/RsControlModule.cpp | 3 ++- libresapi/src/api/RsControlModule.h | 2 +- retroshare-nogui/src/retroshare.cc | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libresapi/src/api/RsControlModule.cpp b/libresapi/src/api/RsControlModule.cpp index dfd59a574..1229ee456 100644 --- a/libresapi/src/api/RsControlModule.cpp +++ b/libresapi/src/api/RsControlModule.cpp @@ -52,8 +52,9 @@ bool RsControlModule::processShouldExit() return mProcessShouldExit; } -bool RsControlModule::askForPassword(const std::string &key_details, bool prev_is_bad, std::string &password) +bool RsControlModule::askForPassword(const std::string &key_details, bool prev_is_bad, std::string &password, bool& cancelled) { + cancelled = false ; { RsStackMutex stack(mDataMtx); // ********** LOCKED ********** mWantPassword = true; diff --git a/libresapi/src/api/RsControlModule.h b/libresapi/src/api/RsControlModule.h index 0619ab6cb..d2b25f915 100644 --- a/libresapi/src/api/RsControlModule.h +++ b/libresapi/src/api/RsControlModule.h @@ -32,7 +32,7 @@ public: bool processShouldExit(); // from NotifyClient - virtual bool askForPassword(const std::string& key_details, bool prev_is_bad , std::string& password); + virtual bool askForPassword(const std::string& key_details, bool prev_is_bad , std::string& password,bool& canceled); protected: // from RsThread diff --git a/retroshare-nogui/src/retroshare.cc b/retroshare-nogui/src/retroshare.cc index a2d33a274..1da48dc6b 100644 --- a/retroshare-nogui/src/retroshare.cc +++ b/retroshare-nogui/src/retroshare.cc @@ -437,8 +437,9 @@ void generatePasswordHash() std::string sshPwdForHash = ""; std::string passwd1,passwd2 ; + bool cancel ; - if(!NotifyTxt().askForPassword("Type your password (at least 8 chars) : ",false,passwd1)) exit(1) ; + if(!NotifyTxt().askForPassword("Type your password (at least 8 chars) : ",false,passwd1,cancel)) exit(1) ; if(passwd1.length() < 8) { @@ -446,7 +447,7 @@ void generatePasswordHash() exit(1); } - if(!NotifyTxt().askForPassword("Type your password (checking) : ",false,passwd2)) exit(1) ; + if(!NotifyTxt().askForPassword("Type your password (checking) : ",false,passwd2,cancel)) exit(1) ; if(passwd1 != passwd2) {