pcsx2/pcsx2-qt/Settings/DEV9SettingsWidget.h

86 lines
2.4 KiB
C
Raw Permalink Normal View History

// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
2022-03-13 17:58:39 +00:00
#pragma once
#include <QtWidgets/QWidget>
#include <QtGui/QStandardItemModel>
#include "ui_DEV9SettingsWidget.h"
2022-05-22 12:49:40 +00:00
#include "DEV9UiCommon.h"
#include "DEV9DnsHostDialog.h"
2022-03-13 17:58:39 +00:00
#include "DEV9/net.h"
class SettingsWindow;
2022-03-13 17:58:39 +00:00
class DEV9SettingsWidget : public QWidget
{
Q_OBJECT
private Q_SLOTS:
void onEthEnabledChanged(Qt::CheckState state);
2022-03-13 17:58:39 +00:00
void onEthDeviceTypeChanged(int index);
void onEthDeviceChanged(int index);
void onEthDHCPInterceptChanged(Qt::CheckState state);
2022-03-13 17:58:39 +00:00
void onEthIPChanged(QLineEdit* sender, const char* section, const char* key);
void onEthAutoChanged(QCheckBox* sender, Qt::CheckState state, QLineEdit* input, const char* section, const char* key);
2022-03-13 17:58:39 +00:00
void onEthDNSModeChanged(QComboBox* sender, int index, QLineEdit* input, const char* section, const char* key);
void onEthHostAdd();
void onEthHostDel();
2022-05-22 12:49:40 +00:00
void onEthHostExport();
void onEthHostImport();
2022-06-04 20:30:14 +00:00
void onEthHostPerGame();
2022-03-13 17:58:39 +00:00
void onEthHostEdit(QStandardItem* item);
void onHddEnabledChanged(Qt::CheckState state);
2022-03-13 17:58:39 +00:00
void onHddBrowseFileClicked();
2023-09-03 19:58:50 +00:00
void onHddFileTextChange();
2022-03-13 17:58:39 +00:00
void onHddFileEdit();
void onHddSizeSlide(int i);
void onHddSizeAccessorSpin();
void onHddLBA48Changed(Qt::CheckState state);
2022-03-13 17:58:39 +00:00
void onHddCreateClicked();
public:
DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent);
2022-03-13 17:58:39 +00:00
~DEV9SettingsWidget();
protected:
void showEvent(QShowEvent* event);
bool eventFilter(QObject* object, QEvent* event);
private:
void AddAdapter(const AdapterEntry& adapter);
void LoadAdapters();
2022-03-13 17:58:39 +00:00
void RefreshHostList();
int CountHostsConfig();
2022-06-04 20:30:14 +00:00
std::optional<std::vector<HostEntryUi>> ListHostsConfig();
std::vector<HostEntryUi> ListBaseHostsConfig();
2022-03-13 17:58:39 +00:00
void AddNewHostConfig(const HostEntryUi& host);
void DeleteHostConfig(int index);
2023-09-03 19:58:50 +00:00
void UpdateHddSizeUIEnabled();
void UpdateHddSizeUIValues();
SettingsWindow* m_dialog;
2022-03-13 17:58:39 +00:00
Ui::DEV9SettingsWidget m_ui;
bool m_firstShow{true};
2022-03-13 17:58:39 +00:00
QStandardItemModel* m_ethHost_model;
QSortFilterProxyModel* m_ethHosts_proxy;
bool m_adaptersLoaded{false};
2022-03-13 17:58:39 +00:00
std::vector<Pcsx2Config::DEV9Options::NetApi> m_api_list;
std::vector<const char*> m_api_namelist;
std::vector<const char*> m_api_valuelist;
std::vector<std::vector<AdapterEntry>> m_adapter_list;
AdapterOptions m_adapter_options{AdapterOptions::None};
//Use by per-game ui only
Pcsx2Config::DEV9Options::NetApi m_global_api{Pcsx2Config::DEV9Options::NetApi::Unset};
2022-03-13 17:58:39 +00:00
};