mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
SettingsDialog: Add timer to constantly update session table
This commit is contained in:
parent
aa241ecc9e
commit
fb01a28623
@ -14,7 +14,8 @@
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent) :
|
||||
QDialog(parent, Qt::Dialog),
|
||||
ui(new Ui::SettingsDialog)
|
||||
ui(new Ui::SettingsDialog),
|
||||
sessionTableTimer(new QTimer)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->websocketSessionTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||
@ -25,14 +26,17 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
|
||||
this, &SettingsDialog::EnableAuthenticationCheckBoxChanged);
|
||||
connect(ui->copyPasswordButton, &QPushButton::clicked,
|
||||
this, &SettingsDialog::CopyPasswordButtonClicked);
|
||||
connect(sessionTableTimer, &QTimer::timeout,
|
||||
this, &SettingsDialog::FillSessionTable);
|
||||
}
|
||||
|
||||
SettingsDialog::~SettingsDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete sessionTableTimer;
|
||||
}
|
||||
|
||||
void SettingsDialog::showEvent(QShowEvent* event)
|
||||
void SettingsDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
auto conf = GetConfig();
|
||||
if (!conf) {
|
||||
@ -48,6 +52,14 @@ void SettingsDialog::showEvent(QShowEvent* event)
|
||||
ui->serverPasswordLineEdit->setEnabled(conf->AuthRequired);
|
||||
|
||||
FillSessionTable();
|
||||
|
||||
sessionTableTimer->start(1000);
|
||||
}
|
||||
|
||||
void SettingsDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (sessionTableTimer->isActive())
|
||||
sessionTableTimer->stop();
|
||||
}
|
||||
|
||||
void SettingsDialog::ToggleShowHide()
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QTimer>
|
||||
|
||||
#include "ui_SettingsDialog.h"
|
||||
|
||||
@ -11,16 +12,17 @@ class SettingsDialog : public QDialog
|
||||
public:
|
||||
explicit SettingsDialog(QWidget* parent = 0);
|
||||
~SettingsDialog();
|
||||
void showEvent(QShowEvent* event);
|
||||
void showEvent(QShowEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void ToggleShowHide();
|
||||
|
||||
private Q_SLOTS:
|
||||
void FormAccepted();
|
||||
void EnableAuthenticationCheckBoxChanged();
|
||||
void CopyPasswordButtonClicked();
|
||||
void FillSessionTable();
|
||||
|
||||
private:
|
||||
Ui::SettingsDialog* ui;
|
||||
|
||||
void FillSessionTable();
|
||||
Ui::SettingsDialog *ui;
|
||||
QTimer *sessionTableTimer;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user