text: /**
   * @file adnewuserdialog.h
   * @author CalaW (maker_cc@foxmail.com)
   * @brief Dialog for admin user to add new user
   * 
   * auto generated by qt wizard
   * 
   * @version 0.1
   * @date 2021-08-07
   * 
   */
  
  #include "adnewuserdialog.h"
  #include "ui_adnewuserdialog.h"
  
  adNewUserDialog::adNewUserDialog(QWidget *parent) :
      QDialog(parent),
      ui(new Ui::adNewUserDialog)
  {
      ui->setupUi(this);
  }
  
  adNewUserDialog::~adNewUserDialog()
  {
      delete ui;
  }
  
  
  void adNewUserDialog::on_buttonBox_accepted()
  {
      switch (ui->methodChk->currentIndex()) {
      case 0:
          emit adAddUserConfirm(ui->newUserNameEdt->text(), ui->newUserPwdEdt->text());
          break;
      case 1:
          emit adDelUserConfirm(ui->newUserNameEdt->text());
          break;
      case 2:
          emit adChUserPwdConfirm(ui->newUserNameEdt->text(), ui->newUserPwdEdt->text());
          break;
      }
  }
  
  
  void adNewUserDialog::on_methodChk_currentIndexChanged(int index)
  {
      switch (index) {
      case 0:
          ui->newUserPwdEdt->show();
          ui->pwdLabel->show();
          break;
      case 1:
          ui->newUserPwdEdt->hide();
          ui->pwdLabel->hide();
          break;
      case 2:
          ui->newUserPwdEdt->show();
          ui->pwdLabel->show();
          break;
      }
  }
  
  