Fix Ask Password in new window if wrong in StartDialog.

And Fix LineEditClear to show placeholder test even if it has focus
(Like Qt5).
This commit is contained in:
Phenom 2017-07-19 19:39:21 +02:00
parent b387f15226
commit 5dc25e37f7
7 changed files with 71 additions and 29 deletions

View file

@ -267,6 +267,12 @@ bool p3Notify::clearPgpPassphrase()
return true ;
}
bool p3Notify::setDisableAskPassword(const bool bValue)
{
_disableAskPassword = bValue;
return true;
}
bool p3Notify::askForPassword (const std::string& title , const std::string& key_details , bool prev_is_bad , std::string& password,bool *cancelled)
{
if(!prev_is_bad && !cached_pgp_passphrase.empty())
@ -278,8 +284,9 @@ bool p3Notify::askForPassword (const std::string& title , c
}
FOR_ALL_NOTIFY_CLIENTS
if( (*it)->askForPassword(title,key_details,prev_is_bad,password,*cancelled))
return true ;
if (!_disableAskPassword)
if( (*it)->askForPassword(title,key_details,prev_is_bad,password,*cancelled) )
return true;
return false ;
}

View file

@ -66,7 +66,7 @@ class p3Notify: public RsNotify
{
public:
p3Notify() : noteMtx("p3Notify") { return; }
p3Notify() : noteMtx("p3Notify"), _disableAskPassword(false) { return; }
virtual ~p3Notify() { return; }
virtual void registerNotifyClient(NotifyClient *nc) ;
@ -125,8 +125,10 @@ class p3Notify: public RsNotify
bool askForPassword (const std::string& title, const std::string& /* key_details */, bool /* prev_is_bad */, std::string&, bool *cancelled /* password */ ) ;
bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */,bool first_time) ;
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) ;
virtual bool clearPgpPassphrase () ;
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) ;
virtual bool clearPgpPassphrase () ;
virtual bool setDisableAskPassword (const bool /*bValue*/) ;
private:
@ -139,7 +141,8 @@ class p3Notify: public RsNotify
std::list<NotifyClient*> notifyClients ;
std::string cached_pgp_passphrase ;
std::string cached_pgp_passphrase;
bool _disableAskPassword;
};

View file

@ -205,8 +205,10 @@ class RsNotify
virtual bool GetFeedItem(RsFeedItem &item) = 0;
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) { return false ; }
virtual bool clearPgpPassphrase () { return false ; }
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) { return false ; }
virtual bool clearPgpPassphrase () { return false ; }
virtual bool setDisableAskPassword (const bool /*bValue*/) { return false ; }
};
class NotifyClient