Forms: Update ConnectInfo on settings apply instead of close

Just for better usability
This commit is contained in:
tt2468 2021-09-17 02:54:29 -07:00
parent d811c95e10
commit a4e62acf25
3 changed files with 9 additions and 2 deletions

View File

@ -29,6 +29,12 @@ ConnectInfo::~ConnectInfo()
}
void ConnectInfo::showEvent(QShowEvent *event)
{
UNUSED_PARAMETER(event);
RefreshData();
}
void ConnectInfo::RefreshData()
{
auto conf = GetConfig();
if (!conf) {

View File

@ -14,6 +14,7 @@ public:
explicit ConnectInfo(QWidget* parent = 0);
~ConnectInfo();
void showEvent(QShowEvent *event);
void RefreshData();
private Q_SLOTS:
void CopyServerIpButtonClicked();

View File

@ -117,8 +117,6 @@ void SettingsDialog::DialogButtonClicked(QAbstractButton *button)
void SettingsDialog::SaveFormData()
{
connectInfo->hide();
auto conf = GetConfig();
if (!conf) {
blog(LOG_ERROR, "[SettingsDialog::SaveFormData] Unable to retreive config!");
@ -163,6 +161,8 @@ void SettingsDialog::SaveFormData()
conf->Save();
connectInfo->RefreshData();
if (needsRestart) {
blog(LOG_INFO, "[SettingsDialog::SaveFormData] A setting was changed which requires a server restart.");
auto server = GetWebSocketServer();