Quantum GIS API Documentation
1.7.4
|
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 /* $Id$ */ 00018 00019 #include "qgscredentialdialog.h" 00020 #include <QSettings> 00021 00022 QgsCredentialDialog::QgsCredentialDialog( QWidget *parent, Qt::WFlags fl ) 00023 : QDialog( parent, fl ) 00024 { 00025 setupUi( this ); 00026 setInstance( this ); 00027 } 00028 00029 QgsCredentialDialog::~QgsCredentialDialog() 00030 { 00031 } 00032 00033 bool QgsCredentialDialog::request( QString realm, QString &username, QString &password, QString message ) 00034 { 00035 labelRealm->setText( realm ); 00036 leUsername->setText( username ); 00037 lePassword->setText( password ); 00038 labelMessage->setText( message ); 00039 labelMessage->setHidden( message.isEmpty() ); 00040 00041 QApplication::setOverrideCursor( Qt::ArrowCursor ); 00042 00043 int res = exec(); 00044 00045 QApplication::restoreOverrideCursor(); 00046 00047 if ( res == QDialog::Accepted ) 00048 { 00049 username = leUsername->text(); 00050 password = lePassword->text(); 00051 return true; 00052 } 00053 else 00054 { 00055 return false; 00056 } 00057 }