mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 15:05:35 -04:00
improved login system: do not re-ask for passphrase when user clicks cancel. Removed warning stating that maybe passphrase is wrong
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8415 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3bec1f4f69
commit
74c01423f0
14 changed files with 87 additions and 45 deletions
|
@ -244,7 +244,7 @@ void NotifyQt::handleSignatureEvent()
|
|||
|
||||
|
||||
|
||||
bool NotifyQt::askForPassword(const std::string& key_details, bool prev_is_bad, std::string& password)
|
||||
bool NotifyQt::askForPassword(const std::string& key_details, bool prev_is_bad, std::string& password,bool& cancelled)
|
||||
{
|
||||
RsAutoUpdatePage::lockAllEvents() ;
|
||||
|
||||
|
@ -256,12 +256,20 @@ bool NotifyQt::askForPassword(const std::string& key_details, bool prev_is_bad,
|
|||
|
||||
int ret = dialog.exec();
|
||||
|
||||
cancelled = false ;
|
||||
|
||||
RsAutoUpdatePage::unlockAllEvents() ;
|
||||
|
||||
if (ret == QDialog::Accepted) {
|
||||
if (ret == QDialog::Rejected) {
|
||||
password.clear() ;
|
||||
cancelled = true ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
if (ret == QDialog::Accepted) {
|
||||
password = dialog.textValue().toUtf8().constData();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
virtual void notifyDiscInfoChanged() ;
|
||||
virtual void notifyDownloadComplete(const std::string& fileHash);
|
||||
virtual void notifyDownloadCompleteCount(uint32_t count);
|
||||
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 &cancelled);
|
||||
virtual bool askForPluginConfirmation(const std::string& plugin_filename, const std::string& plugin_file_hash);
|
||||
|
||||
// Queues the signature event so that it canhappen in the main GUI thread (to ask for passwd).
|
||||
|
|
|
@ -650,10 +650,11 @@ bool Rshare::loadCertificate(const RsPeerId &accountId, bool autoLogin)
|
|||
QObject::tr("An unexpected error occurred when Retroshare "
|
||||
"tried to acquire the single instance lock\n Lock file:\n") +
|
||||
QString::fromUtf8(lockFile.c_str()));
|
||||
return false;
|
||||
case 3: QMessageBox::critical( 0,
|
||||
QObject::tr("Login Failure"),
|
||||
QObject::tr("Maybe password is wrong") );
|
||||
return false;
|
||||
case 3:
|
||||
// case 3: QMessageBox::critical( 0,
|
||||
// QObject::tr("Login Failure"),
|
||||
// QObject::tr("Maybe password is wrong") );
|
||||
return false;
|
||||
default: std::cerr << "Rshare::loadCertificate() unexpected switch value " << retVal << std::endl;
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue