예제 #1
0
파일: login_ui.cpp 프로젝트: shunms/hms
Login_Ui::Login_Ui( QWidget * parent ) : QWidget( parent )
{
    failCount = 0;
    ui.setupUi( this );

    connect( ui.loginButton, SIGNAL( clicked() ),
             this, SLOT( CheckFields() ) );

    connect( ui.cancelButton, SIGNAL( clicked() ),
             this, SLOT( ResetFields() ) );


    connect( this, SIGNAL( FailedLogin() ),
             this, SLOT( BadLoginAttempt() ) );

    connect( ui.username, SIGNAL( returnPressed() ),
             this, SLOT( CheckFields() ) );
    connect( ui.password, SIGNAL( returnPressed() ),
             this, SLOT( CheckFields() ) );


    connect( this, SIGNAL( ShowScreen() ),
             this, SLOT( ResetFields() ) );

}
void GGoogleChat::PopulateDeviceWidget(GDeviceWidget* theDeviceWidget )
{
	// a form layout
 	QBoxLayout* pLay = new QVBoxLayout();
	theDeviceWidget->AddSubLayout(pLay);
	GoogleChatWidget* pWid = new GoogleChatWidget(this, theDeviceWidget);
	pLay->addWidget(pWid);

	// connects so that on failure we re-try
	connect(pWid, SIGNAL(FailedLogin()), this, SLOT(LatterInitialization()));
}
예제 #3
0
파일: login_ui.cpp 프로젝트: shunms/hms
bool Login_Ui::CheckFields()
{
    Security_Mgr* security = Main_Window::Security();

    //this guy needs to talk to security module
    qDebug( "Talking to security module..." );

    if ( security->Login( ui.username->text(), ui.password->text() ) )
    {

        emit SuccessfulLogin();
        qDebug( "Login = OK" );
        return true;
    }

    QMessageBox::warning( this, "Failed to Log In",
                        "Please make sure that your username and password"
                        " are correct and try again" );

    emit FailedLogin();
    return false;
}