// VdtLoginWidget implements VdtLoginWidget::VdtLoginWidget(QWidget *parent) :QWidget(parent) ,tmnConfig(NULL) ,tmnMessage(NULL) ,msgHint(NULL) ,loginType(CoachLogout){ loginRole = 0; organizationLabel = new QLabel(tr("驾校:")); coachLabel = new QLabel(tr("教练:")); courseLabel = new QLabel(tr("科目:")); traineeLabel = new QLabel(tr("学员:")); clshourLabel = new QLabel(tr("计时:")); odoLabel = new QLabel(tr("计程:")); feeLabel = new QLabel(tr("计费:")); balanceLabel = new QLabel(tr("余额:")); loginButton = new QPushButton(tr("签到")); gridLayout = new QGridLayout; #ifdef VDT_TEST coachButton = new QPushButton(tr("教练信息")); traineeButton = new QPushButton(tr("学员信息")); connect(coachButton, SIGNAL(clicked()),\ this, SLOT(clickCoach())); connect(traineeButton, SIGNAL(clicked()),\ this, SLOT(clickTrainee())); #endif loginButton->setEnabled(false); // wait load coach/trainee info connect(loginButton, SIGNAL(clicked()),\ this, SLOT(clickLogin())); // Layout Widget gridLayout->addWidget(organizationLabel, 0, 0); gridLayout->addWidget(coachLabel, 0, 1); gridLayout->addWidget(courseLabel, 1, 0); gridLayout->addWidget(traineeLabel, 1, 1); gridLayout->addWidget(clshourLabel, 2, 0); gridLayout->addWidget(odoLabel, 2, 1); gridLayout->addWidget(feeLabel, 3, 0); gridLayout->addWidget(balanceLabel, 3, 1); #ifdef VDT_TEST gridLayout->addWidget(coachButton, 4, 0); gridLayout->addWidget(traineeButton, 4, 1); gridLayout->addWidget(loginButton, 4, 2); #else gridLayout->addWidget(loginButton, 4, 1); #endif setLayout(gridLayout); }
UserManagerFixture() : LoginFixture() { // Login LoginWindow* loginWindow = clickLogin(); loginWindow->_usernameEdit->setText("admin"); loginWindow->_passwordEdit->setText("admin"); h::keyPress(loginWindow->_passwordEdit, 13); checkLoggedIn(); // Check that we can bring up the user manager AdminIndex* cp = main->resolve<AdminIndex*>("controls"); BOOST_REQUIRE_MESSAGE( cp, "Looks like the control panel didn't appear" ); // Click the users link wittyPlus::InternalLink* usersLink = h::findSimpleMenuItem(cp, urls::admin_users); BOOST_REQUIRE_MESSAGE( usersLink, "Looks like the users link didn't appear" ); h::click(usersLink); // Sign up to catch dialogs env.dialogExecuted().connect(this, &UserManagerFixture::onDialogExecuted); }