forked from dolphin-emu/dolphin
clang-format'ed over every touched file
This commit is contained in:
@@ -11,11 +11,11 @@
|
||||
#include "Core/HW/EXI/EXI_DeviceAGP.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceDummy.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTCP.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceGecko.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceIPL.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceMemoryCard.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceMic.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTCP.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
|
||||
namespace ExpansionInterface
|
||||
|
@@ -47,7 +47,6 @@ CEXIEthernetBase::CEXIEthernetBase()
|
||||
mac_addr = parsed.value();
|
||||
}
|
||||
|
||||
|
||||
memcpy(&m_bba_mem[BBA_NAFR_PAR0], mac_addr.data(), mac_addr.size());
|
||||
|
||||
// HACK: .. fully established 100BASE-T link
|
||||
@@ -582,4 +581,4 @@ wait_for_next:
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // namespace ExpansionInterface
|
||||
|
@@ -7,8 +7,8 @@
|
||||
#include <thread>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <vector>
|
||||
#include <Windows.h>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
#include "Common/Flag.h"
|
||||
@@ -19,15 +19,15 @@ namespace ExpansionInterface
|
||||
class CEXIEthernetTAP : public CEXIEthernetBase
|
||||
{
|
||||
public:
|
||||
~CEXIEthernetTAP() override;
|
||||
~CEXIEthernetTAP() override;
|
||||
|
||||
protected:
|
||||
bool Activate() override;
|
||||
bool IsActivated() const override;
|
||||
bool SendFrame(const u8* frame, u32 size) override;
|
||||
bool RecvInit() override;
|
||||
void RecvStart() override;
|
||||
void RecvStop() override;
|
||||
bool Activate() override;
|
||||
bool IsActivated() const override;
|
||||
bool SendFrame(const u8* frame, u32 size) override;
|
||||
bool RecvInit() override;
|
||||
void RecvStart() override;
|
||||
void RecvStop() override;
|
||||
|
||||
private:
|
||||
static void ReadThreadHandler(CEXIEthernetTAP* self);
|
||||
|
@@ -2,12 +2,12 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP_Win32.h"
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP_Win32.h"
|
||||
|
||||
namespace Win32TAPHelper
|
||||
{
|
||||
|
@@ -39,7 +39,8 @@ bool CEXIEthernetTCP::Activate()
|
||||
DEBUG_LOG(SP1, "Connecting...");
|
||||
|
||||
m_socket = std::make_unique<sf::TcpSocket>();
|
||||
const sf::Socket::Status status = m_socket->connect(SConfig::GetInstance().m_bba_server, SConfig::GetInstance().m_bba_port);
|
||||
const sf::Socket::Status status =
|
||||
m_socket->connect(SConfig::GetInstance().m_bba_server, SConfig::GetInstance().m_bba_port);
|
||||
if (status != sf::Socket::Done)
|
||||
{
|
||||
ERROR_LOG(SP1, "Could not connect: %i", status);
|
||||
@@ -102,9 +103,13 @@ void CEXIEthernetTCP::ReadThreadHandler(CEXIEthernetTCP* self)
|
||||
selector.add(*self->m_socket);
|
||||
|
||||
// are we currently waiting for size (4 bytes) or payload?
|
||||
enum class SocketState { Size, Payload };
|
||||
enum class SocketState
|
||||
{
|
||||
Size,
|
||||
Payload
|
||||
};
|
||||
|
||||
SocketState state { SocketState::Size };
|
||||
SocketState state{SocketState::Size};
|
||||
|
||||
// buffer to store size temporarily
|
||||
u8 size_buffer[sizeof(int)];
|
||||
@@ -138,13 +143,13 @@ void CEXIEthernetTCP::ReadThreadHandler(CEXIEthernetTCP* self)
|
||||
|
||||
// Have we got all bytes for size?
|
||||
offset += received;
|
||||
if(offset < sizeof(int))
|
||||
if (offset < sizeof(int))
|
||||
continue;
|
||||
offset = 0;
|
||||
|
||||
// convert char array to size int
|
||||
size = 0;
|
||||
for(int i = 0; i < sizeof(int); i++)
|
||||
for (int i = 0; i < sizeof(int); i++)
|
||||
size |= size_buffer[i] << (i * 8);
|
||||
|
||||
DEBUG_LOG(SP1, "Finished size %i", size);
|
||||
@@ -170,7 +175,7 @@ void CEXIEthernetTCP::ReadThreadHandler(CEXIEthernetTCP* self)
|
||||
|
||||
// Have we got all bytes for payload?
|
||||
offset += received;
|
||||
if(offset < size)
|
||||
if (offset < size)
|
||||
continue;
|
||||
offset = 0;
|
||||
|
||||
|
@@ -9,14 +9,17 @@
|
||||
#include "Common/Flag.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceEthernetBase.h"
|
||||
|
||||
namespace sf { class TcpSocket; }
|
||||
namespace sf
|
||||
{
|
||||
class TcpSocket;
|
||||
}
|
||||
|
||||
namespace ExpansionInterface
|
||||
{
|
||||
class CEXIEthernetTCP : public CEXIEthernetBase
|
||||
{
|
||||
public:
|
||||
~CEXIEthernetTCP() override;
|
||||
~CEXIEthernetTCP() override;
|
||||
|
||||
protected:
|
||||
bool Activate() override;
|
||||
|
@@ -4,21 +4,19 @@
|
||||
|
||||
#include "DolphinQt/BBAClient.h"
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include <QHostAddress>
|
||||
#include <QDataStream>
|
||||
#include <QHostAddress>
|
||||
#include <QTcpSocket>
|
||||
|
||||
#include "DolphinQt/BBAServer.h"
|
||||
#include "DolphinQt/BBADebug.h"
|
||||
#include "DolphinQt/BBAServer.h"
|
||||
|
||||
BBAClient::BBAClient(QTcpSocket &socket, BBAServer &server) :
|
||||
QObject(&server),
|
||||
m_socket(socket),
|
||||
m_server(server)
|
||||
BBAClient::BBAClient(QTcpSocket& socket, BBAServer& server)
|
||||
: QObject(&server), m_socket(socket), m_server(server)
|
||||
{
|
||||
m_socket.setParent(this);
|
||||
connect(&m_socket, &QIODevice::readyRead, this, &BBAClient::ReadyRead);
|
||||
connect(&m_socket, &QAbstractSocket::disconnected, this, [this](){
|
||||
connect(&m_socket, &QAbstractSocket::disconnected, this, [this]() {
|
||||
LogInfo() << m_socket.peerAddress() << m_socket.peerPort() << "disconnected";
|
||||
deleteLater();
|
||||
});
|
||||
@@ -31,7 +29,7 @@ BBADebug BBAClient::LogInfo()
|
||||
return m_server.LogInfo();
|
||||
}
|
||||
|
||||
void BBAClient::SendMessage(const QByteArray &buffer)
|
||||
void BBAClient::SendMessage(const QByteArray& buffer)
|
||||
{
|
||||
{
|
||||
QDataStream data_stream(&m_socket);
|
||||
@@ -47,7 +45,7 @@ void BBAClient::ReadyRead()
|
||||
|
||||
while (m_buffer.size())
|
||||
{
|
||||
switch(m_state)
|
||||
switch (m_state)
|
||||
{
|
||||
case SocketState::Size:
|
||||
if (m_buffer.size() < sizeof(int))
|
||||
|
@@ -16,29 +16,30 @@ class BBAClient : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BBAClient(QTcpSocket &socket, BBAServer &server);
|
||||
explicit BBAClient(QTcpSocket& socket, BBAServer& server);
|
||||
|
||||
BBADebug LogInfo();
|
||||
|
||||
signals:
|
||||
void ReceivedMessage(const QByteArray &buffer);
|
||||
void ReceivedMessage(const QByteArray& buffer);
|
||||
|
||||
public slots:
|
||||
void SendMessage(const QByteArray &buffer);
|
||||
void SendMessage(const QByteArray& buffer);
|
||||
|
||||
private slots:
|
||||
void ReadyRead();
|
||||
|
||||
private:
|
||||
enum class SocketState {
|
||||
Size,
|
||||
Payload
|
||||
enum class SocketState
|
||||
{
|
||||
Size,
|
||||
Payload
|
||||
};
|
||||
|
||||
QTcpSocket &m_socket;
|
||||
BBAServer &m_server;
|
||||
QTcpSocket& m_socket;
|
||||
BBAServer& m_server;
|
||||
|
||||
QByteArray m_buffer;
|
||||
SocketState m_state { SocketState::Size };
|
||||
SocketState m_state{SocketState::Size};
|
||||
int m_size;
|
||||
};
|
||||
|
@@ -8,9 +8,7 @@
|
||||
|
||||
#include "DolphinQt/BBAServer.h"
|
||||
|
||||
BBADebug::BBADebug(BBAServer &server) :
|
||||
QDebug(&m_log_line),
|
||||
m_server(server)
|
||||
BBADebug::BBADebug(BBAServer& server) : QDebug(&m_log_line), m_server(server)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -11,10 +11,10 @@ class BBAServer;
|
||||
class BBADebug : public QDebug
|
||||
{
|
||||
public:
|
||||
explicit BBADebug(BBAServer &server);
|
||||
~BBADebug();
|
||||
explicit BBADebug(BBAServer& server);
|
||||
~BBADebug();
|
||||
|
||||
private:
|
||||
BBAServer &m_server;
|
||||
QString m_log_line;
|
||||
BBAServer& m_server;
|
||||
QString m_log_line;
|
||||
};
|
||||
|
@@ -4,32 +4,31 @@
|
||||
|
||||
#include "DolphinQt/BBAServer.h"
|
||||
|
||||
#include <QTcpServer>
|
||||
#include <QHostAddress>
|
||||
#include <QNetworkProxy>
|
||||
#include <QTcpServer>
|
||||
#include <QTimerEvent>
|
||||
|
||||
#include "DolphinQt/BBAClient.h"
|
||||
#include "DolphinQt/BBADebug.h"
|
||||
|
||||
BBAServer::BBAServer(QObject *parent) :
|
||||
QObject(parent),
|
||||
m_server(*new QTcpServer(this))
|
||||
BBAServer::BBAServer(QObject* parent) : QObject(parent), m_server(*new QTcpServer(this))
|
||||
{
|
||||
connect(&m_server, &QTcpServer::newConnection, this, &BBAServer::NewConnection);
|
||||
}
|
||||
|
||||
bool BBAServer::Listen(const QHostAddress &address, quint16 port)
|
||||
bool BBAServer::Listen(const QHostAddress& address, quint16 port)
|
||||
{
|
||||
const auto result = m_server.listen(address, port);
|
||||
if (result)
|
||||
LogInfo() << "Started listening on" << address << port;
|
||||
else
|
||||
LogInfo() << "Could not start listening on" << address << port << "because" << m_server.errorString();
|
||||
LogInfo() << "Could not start listening on" << address << port << "because"
|
||||
<< m_server.errorString();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool BBAServer::Listen(const QString &address, quint16 port)
|
||||
bool BBAServer::Listen(const QString& address, quint16 port)
|
||||
{
|
||||
return Listen(address.isEmpty() ? QHostAddress::Any : QHostAddress(address), port);
|
||||
}
|
||||
@@ -81,7 +80,7 @@ void BBAServer::ResumeAccepting()
|
||||
}
|
||||
|
||||
#ifndef QT_NO_NETWORKPROXY
|
||||
void BBAServer::SetProxy(const QNetworkProxy &network_proxy)
|
||||
void BBAServer::SetProxy(const QNetworkProxy& network_proxy)
|
||||
{
|
||||
m_server.setProxy(network_proxy);
|
||||
}
|
||||
@@ -97,12 +96,12 @@ BBADebug BBAServer::LogInfo()
|
||||
return BBADebug(*this);
|
||||
}
|
||||
|
||||
void BBAServer::timerEvent(QTimerEvent *ev)
|
||||
void BBAServer::timerEvent(QTimerEvent* ev)
|
||||
{
|
||||
if (ev->timerId() == m_timer_id)
|
||||
{
|
||||
if (m_counter <= 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
LogInfo() << m_counter << "packets transmitted";
|
||||
m_counter = 0;
|
||||
@@ -120,19 +119,19 @@ void BBAServer::NewConnection()
|
||||
return;
|
||||
|
||||
auto* client = new BBAClient(*socket, *this);
|
||||
for(auto* other_client : m_clients)
|
||||
for (auto* other_client : m_clients)
|
||||
{
|
||||
connect(client, &BBAClient::ReceivedMessage, other_client, &BBAClient::SendMessage);
|
||||
connect(other_client, &BBAClient::ReceivedMessage, client, &BBAClient::SendMessage);
|
||||
}
|
||||
if (m_timer_id == -1)
|
||||
m_timer_id = startTimer(1000);
|
||||
connect(client, &BBAClient::ReceivedMessage, this, [&counter=m_counter](){ counter++; });
|
||||
connect(client, &QObject::destroyed, this, [client,this](){
|
||||
connect(client, &BBAClient::ReceivedMessage, this, [& counter = m_counter]() { counter++; });
|
||||
connect(client, &QObject::destroyed, this, [client, this]() {
|
||||
m_clients.remove(client);
|
||||
if (m_clients.empty() && m_timer_id != -1)
|
||||
killTimer(m_timer_id);
|
||||
m_timer_id = -1;
|
||||
m_timer_id = -1;
|
||||
});
|
||||
m_clients.insert(client);
|
||||
}
|
||||
|
@@ -19,10 +19,10 @@ class BBAServer : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BBAServer(QObject *parent = nullptr);
|
||||
explicit BBAServer(QObject* parent = nullptr);
|
||||
|
||||
bool Listen(const QHostAddress &address, quint16 port = 0);
|
||||
bool Listen(const QString &address, quint16 port = 0);
|
||||
bool Listen(const QHostAddress& address, quint16 port = 0);
|
||||
bool Listen(const QString& address, quint16 port = 0);
|
||||
void Close();
|
||||
|
||||
bool IsListening() const;
|
||||
@@ -39,24 +39,24 @@ public:
|
||||
void ResumeAccepting();
|
||||
|
||||
#ifndef QT_NO_NETWORKPROXY
|
||||
void SetProxy(const QNetworkProxy &network_proxy);
|
||||
void SetProxy(const QNetworkProxy& network_proxy);
|
||||
QNetworkProxy Proxy() const;
|
||||
#endif
|
||||
|
||||
BBADebug LogInfo();
|
||||
|
||||
signals:
|
||||
void Information(const QDateTime ×tamp, const QString &message);
|
||||
void Information(const QDateTime& timestamp, const QString& message);
|
||||
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *ev) override;
|
||||
void timerEvent(QTimerEvent* ev) override;
|
||||
|
||||
private slots:
|
||||
void NewConnection();
|
||||
|
||||
private:
|
||||
QSet<BBAClient*> m_clients;
|
||||
QTcpServer &m_server;
|
||||
QTcpServer& m_server;
|
||||
|
||||
int m_counter = 0;
|
||||
int m_timer_id = -1;
|
||||
|
@@ -4,23 +4,21 @@
|
||||
|
||||
#include "DolphinQt/BBAServerWindow.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QMessageBox>
|
||||
#include <QTime>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QScrollBar>
|
||||
#include <QSpinBox>
|
||||
#include <QTime>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <limits>
|
||||
|
||||
BBAServerWindow::BBAServerWindow(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
m_server(this)
|
||||
BBAServerWindow::BBAServerWindow(QWidget* parent) : QDialog(parent), m_server(this)
|
||||
{
|
||||
auto* vbox_layout = new QVBoxLayout(this);
|
||||
|
||||
@@ -78,15 +76,17 @@ void BBAServerWindow::Toggle()
|
||||
else
|
||||
{
|
||||
if (!m_server.Listen(m_host_addr->text(), m_port->value()))
|
||||
QMessageBox::warning(this, tr("Could not start listening!"), tr("Could not start listening:\n\n%0").arg(m_server.ErrorString()));
|
||||
QMessageBox::warning(this, tr("Could not start listening!"),
|
||||
tr("Could not start listening:\n\n%0").arg(m_server.ErrorString()));
|
||||
}
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
void BBAServerWindow::LogOutput(const QDateTime ×tamp, const QString &log_line)
|
||||
void BBAServerWindow::LogOutput(const QDateTime& timestamp, const QString& log_line)
|
||||
{
|
||||
m_log_output->appendPlainText(QStringLiteral("%0: %1").arg(timestamp.toString(QStringLiteral("HH:mm:ss.zzz")), log_line));
|
||||
m_log_output->appendPlainText(
|
||||
QStringLiteral("%0: %1").arg(timestamp.toString(QStringLiteral("HH:mm:ss.zzz")), log_line));
|
||||
auto* scroll_bar = m_log_output->verticalScrollBar();
|
||||
scroll_bar->setValue(scroll_bar->maximum());
|
||||
}
|
||||
|
@@ -14,22 +14,22 @@ class QPlainTextEdit;
|
||||
|
||||
class BBAServerWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BBAServerWindow(QWidget *parent = nullptr);
|
||||
explicit BBAServerWindow(QWidget* parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void Toggle();
|
||||
void LogOutput(const QDateTime ×tamp, const QString &log_line);
|
||||
void Toggle();
|
||||
void LogOutput(const QDateTime& timestamp, const QString& log_line);
|
||||
|
||||
private:
|
||||
void Update();
|
||||
void Update();
|
||||
|
||||
BBAServer m_server;
|
||||
BBAServer m_server;
|
||||
|
||||
QLineEdit *m_host_addr;
|
||||
QSpinBox *m_port;
|
||||
QPushButton *m_toggle;
|
||||
QLineEdit* m_host_addr;
|
||||
QSpinBox* m_port;
|
||||
QPushButton* m_toggle;
|
||||
|
||||
QPlainTextEdit *m_log_output;
|
||||
QPlainTextEdit* m_log_output;
|
||||
};
|
||||
|
@@ -3,18 +3,19 @@
|
||||
|
||||
#include "DolphinQt/BBAServer.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
BBAServer server(&app);
|
||||
|
||||
QObject::connect(&server, &BBAServer::Information, [](const QDateTime ×tamp, const QString &logLine){
|
||||
Q_UNUSED(timestamp)
|
||||
qInfo().noquote() << logLine;
|
||||
});
|
||||
QObject::connect(&server, &BBAServer::Information,
|
||||
[](const QDateTime& timestamp, const QString& logLine) {
|
||||
Q_UNUSED(timestamp)
|
||||
qInfo().noquote() << logLine;
|
||||
});
|
||||
|
||||
if(!server.Listen(QString(), 50000))
|
||||
if (!server.Listen(QString(), 50000))
|
||||
return -1;
|
||||
|
||||
return app.exec();
|
||||
|
@@ -4,20 +4,19 @@
|
||||
|
||||
#include "DolphinQt/Config/BBAConfigWidget.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFormLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QToolButton>
|
||||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QSpinBox>
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Common/Network.h"
|
||||
|
||||
BBAConfigWidget::BBAConfigWidget(bool show_server, QWidget* parent) :
|
||||
QDialog(parent)
|
||||
BBAConfigWidget::BBAConfigWidget(bool show_server, QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setWindowTitle(tr("Broadband Adapter Configuration"));
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
@@ -108,7 +107,7 @@ void BBAConfigWidget::SetPort(quint16 port)
|
||||
|
||||
void BBAConfigWidget::Submit()
|
||||
{
|
||||
if(!MacAddr().isEmpty() && !Common::StringToMacAddress(MacAddr().toStdString()))
|
||||
if (!MacAddr().isEmpty() && !Common::StringToMacAddress(MacAddr().toStdString()))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Invalid MAC address!"), tr("Invalid MAC address!"));
|
||||
return;
|
||||
@@ -119,13 +118,14 @@ void BBAConfigWidget::Submit()
|
||||
|
||||
void BBAConfigWidget::GenerateMac()
|
||||
{
|
||||
m_mac_addr->setText(QString::fromStdString(Common::MacAddressToString(Common::GenerateMacAddress(Common::MACConsumer::BBA))));
|
||||
m_mac_addr->setText(QString::fromStdString(
|
||||
Common::MacAddressToString(Common::GenerateMacAddress(Common::MACConsumer::BBA))));
|
||||
}
|
||||
|
||||
void BBAConfigWidget::TextChanged(const QString& text)
|
||||
{
|
||||
QString inputMask;
|
||||
if(!text.isEmpty() && text != QStringLiteral(":::::"))
|
||||
if (!text.isEmpty() && text != QStringLiteral(":::::"))
|
||||
inputMask = QStringLiteral("HH:HH:HH:HH:HH:HH;_");
|
||||
if (m_mac_addr->inputMask() != inputMask)
|
||||
m_mac_addr->setInputMask(inputMask);
|
||||
|
@@ -9,28 +9,29 @@
|
||||
class QLineEdit;
|
||||
class QSpinBox;
|
||||
|
||||
class BBAConfigWidget : public QDialog {
|
||||
Q_OBJECT
|
||||
class BBAConfigWidget : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BBAConfigWidget(bool show_server, QWidget* parent = nullptr);
|
||||
explicit BBAConfigWidget(bool show_server, QWidget* parent = nullptr);
|
||||
|
||||
QString MacAddr() const;
|
||||
void SetMacAddr(const QString& mac_addr);
|
||||
QString MacAddr() const;
|
||||
void SetMacAddr(const QString& mac_addr);
|
||||
|
||||
QString Server() const;
|
||||
void SetServer(const QString& server);
|
||||
QString Server() const;
|
||||
void SetServer(const QString& server);
|
||||
|
||||
quint16 Port() const;
|
||||
void SetPort(quint16 port);
|
||||
quint16 Port() const;
|
||||
void SetPort(quint16 port);
|
||||
|
||||
private slots:
|
||||
void Submit();
|
||||
void GenerateMac();
|
||||
void TextChanged(const QString& text);
|
||||
void Submit();
|
||||
void GenerateMac();
|
||||
void TextChanged(const QString& text);
|
||||
|
||||
private:
|
||||
QLineEdit *m_mac_addr;
|
||||
QLineEdit *m_server { nullptr };
|
||||
QSpinBox *m_port { nullptr };
|
||||
QLineEdit* m_mac_addr;
|
||||
QLineEdit* m_server{nullptr};
|
||||
QSpinBox* m_port{nullptr};
|
||||
};
|
||||
|
@@ -200,7 +200,7 @@ void GameCubePane::OnConfigPressed(int slot)
|
||||
dialog.SetServer(QString::fromStdString(SConfig::GetInstance().m_bba_server));
|
||||
dialog.SetPort(SConfig::GetInstance().m_bba_port);
|
||||
}
|
||||
if(dialog.exec() == QDialog::Accepted)
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
SConfig::GetInstance().m_bba_mac = dialog.MacAddr().toStdString();
|
||||
if (is_tcp)
|
||||
|
Reference in New Issue
Block a user