pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | List of all members
pycross.forms.PasswordDialog Class Reference

Tiny login/password authentication dialog. More...

Inheritance diagram for pycross.forms.PasswordDialog:
pycross.forms.BasicDialog

Public Member Functions

def __init__ (self, title=_('Authentication'), icon='locked.png', user_label=_('User'), password_label=_('Password'), allow_empty_user=False, allow_empty_password=False, parent=None, flags=QtCore.Qt.WindowFlags())
 Constructor. More...
 
def addMainLayout (self)
 Creates the main (central) layout for controls. More...
 
def validate (self)
 Validates user input (reimplemented in child classes). More...
 
def get_auth (self)
 Gets the user and password in a single 2-tuple. More...
 
- Public Member Functions inherited from pycross.forms.BasicDialog
def __init__ (self, geometry=None, title=None, icon=None, parent=None, flags=QtCore.Qt.WindowFlags(), sizepolicy=QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed))
 Constructor. More...
 
def initUI (self, geometry=None, title=None, icon=None)
 Creates the core controls: OK and Cancel buttons and layouts. More...
 
def on_btn_OK_clicked (self)
 Fires when the OK button is clicked. More...
 
def on_btn_cancel_clicked (self)
 Fires when the Cancel button is clicked: rejects input and closes window. More...
 

Public Attributes

 user_label
 
 password_label
 
 allow_empty_user
 
 allow_empty_password
 
 layout_controls
 
 le_user
 
 le_pass
 
- Public Attributes inherited from pycross.forms.BasicDialog
 layout_controls
 QtWidgets.QFormLayout central layout for controls More...
 
 btn_OK
 QtWidgets.QPushButton OK button More...
 
 btn_cancel
 QtWidgets.QPushButton Cancel button More...
 
 layout_bottom
 QtWidgets.QHBoxLayout bottom layout for OK and Cancel buttons More...
 
 layout_main
 QtWidgets.QVBoxLayout window layout More...
 

Detailed Description

Tiny login/password authentication dialog.

Constructor & Destructor Documentation

◆ __init__()

def pycross.forms.PasswordDialog.__init__ (   self,
  title = _('Authentication'),
  icon = 'locked.png',
  user_label = _('User'),
  password_label = _('Password'),
  allow_empty_user = False,
  allow_empty_password = False,
  parent = None,
  flags = QtCore.Qt.WindowFlags() 
)

Constructor.

Parameters
titlestr dialog title
iconstr dialog icon file
user_labelstr user (login) hint
password_labelstr password hint
allow_empty_userbool whether an empty user string is allowed
allow_empty_passwordbool dwhether an empty password string is allowed
parentQtWidgets.QWidget parent widget (default = None, i.e. no parent)
flagsQtCore.Qt.WindowFlags Qt window flags

Member Function Documentation

◆ addMainLayout()

def pycross.forms.PasswordDialog.addMainLayout (   self)

Creates the main (central) layout for controls.

Must be overridden by child classes to change the layout type (default = QtWidgets.QFormLayout) and add controls.

Reimplemented from pycross.forms.BasicDialog.

◆ get_auth()

def pycross.forms.PasswordDialog.get_auth (   self)

Gets the user and password in a single 2-tuple.

Returns
2-tuple (user, password)

◆ validate()

def pycross.forms.PasswordDialog.validate (   self)

Validates user input (reimplemented in child classes).

Returns
bool True if user input is valid, False otherwise
See also
on_btn_OK_clicked()

Reimplemented from pycross.forms.BasicDialog.

Member Data Documentation

◆ allow_empty_password

pycross.forms.PasswordDialog.allow_empty_password

◆ allow_empty_user

pycross.forms.PasswordDialog.allow_empty_user

◆ layout_controls

pycross.forms.PasswordDialog.layout_controls

◆ le_pass

pycross.forms.PasswordDialog.le_pass

◆ le_user

pycross.forms.PasswordDialog.le_user

◆ password_label

pycross.forms.PasswordDialog.password_label

◆ user_label

pycross.forms.PasswordDialog.user_label

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