Skip to content

Commit

Permalink
fixing command-line only build for eventual dtls support
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Oct 8, 2024
1 parent 2824a47 commit c5f003e
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/PacketSender.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ TRANSLATIONS += languages/packetsender_en.ts \
languages/packetsender_it.ts

SOURCES += mainwindow.cpp \
association.cpp \
dtlsserver.cpp \
dtlsthread.cpp \
languagechooser.cpp \
panel.cpp \
sendpacketbutton.cpp \
Expand All @@ -39,9 +36,6 @@ SOURCES += mainwindow.cpp \
wakeonlan.cpp

HEADERS += mainwindow.h \
association.h \
dtlsserver.h \
dtlsthread.h \
languagechooser.h \
panel.h \
sendpacketbutton.h \
Expand Down
1 change: 1 addition & 0 deletions src/association.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "association.h"
#include "packet.h"
#include "globals.h"
#include <QTimer>
#include <QCoreApplication>

Expand Down
19 changes: 19 additions & 0 deletions src/dtlsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include "dtlsserver.h"
#include "globals.h"

#include <algorithm>
#ifndef CONSOLE_BUILD
#include <QMessageBox>

#else

class QMessageBox {
public:
QMessageBox() {

};
~QMessageBox() {

}
static void critical(void * ptr, QString msg1, QString msg2) {
return;
}

};
#endif

bool DtlsServer::closeNotifyReceived = false;

namespace {
Expand Down
1 change: 0 additions & 1 deletion src/dtlsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "packet.h"
#include "association.h"
#include "packetnetwork.h"
#include "mainwindow.h"
#include <QThread>
//#include "QSettings"

Expand Down
1 change: 1 addition & 0 deletions src/dtlsthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <QThread>
#include "packet.h"
#include "globals.h"
#include "QSettings"
#include "association.h"
//#include "QTimer"
Expand Down
9 changes: 8 additions & 1 deletion src/packetnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,13 @@ void PacketNetwork::packetToSend(Packet sendpacket)
<< connect(thread, SIGNAL(packetSent(Packet)), this, SLOT(packetSentECHO(Packet)))
<< connect(thread, SIGNAL(destroyed()), this, SLOT(disconnected()));

if(settings.value("leaveSessionOpen").toString() == "true"){
bool leaveSessionOpen = settings.value("leaveSessionOpen").toString() == "true";
#ifndef CONSOLE_BUILD
leaveSessionOpen = false;
#endif
if(leaveSessionOpen){
#ifndef CONSOLE_BUILD

thread->persistentRequest=true;
PersistentConnection * pcWindow = new PersistentConnection();

Expand All @@ -974,6 +980,7 @@ void PacketNetwork::packetToSend(Packet sendpacket)
pcWindow->show();
thread->start();

#endif

}
else{
Expand Down
6 changes: 6 additions & 0 deletions src/packetsender_main.pri
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

SOURCES += main.cpp\
association.cpp \
dtlsserver.cpp \
dtlsthread.cpp \
mainpacketreceiver.cpp \
packetnetwork.cpp \
packet.cpp \
Expand All @@ -9,6 +12,9 @@ SOURCES += main.cpp\


HEADERS += mainpacketreceiver.h \
association.h \
dtlsserver.h \
dtlsthread.h \
packetnetwork.h \
packet.h \
globals.h \
Expand Down
5 changes: 3 additions & 2 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
#define SETTINGS_H

#include "globals.h"
#include "mainwindow.h"

#ifndef CONSOLE_BUILD
#include <QDialog>
#include "packet.h"
#endif
#include <QSettings>
#include <QList>
#include <QCheckBox>


#ifdef CONSOLE_BUILD
Expand Down Expand Up @@ -55,6 +53,9 @@ class Settings {
};
#else

#include "mainwindow.h"
#include <QCheckBox>


namespace Ui
{
Expand Down

0 comments on commit c5f003e

Please sign in to comment.