LibEngsas
Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ESqlLogin Class Reference

Class to login into a database.If GUI is not disabled, it requests the login data with help of ESqlLoginWidget, if needed. Otherwise only the specified login data is used. More...

#include <esqllogin.h>

+ Inheritance diagram for ESqlLogin:
+ Collaboration diagram for ESqlLogin:

Public Types

enum  Result { Failed, LoggedIn, Canceled }

Public Slots

ESqlLogin::Result login ()
 Tries to login into the database.
Q_DECL_DEPRECATED int exec ()
 Marked for removel, use login() instead, which does exactly the same, but allows better result distinguishing.
- Public Slots inherited from EObject

Public Member Functions

Q_DECL_DEPRECATED ESqlLogin (QObject *parent=NULL)
 ESqlLogin (bool enableGui, QObject *parent=NULL)
 ESqlLogin (QString title, QString newConnName, bool enableGui=true, QObject *parent=NULL)
QStringList data ()
void reloadSettings ()
 Used to reload the settings.
bool loadAndCheckSettings (QString username=QString(), QString host=QString(), QString database=QString(), QString driver=QString(), QString password=QString())
 Loads all settings and checks them.
- Public Member Functions inherited from EObject
 EObject (QObject *parent=0)
virtual ~EObject ()
void connectByPass (QObject *object)

Static Public Member Functions

static bool checkDBSettings ()
 Checks the database driver and database name combination.
static Q_DECL_DEPRECATED bool checkSettings ()
 Marked for removel, use checkDBSettings() instead, which does exactly the same.
- Static Public Member Functions inherited from EObject
static void connectByPass (QObject *parent, QObject *child)

Private Slots

void showSettingsDialog ()

Private Member Functions

void init (bool enableGui, QString connectionName=QString())
ESqlLogin::Result doLogin ()
ESqlLoginDialogcreateDialog () const
bool checkDBSettingsPrivate ()

Private Attributes

QString host
QString driver
QString database
QString connName
QString username
QString password
QString dialogTitle
bool gui
bool withoutDatabase
bool useSSL
QPointer< KWallet::Wallet > wallet

Additional Inherited Members

- Signals inherited from EObject
void error (const QString &message)
void warning (const QString &message)
void information (const QString &message)
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow.
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
void addAction (QAction *newAction, const QString &parent, QString before=QString())
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
void setCentralWidget (QWidget *centralWidget)
void showSettings ()
void showHelp (const QString &page)
void showStatusWidget (QWidget *widget)
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed.
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child.
- Protected Slots inherited from EObject
virtual void errorByPass (const QString &message)
virtual void warningByPass (const QString &message)
virtual void informationByPass (const QString &message)
virtual void reloadEnableActionsByPass ()
virtual void addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString())
virtual void addActionByPass (QAction *newAction, const QString &parent, QString before=QString())
virtual void addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
virtual void addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area)
virtual void setCentralWidgetByPass (QWidget *centralWidget)
virtual void showSettingsByPass ()
virtual void showHelpByPass (const QString &page)
virtual void showStatusWidgetByPass (QWidget *widget)
virtual void reloadSettingsRequestByPass ()
- Protected Member Functions inherited from EObject
void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

Detailed Description

Class to login into a database.

If GUI is not disabled, it requests the login data with help of ESqlLoginWidget, if needed. Otherwise only the specified login data is used.

Usage:

ESqlLogin login("Database connection for Super Application", "", true, this);
if(login.loadAndCheckSettings()){
if(login.login() != ESqlLogin::Result){
// do some error handling here
}
else{
// do something with database
}
}
Note
It is used by ESqlInit and some other classes. Since the use of ESqlInit, EDBSettings and ESetupWizardDB is recommended, this class should only be used, if you need a connection with a different user than used within the mentioned class before.
See Also
ESqlInit
ESqlLoginWidget

Member Enumeration Documentation

Enumerator:
Failed 
LoggedIn 
Canceled 

Constructor & Destructor Documentation

ESqlLogin::ESqlLogin ( QObject *  parent = NULL)

+ Here is the call graph for this function:

ESqlLogin::ESqlLogin ( bool  enableGui,
QObject *  parent = NULL 
)

+ Here is the call graph for this function:

ESqlLogin::ESqlLogin ( QString  title,
QString  newConnName,
bool  enableGui = true,
QObject *  parent = NULL 
)

+ Here is the call graph for this function:

Member Function Documentation

bool ESqlLogin::checkDBSettings ( )
static

Checks the database driver and database name combination.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ESqlLogin::checkDBSettingsPrivate ( )
private

+ Here is the caller graph for this function:

static Q_DECL_DEPRECATED bool ESqlLogin::checkSettings ( )
inlinestatic

Marked for removel, use checkDBSettings() instead, which does exactly the same.

ESqlLoginDialog * ESqlLogin::createDialog ( ) const
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QStringList ESqlLogin::data ( )
ESqlLogin::Result ESqlLogin::doLogin ( )
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ESqlLogin::exec ( )
slot

Marked for removel, use login() instead, which does exactly the same, but allows better result distinguishing.

+ Here is the call graph for this function:

void ESqlLogin::init ( bool  enableGui,
QString  connectionName = QString() 
)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ESqlLogin::loadAndCheckSettings ( QString  username = QString(),
QString  host = QString(),
QString  database = QString(),
QString  driver = QString(),
QString  password = QString() 
)

Loads all settings and checks them.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ESqlLogin::Result ESqlLogin::login ( )
slot

Tries to login into the database.

If needed and enabledGui is true, it tries to get the login data with ESqlLoginWidget, if needed.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ESqlLogin::reloadSettings ( )
virtual

Used to reload the settings.

This function is connected to doReloadSettings() and should be used to actually do the reload of the settings. To indicate, that the settings should be reloaded, emit reloadSettingsRequest(). Use error to describe the error for the user. And don't forget to call the base implementation or emit doReloadSettings() yourself.

See Also
doReloadSettings()
reloadSettingsRequest()
EWidget::reloadSettings()
EDialog::reloadSettings()

Reimplemented from EObject.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ESqlLogin::showSettingsDialog ( )
privateslot

+ Here is the call graph for this function:

Member Data Documentation

QString ESqlLogin::connName
private
QString ESqlLogin::database
private
QString ESqlLogin::dialogTitle
private
QString ESqlLogin::driver
private
bool ESqlLogin::gui
private
QString ESqlLogin::host
private
QString ESqlLogin::password
private
QString ESqlLogin::username
private
bool ESqlLogin::useSSL
private
QPointer<KWallet::Wallet> ESqlLogin::wallet
private
bool ESqlLogin::withoutDatabase
private

The documentation for this class was generated from the following files: