Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgscredentialdialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgscredentialdialog.cpp - description
3  -------------------
4  begin : February 2010
5  copyright : (C) 2010 by Juergen E. Fischer
6  email : jef at norbit dot de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 /* $Id$ */
18 
19 #include "qgscredentialdialog.h"
20 #include <QSettings>
21 
22 QgsCredentialDialog::QgsCredentialDialog( QWidget *parent, Qt::WFlags fl )
23  : QDialog( parent, fl )
24 {
25  setupUi( this );
26  setInstance( this );
27 }
28 
30 {
31 }
32 
33 bool QgsCredentialDialog::request( QString realm, QString &username, QString &password, QString message )
34 {
35  labelRealm->setText( realm );
36  leUsername->setText( username );
37  lePassword->setText( password );
38  labelMessage->setText( message );
39  labelMessage->setHidden( message.isEmpty() );
40 
41  QApplication::setOverrideCursor( Qt::ArrowCursor );
42 
43  int res = exec();
44 
45  QApplication::restoreOverrideCursor();
46 
47  if ( res == QDialog::Accepted )
48  {
49  username = leUsername->text();
50  password = lePassword->text();
51  return true;
52  }
53  else
54  {
55  return false;
56  }
57 }