You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.4 KiB

// networksettingspage.h — Network configuration form (список listen-сокетов)
#pragma once
#include <QWidget>
#include <QComboBox>
#include <QSpinBox>
#include <QString>
#include <QList>
#include "../transport/config_updater.h"
class QCheckBox;
class QLineEdit;
class QListWidget;
class QPushButton;
class NetworkSettingsPage : public QWidget {
Q_OBJECT
public:
explicit NetworkSettingsPage(QWidget* parent = nullptr);
void loadFromConfig(const QString& configPath);
void saveToConfig(const QString& configPath) const;
private slots:
void onAutoSocketsToggled(bool on);
void onAddServer();
void onRemoveServer();
void onServerSelected();
void onFieldChanged();
private:
void populateInterfaces();
void populateAddresses();
void applyAutoSocketsState();
void refreshServerList(int selectRow = -1);
void loadFormFromSelected();
void updateSelectedServerFromForm();
void updateSelectedListItemText();
QCheckBox* m_autoSocketsCheck;
QListWidget* m_serverList;
QPushButton* m_addBtn;
QPushButton* m_removeBtn;
QLineEdit* m_nameEdit;
QComboBox* m_ipCombo;
QSpinBox* m_portSpin;
QComboBox* m_protoCombo;
QComboBox* m_typeCombo;
QComboBox* m_interfaceCombo;
QList<ConfigServer> m_servers;
QString m_configPath;
bool m_updating = false;
};