Skip to content

Commit

Permalink
fixing merge repairs from development branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Dec 31, 2023
1 parent 735fa95 commit 423fb23
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
53 changes: 53 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2767,6 +2767,59 @@ void MainWindow::on_udptcpComboBox_currentIndexChanged(const QString &arg1)
ui->genPostDataButton->setVisible(isPost);
}



void MainWindow::on_actionWake_On_LAN_Magic_Packet_triggered()
{
static QString previousMAC = "";
static int previousPortIndex = 0;
WakeOnLAN * wol = new WakeOnLAN(this);
wol->setTarget(previousMAC, previousPortIndex);
wol->setModal(true);
wol->exec();
if(!wol->generatedPacket.errorString.isEmpty()) {

QMessageBox msgBox;
msgBox.setWindowIcon(QIcon(":pslogo.png"));
msgBox.setWindowTitle(tr("Invalid MAC Address."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(wol->generatedPacket.errorString);
msgBox.setModal(true);
msgBox.exec();

on_actionWake_On_LAN_Magic_Packet_triggered();
wol->deleteLater();
return;
}

if(wol->generatedPacket.toIP.isEmpty()) {
wol->deleteLater();
return;
}

previousMAC = wol->mac;
previousPortIndex = wol->portIndex;

ui->packetIPEdit->setText(wol->generatedPacket.toIP);
ui->packetPortEdit->setText(QString::number(wol->generatedPacket.port));
ui->resendEdit->setText("0");
int findtext = ui->udptcpComboBox->findText(wol->generatedPacket.tcpOrUdp);
if (findtext > -1) {
ui->udptcpComboBox->setCurrentIndex(findtext);
}
ui->packetHexEdit->setText(wol->generatedPacket.hexString);
on_packetHexEdit_editingFinished();
on_udptcpComboBox_currentIndexChanged("");

if(ui->packetNameEdit->text().isEmpty()) {
ui->packetNameEdit->setFocus();
}
wol->deleteLater();
}


void MainWindow::on_cipherCb_currentIndexChanged(){
QSettings settings(SETTINGSFILE, QSettings::IniFormat);
settings.setValue("cipher", cipherCb->currentText());
Expand Down
1 change: 1 addition & 0 deletions src/packetsender.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<file>packetsender.css</file>
<file>iris_and_marigold.jpg</file>
<file>ps_panels.json</file>
<file>icons/outline_lightbulb_white_24dp.png</file>
<file>icons/tx_dtls.png</file>
<file>icons/rx_dtls.png</file>
</qresource>
Expand Down
8 changes: 3 additions & 5 deletions src/persistentconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ PersistentConnection::PersistentConnection(QWidget *parent) :

QDEBUG();
sendPacket.clear();
QDEBUG() /*<< ": refreshTimer Connection attempt " <<
connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refreshTimerTimeout()))*/
QDEBUG() << ": refreshTimer Connection attempt " <<
connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refreshTimerTimeout()))
<< connect(this, SIGNAL(rejected()), this, SLOT(aboutToClose()))
<< connect(this, SIGNAL(accepted()), this, SLOT(aboutToClose()))
<< connect(this, SIGNAL(dialogIsClosing()), this, SLOT(aboutToClose()));
Expand Down Expand Up @@ -218,7 +218,7 @@ void PersistentConnection::cancelResends()

void PersistentConnection::refreshTimerTimeout()
{
// QDEBUG();
//QDEBUG();

qint64 diff = startTime.msecsTo(QDateTime::currentDateTime());

Expand Down Expand Up @@ -351,8 +351,6 @@ void PersistentConnection::socketDisconnected()
statusReceiver("not connected");
}

//connect(pcWindow, SIGNAL(persistentPacketSend(Packet)), thread, SLOT(sendPersistant(Packet)))

void PersistentConnection::on_asciiSendButton_clicked()
{
QString ascii = ui->asciiLineEdit->text();
Expand Down

0 comments on commit 423fb23

Please sign in to comment.