|
|
@ -33,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent):
|
|
|
|
util = new Util(this);
|
|
|
|
util = new Util(this);
|
|
|
|
mifare = new Mifare(ui, util, this);
|
|
|
|
mifare = new Mifare(ui, util, this);
|
|
|
|
|
|
|
|
|
|
|
|
keyEventFilter = new MyEventFilter(QEvent::KeyRelease);
|
|
|
|
keyEventFilter = new MyEventFilter(QEvent::KeyPress);
|
|
|
|
resizeEventFilter = new MyEventFilter(QEvent::Resize);
|
|
|
|
resizeEventFilter = new MyEventFilter(QEvent::Resize);
|
|
|
|
|
|
|
|
|
|
|
|
// hide unused tabs
|
|
|
|
// hide unused tabs
|
|
|
@ -155,7 +155,7 @@ void MainWindow::on_PM3_disconnectButton_clicked()
|
|
|
|
void MainWindow::refreshOutput(const QString& output)
|
|
|
|
void MainWindow::refreshOutput(const QString& output)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// qDebug() << "MainWindow::refresh:" << output;
|
|
|
|
// qDebug() << "MainWindow::refresh:" << output;
|
|
|
|
ui->Raw_outputEdit->insertPlainText(output);
|
|
|
|
ui->Raw_outputEdit->appendPlainText(output);
|
|
|
|
ui->Raw_outputEdit->moveCursor(QTextCursor::End);
|
|
|
|
ui->Raw_outputEdit->moveCursor(QTextCursor::End);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -240,11 +240,13 @@ void MainWindow::refreshCMD(const QString& cmd)
|
|
|
|
ui->Raw_CMDEdit->blockSignals(false);
|
|
|
|
ui->Raw_CMDEdit->blockSignals(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_Raw_CMDEdit_keyPressed(QObject* obj_addr, QEvent& event)
|
|
|
|
void MainWindow::on_Raw_keyPressed(QObject* obj_addr, QEvent& event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(obj_addr == ui->Raw_CMDEdit && event.type() == QEvent::KeyRelease)
|
|
|
|
if(event.type() == QEvent::KeyPress)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QKeyEvent& keyEvent = static_cast<QKeyEvent&>(event);
|
|
|
|
QKeyEvent& keyEvent = static_cast<QKeyEvent&>(event);
|
|
|
|
|
|
|
|
if(obj_addr == ui->Raw_CMDEdit)
|
|
|
|
|
|
|
|
{
|
|
|
|
if(keyEvent.key() == Qt::Key_Up)
|
|
|
|
if(keyEvent.key() == Qt::Key_Up)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(stashedIndex > 0)
|
|
|
|
if(stashedIndex > 0)
|
|
|
@ -269,6 +271,11 @@ void MainWindow::on_Raw_CMDEdit_keyPressed(QObject* obj_addr, QEvent& event)
|
|
|
|
ui->Raw_CMDEdit->blockSignals(false);
|
|
|
|
ui->Raw_CMDEdit->blockSignals(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(obj_addr == ui->Raw_outputEdit)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ui->Raw_CMDEdit->setFocus();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// *****************************************************
|
|
|
|
// *****************************************************
|
|
|
|
|
|
|
|
|
|
|
@ -907,11 +914,12 @@ void MainWindow::MF_widgetReset()
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::uiInit()
|
|
|
|
void MainWindow::uiInit()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
connect(ui->Raw_CMDEdit, &QLineEdit::editingFinished, this, &MainWindow::sendMSG);
|
|
|
|
connect(ui->Raw_CMDEdit, &QLineEdit::returnPressed, this, &MainWindow::sendMSG);
|
|
|
|
ui->Raw_CMDEdit->installEventFilter(keyEventFilter);
|
|
|
|
ui->Raw_CMDEdit->installEventFilter(keyEventFilter);
|
|
|
|
connect(keyEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_Raw_CMDEdit_keyPressed);
|
|
|
|
connect(keyEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_Raw_keyPressed);
|
|
|
|
ui->MF_keyWidget->installEventFilter(resizeEventFilter);
|
|
|
|
ui->MF_keyWidget->installEventFilter(resizeEventFilter);
|
|
|
|
connect(resizeEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_MF_keyWidget_resized);
|
|
|
|
connect(resizeEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_MF_keyWidget_resized);
|
|
|
|
|
|
|
|
ui->Raw_outputEdit->installEventFilter(keyEventFilter);
|
|
|
|
|
|
|
|
|
|
|
|
connectStatusBar = new QLabel(this);
|
|
|
|
connectStatusBar = new QLabel(this);
|
|
|
|
programStatusBar = new QLabel(this);
|
|
|
|
programStatusBar = new QLabel(this);
|
|
|
@ -994,6 +1002,7 @@ void MainWindow::uiInit()
|
|
|
|
ui->MF_RW_keyTypeBox->addItem("B", Mifare::KEY_B);
|
|
|
|
ui->MF_RW_keyTypeBox->addItem("B", Mifare::KEY_B);
|
|
|
|
|
|
|
|
|
|
|
|
on_Raw_CMDHistoryBox_stateChanged(Qt::Unchecked);
|
|
|
|
on_Raw_CMDHistoryBox_stateChanged(Qt::Unchecked);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::signalInit()
|
|
|
|
void MainWindow::signalInit()
|
|
|
|