Add support for authentication and encryption
This commit is contained in:
committed by
Patrick Nicolas
parent
447b77c35c
commit
c6e773fd22
@@ -138,6 +138,9 @@ main_window::main_window()
|
||||
connect(server_interface, &wivrn_server::supportedCodecsChanged, this, &main_window::on_supported_codecs_changed);
|
||||
connect(server_interface, &wivrn_server::steamCommandChanged, this, &main_window::on_steam_command_changed);
|
||||
|
||||
connect(server_interface, &wivrn_server::pinChanged, this, &main_window::on_pin_changed);
|
||||
on_pin_changed(server_interface->pin());
|
||||
|
||||
connect(ui->button_start, &QPushButton::clicked, this, &main_window::start_server);
|
||||
connect(ui->button_stop, &QPushButton::clicked, this, &main_window::stop_server);
|
||||
connect(ui->button_settings, &QPushButton::clicked, this, &main_window::on_action_settings);
|
||||
@@ -168,6 +171,9 @@ main_window::main_window()
|
||||
ui->banner_capsysnice->hide();
|
||||
#endif
|
||||
|
||||
// TODO implement this
|
||||
ui->button_known_headsets->hide();
|
||||
|
||||
retranslate();
|
||||
}
|
||||
|
||||
@@ -528,6 +534,12 @@ void main_window::on_steam_command_changed(QString value)
|
||||
ui->label_steam_command->setText(value);
|
||||
}
|
||||
|
||||
void main_window::on_pin_changed(QString value)
|
||||
{
|
||||
ui->widget_authentication->setVisible(value != "");
|
||||
ui->label_pin->setText(value);
|
||||
}
|
||||
|
||||
void main_window::on_server_finished(int exit_code, QProcess::ExitStatus status)
|
||||
{
|
||||
qDebug() << "Server exited with code" << exit_code << ", status" << status;
|
||||
|
||||
@@ -100,6 +100,7 @@ private:
|
||||
void on_speaker_changed();
|
||||
void on_supported_codecs_changed(QStringList value);
|
||||
void on_steam_command_changed(QString value);
|
||||
void on_pin_changed(QString value);
|
||||
|
||||
void on_android_device_list_changed(const std::vector<adb::device> &);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<string>WiVRn dashboard</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../wivrn-dashboard.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/images/wivrn.svg</normaloff>:/images/wivrn.svg</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
@@ -79,7 +79,7 @@ border-radius: 5px;
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../wivrn-dashboard.qrc">:/images/wivrn.svg</pixmap>
|
||||
<pixmap>:/images/wivrn.svg</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -136,7 +136,7 @@ border-radius: 5px;
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../wivrn-dashboard.qrc">:/images/wivrn.svg</pixmap>
|
||||
<pixmap>:/images/wivrn.svg</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -178,6 +178,58 @@ border-radius: 5px;
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_authentication" stretch=""/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_authentication" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8" stretch="0,1,0">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PIN:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pin">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">000000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_known_headsets">
|
||||
<property name="text">
|
||||
<string>Known headsets</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -102,6 +102,11 @@ void wivrn_server::on_server_properties_changed(const QString & interface_name,
|
||||
m_jsonConfiguration = changed_properties["JsonConfiguration"].toString();
|
||||
}
|
||||
|
||||
if (changed_properties.contains("Pin"))
|
||||
{
|
||||
pinChanged(m_pin = changed_properties["Pin"].toString());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("RecommendedEyeSize"))
|
||||
{
|
||||
const auto arg = qvariant_cast<QDBusArgument>(changed_properties["RecommendedEyeSize"]);
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
Q_PROPERTY(bool serverRunning READ isServerRunning NOTIFY serverRunningChanged)
|
||||
Q_PROPERTY(bool headsetConnected READ isHeadsetConnected NOTIFY headsetConnectedChanged)
|
||||
Q_PROPERTY(QString jsonConfiguration READ jsonConfiguration WRITE setJsonConfiguration)
|
||||
Q_PROPERTY(QString pin READ pin NOTIFY pinChanged)
|
||||
|
||||
// Headset information, valid only if HeadsetConnected is true
|
||||
Q_PROPERTY(QSize recommendedEyeSize READ recommendedEyeSize NOTIFY recommendedEyeSizeChanged)
|
||||
@@ -83,6 +84,11 @@ public:
|
||||
|
||||
void setJsonConfiguration(QString);
|
||||
|
||||
QString pin() const
|
||||
{
|
||||
return m_pin;
|
||||
}
|
||||
|
||||
QSize recommendedEyeSize() const
|
||||
{
|
||||
return m_recommendedEyeSize;
|
||||
@@ -163,6 +169,8 @@ private:
|
||||
bool m_serverRunning{};
|
||||
bool m_headsetConnected{};
|
||||
QString m_jsonConfiguration{};
|
||||
QString m_pin{};
|
||||
|
||||
QSize m_recommendedEyeSize{};
|
||||
std::vector<float> m_availableRefreshRates{};
|
||||
float m_preferredRefreshRate{};
|
||||
@@ -180,6 +188,7 @@ private:
|
||||
Q_SIGNALS:
|
||||
void serverRunningChanged(bool);
|
||||
void headsetConnectedChanged(bool);
|
||||
void pinChanged(QString);
|
||||
|
||||
void recommendedEyeSizeChanged(QSize);
|
||||
void availableRefreshRatesChanged(const std::vector<float> &);
|
||||
|
||||
@@ -125,6 +125,11 @@ wizard::wizard() :
|
||||
});
|
||||
ui->label_steam_command->setText(server->steamCommand());
|
||||
|
||||
connect(server, &wivrn_server::pinChanged, this, [this](QString value) {
|
||||
ui->label_pin->setText(value);
|
||||
});
|
||||
ui->label_pin->setText(server->pin());
|
||||
|
||||
setPixmap(WatermarkPixmap, QPixmap(":/images/wivrn.svg"));
|
||||
for (const headset & i: headsets_info)
|
||||
{
|
||||
|
||||
@@ -440,6 +440,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Use the following PIN to connect your headset:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pin">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">000000</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
|
||||
Reference in New Issue
Block a user