Proxmark3GUI/ui/mf_sim_simdialog.cpp

67 lines
1.7 KiB
C++
Raw Normal View History

2020-05-01 23:37:23 +08:00
#include "mf_sim_simdialog.h"
#include "ui_mf_sim_simdialog.h"
2020-05-03 00:14:49 +08:00
MF_Sim_simDialog::MF_Sim_simDialog(int cardType, QWidget *parent) :
2020-05-01 23:37:23 +08:00
QDialog(parent),
ui(new Ui::MF_Sim_simDialog)
{
ui->setupUi(this);
2020-05-03 00:14:49 +08:00
this->cardType = cardType;
2020-05-01 23:37:23 +08:00
}
MF_Sim_simDialog::~MF_Sim_simDialog()
{
delete ui;
}
void MF_Sim_simDialog::on_eBox_clicked(bool checked)
{
if(checked)
{
ui->iBox->setChecked(true);
ui->xBox->setChecked(true);
}
if(!ui->eBox->isChecked() && !ui->fBox->isChecked())
{
ui->iBox->setEnabled(true);
ui->xBox->setEnabled(true);
}
else
{
ui->iBox->setEnabled(false);
ui->xBox->setEnabled(false);
}
}
void MF_Sim_simDialog::on_fBox_clicked(bool checked)
{
if(checked)
{
ui->iBox->setChecked(true);
ui->xBox->setChecked(true);
}
if(!ui->eBox->isChecked() && !ui->fBox->isChecked())
{
ui->iBox->setEnabled(true);
ui->xBox->setEnabled(true);
}
else
{
ui->iBox->setEnabled(false);
ui->xBox->setEnabled(false);
}
}
2020-05-03 00:14:49 +08:00
void MF_Sim_simDialog::on_buttonBox_accepted()
{
QString paras;
paras += (ui->uBox->isChecked() ? "u " + ui->uEdit->text() + " " : "");
paras += (ui->nBox->isChecked() ? "n " + ui->nEdit->text() + " " : "");
paras += (ui->iBox->isChecked() ? "i " : "");
paras += (ui->xBox->isChecked() ? "x " : "");
paras += (ui->eBox->isChecked() ? "e " : "");
paras += (ui->fBox->isChecked() ? "f " + ui->fEdit->text() + " " : "");
paras += (ui->rBox->isChecked() ? "r " : "");
emit sendCMD(QString("hf mf sim ") + "*" + QString::number(cardType) + " " + paras.trimmed());
}