Beispiel #1
0
void QgsAuthOAuth2Method::onAuthCode()
{
  bool ok = false;
  QString code = QInputDialog::getText( QApplication::activeWindow(), QStringLiteral( "Authoriation Code" ), QStringLiteral( "Enter the authorization code" ), QLineEdit::Normal, QStringLiteral( "Required" ), &ok, Qt::Dialog, Qt::InputMethodHint::ImhNone );
  if ( ok && !code.isEmpty() )
  {
    emit setAuthCode( code );
  }
}
bool ConnectDialog::loadPeer(std::string id)
{ 
	std::map<RsCertId,NeighbourInfo>::const_iterator it;
	/* first grab the list of signers (outside lock) */

	char signerstr[1024];
	rsicontrol->NeighGetSigners(id, signerstr, 1024);

	/* XXX NOTE We must copy the char * to a string, 
         * otherwise it get trampled on by the it = find(id).
         * ( DONT KNOW WHY???? ) under mingw.
         */

	std::string signersString; 
	signersString = signerstr;

	/* grab the interface and check person */
	rsiface->lockData(); /* Lock Interface */
	
	const std::map<RsCertId,NeighbourInfo> &neighs = 
			rsiface->getNeighbourMap();

	it = neighs.find(id);

	if (it == neighs.end())
	{
		rsiface->unlockData(); /* UnLock Interface */
		return false;
	}

	/* setup the gui */
	setInfo(it->second.name, it->second.trustString, it->second.org,
	it->second.loc, it->second.country, signersString);

	setAuthCode(id, it->second.authCode);
	
	rsiface->unlockData(); /* UnLock Interface */

	return true;
}