25 : QDialog( parent, fl )
30 this, SLOT( requestCredentials( QString, QString *, QString *, QString,
bool * ) ),
31 Qt::BlockingQueuedConnection );
41 if ( qApp->thread() != QThread::currentThread() )
45 QgsDebugMsg( QString(
"signal returned %1 (username=%2, password=%3)" ).arg( ok ?
"true" :
"false" ).arg( username ).arg( password ) );
49 requestCredentials( realm, &username, &password, message, &ok );
54 void QgsCredentialDialog::requestCredentials( QString realm, QString *username, QString *password, QString message,
bool *ok )
57 labelRealm->setText( realm );
58 leUsername->setText( *username );
59 lePassword->setText( *password );
60 labelMessage->setText( message );
61 labelMessage->setHidden( message.isEmpty() );
63 if ( !leUsername->text().isEmpty() )
64 lePassword->setFocus();
66 QWidget *activeWindow = qApp->activeWindow();
68 QApplication::setOverrideCursor( Qt::ArrowCursor );
71 *ok = exec() == QDialog::Accepted;
72 QgsDebugMsg( QString(
"exec(): %1" ).arg( *ok ?
"true" :
"false" ) );
74 QApplication::restoreOverrideCursor();
77 activeWindow->raise();
81 *username = leUsername->text();
82 *password = lePassword->text();