Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgscredentialdialog.cpp - description 00003 ------------------- 00004 begin : February 2010 00005 copyright : (C) 2010 by Juergen E. Fischer 00006 email : jef at norbit dot de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "qgscredentialdialog.h" 00019 #include <QSettings> 00020 00021 QgsCredentialDialog::QgsCredentialDialog( QWidget *parent, Qt::WFlags fl ) 00022 : QDialog( parent, fl ) 00023 { 00024 setupUi( this ); 00025 setInstance( this ); 00026 } 00027 00028 QgsCredentialDialog::~QgsCredentialDialog() 00029 { 00030 } 00031 00032 bool QgsCredentialDialog::request( QString realm, QString &username, QString &password, QString message ) 00033 { 00034 labelRealm->setText( realm ); 00035 leUsername->setText( username ); 00036 lePassword->setText( password ); 00037 labelMessage->setText( message ); 00038 labelMessage->setHidden( message.isEmpty() ); 00039 00040 QApplication::setOverrideCursor( Qt::ArrowCursor ); 00041 00042 int res = exec(); 00043 00044 QApplication::restoreOverrideCursor(); 00045 00046 if ( res == QDialog::Accepted ) 00047 { 00048 username = leUsername->text(); 00049 password = lePassword->text(); 00050 return true; 00051 } 00052 else 00053 { 00054 return false; 00055 } 00056 }