Complete wifi setup / Add Hotspot setup

This commit is contained in:
hawkeyexp 2018-08-06 01:18:25 +02:00
parent ac5b130e3b
commit bf69ef7e8a
2 changed files with 265 additions and 119 deletions

View File

@ -185,6 +185,14 @@ void SettingsWindow::onSave()
params.append("#"); params.append("#");
params.append( std::string(ui_->lineEditWifiClientPassword->text().toStdString()) ); params.append( std::string(ui_->lineEditWifiClientPassword->text().toStdString()) );
params.append("#"); params.append("#");
if (ui_->checkBoxHotspot->isChecked()) {
params.append("1");
} else {
params.append("0");
}
params.append("#");
params.append( std::string(ui_->lineEditWifiHotspotPassword->text().toStdString()) );
params.append("#");
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str()); system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
this->close(); this->close();
} }
@ -553,6 +561,16 @@ void SettingsWindow::loadSystemValues()
// Wifi Credentials // Wifi Credentials
ui_->lineEditWifiClientSSID->setText(getparams[30]); ui_->lineEditWifiClientSSID->setText(getparams[30]);
ui_->lineEditWifiClientPassword->setText(getparams[31]); ui_->lineEditWifiClientPassword->setText(getparams[31]);
// Wifi Hotspot Credentials
if (getparams[32] == "1") {
ui_->checkBoxHotspot->setChecked(true);
} else {
ui_->checkBoxHotspot->setChecked(false);
}
ui_->lineEditWifiHotspotSSID->setText(getparams[33]);
ui_->lineEditWifiHotspotPassword->setText(getparams[34]);
} }
} }

View File

@ -615,8 +615,8 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>80</x>
<y>30</y> <y>36</y>
<width>471</width> <width>531</width>
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
@ -628,7 +628,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
<y>30</y> <y>36</y>
<width>61</width> <width>61</width>
<height>30</height> <height>30</height>
</rect> </rect>
@ -641,8 +641,8 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>80</x>
<y>70</y> <y>76</y>
<width>471</width> <width>531</width>
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
@ -654,7 +654,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
<y>70</y> <y>76</y>
<width>61</width> <width>61</width>
<height>30</height> <height>30</height>
</rect> </rect>
@ -667,8 +667,8 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>80</x>
<y>106</y> <y>114</y>
<width>471</width> <width>561</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -678,7 +678,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>To activate changed audio device you have to save settings and disconnect / reconnect phone!</string> <string>To activate changed audio device you have to save settings and reconnect phone!</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -691,7 +691,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
<y>108</y> <y>116</y>
<width>31</width> <width>31</width>
<height>31</height> <height>31</height>
</rect> </rect>
@ -1094,7 +1094,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tabBluetooth"> <widget class="QWidget" name="tabWireless">
<attribute name="title"> <attribute name="title">
<string>Wireless</string> <string>Wireless</string>
</attribute> </attribute>
@ -1228,6 +1228,11 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text"> <property name="text">
<string>In order to use bluetooth features please remember to pair your device.</string> <string>In order to use bluetooth features please remember to pair your device.</string>
</property> </property>
@ -1248,9 +1253,9 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<widget class="QLineEdit" name="lineEditWifiClientPassword"> <widget class="QLineEdit" name="lineEditWifiClientPassword">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>410</x> <x>390</x>
<y>30</y> <y>30</y>
<width>231</width> <width>251</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -1267,7 +1272,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<widget class="QLabel" name="labelWifiClientPassword"> <widget class="QLabel" name="labelWifiClientPassword">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>330</x> <x>310</x>
<y>30</y> <y>30</y>
<width>71</width> <width>71</width>
<height>31</height> <height>31</height>
@ -1299,6 +1304,11 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text"> <property name="text">
<string>The wifi connection is only available in dev mode or debug mode!</string> <string>The wifi connection is only available in dev mode or debug mode!</string>
</property> </property>
@ -1308,7 +1318,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<rect> <rect>
<x>90</x> <x>90</x>
<y>30</y> <y>30</y>
<width>231</width> <width>200</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -1327,8 +1337,126 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxWifiHotspot">
<property name="geometry">
<rect>
<x>0</x>
<y>310</y>
<width>646</width>
<height>141</height>
</rect>
</property>
<property name="title">
<string>Hotspot settings</string>
</property>
<widget class="QLineEdit" name="lineEditWifiHotspotPassword">
<property name="geometry">
<rect>
<x>390</x>
<y>60</y>
<width>251</width>
<height>31</height>
</rect>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="echoMode">
<enum>QLineEdit::Normal</enum>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="labelWifiHotspotPassword">
<property name="geometry">
<rect>
<x>310</x>
<y>60</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
<widget class="QLabel" name="labelUseWarningIcon_2">
<property name="geometry">
<rect>
<x>50</x>
<y>100</y>
<width>31</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_warning.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="labelUseWarning_2">
<property name="geometry">
<rect>
<x>90</x>
<y>100</y>
<width>481</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>The hotspot is only available in dev mode and overrides client mode!</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEditWifiHotspotSSID">
<property name="geometry">
<rect>
<x>90</x>
<y>60</y>
<width>200</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="labelWifiHotspotSSID">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>SSID:</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxHotspot">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>141</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Enable Hotspot</string>
</property>
</widget>
</widget>
</widget> </widget>
<widget class="QWidget" name="tabCrankshaftNG"> <widget class="QWidget" name="tabCSBase">
<attribute name="title"> <attribute name="title">
<string>CS Base</string> <string>CS Base</string>
</attribute> </attribute>
@ -1338,7 +1466,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<x>0</x> <x>0</x>
<y>10</y> <y>10</y>
<width>646</width> <width>646</width>
<height>91</height> <height>111</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -1374,7 +1502,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>60</y> <y>66</y>
<width>80</width> <width>80</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -1387,7 +1515,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>90</x> <x>90</x>
<y>64</y> <y>70</y>
<width>80</width> <width>80</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -1426,7 +1554,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>200</x> <x>200</x>
<y>60</y> <y>66</y>
<width>110</width> <width>110</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -1439,7 +1567,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>310</x> <x>310</x>
<y>64</y> <y>70</y>
<width>80</width> <width>80</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -1641,7 +1769,7 @@ subcontrol-position: center left;
<widget class="QCheckBox" name="checkBoxDisableShutdown"> <widget class="QCheckBox" name="checkBoxDisableShutdown">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>540</x> <x>550</x>
<y>40</y> <y>40</y>
<width>71</width> <width>71</width>
<height>23</height> <height>23</height>
@ -1654,7 +1782,7 @@ subcontrol-position: center left;
<widget class="QCheckBox" name="checkBoxDisableScreenOff"> <widget class="QCheckBox" name="checkBoxDisableScreenOff">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>540</x> <x>550</x>
<y>84</y> <y>84</y>
<width>71</width> <width>71</width>
<height>23</height> <height>23</height>
@ -1669,9 +1797,9 @@ subcontrol-position: center left;
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>110</y> <y>130</y>
<width>311</width> <width>311</width>
<height>91</height> <height>71</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -1707,82 +1835,6 @@ subcontrol-position: center left;
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxDebugmode">
<property name="geometry">
<rect>
<x>320</x>
<y>110</y>
<width>326</width>
<height>91</height>
</rect>
</property>
<property name="title">
<string>Debugmode</string>
</property>
<widget class="QRadioButton" name="radioButtonDebugmodeEnabled">
<property name="geometry">
<rect>
<x>120</x>
<y>30</y>
<width>120</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButtonDebugmodeDisabled">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Disabled</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="labelDebugmodeInfoIcon">
<property name="geometry">
<rect>
<x>10</x>
<y>56</y>
<width>21</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_info.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="labelDebugmodeNote">
<property name="geometry">
<rect>
<x>40</x>
<y>60</y>
<width>241</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Debud Mode overrides dev mode!</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBoxDayNight"> <widget class="QGroupBox" name="groupBoxDayNight">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -1951,8 +2003,50 @@ subcontrol-position: center left;
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;&lt;img src=&quot;:/ico_warning.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;&lt;img src=&quot;:/ico_warning.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxStartMode">
<property name="geometry">
<rect>
<x>320</x>
<y>130</y>
<width>326</width>
<height>71</height>
</rect>
</property>
<property name="title">
<string>Start Mode Openauto</string>
</property>
<widget class="QRadioButton" name="radioButtonX11">
<property name="geometry">
<rect>
<x>120</x>
<y>30</y>
<width>81</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>X11</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButtonEGL">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>81</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>EGL</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</widget>
</widget> </widget>
<widget class="QWidget" name="tabGPIO"> <widget class="QWidget" name="tabCSEnv">
<attribute name="title"> <attribute name="title">
<string>CS Env</string> <string>CS Env</string>
</attribute> </attribute>
@ -2675,13 +2769,13 @@ subcontrol-position: center left;
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;&lt;img src=&quot;:/ico_warning.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;&lt;img src=&quot;:/ico_warning.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxFrameRate_2"> <widget class="QGroupBox" name="groupBoxBrightnessCommand">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>230</x> <x>325</x>
<y>250</y> <y>250</y>
<width>416</width> <width>321</width>
<height>61</height> <height>91</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -3093,50 +3187,84 @@ subcontrol-position: center left;
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxStartMode"> <widget class="QGroupBox" name="groupBoxDebugmode">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>250</y> <y>250</y>
<width>221</width> <width>321</width>
<height>61</height> <height>91</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
<string>Start Mode Openauto</string> <string>Debugmode</string>
</property> </property>
<widget class="QRadioButton" name="radioButtonX11"> <widget class="QRadioButton" name="radioButtonDebugmodeEnabled">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>120</x> <x>120</x>
<y>30</y> <y>30</y>
<width>81</width> <width>120</width>
<height>23</height> <height>23</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>X11</string> <string>Enabled</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" name="radioButtonEGL"> <widget class="QRadioButton" name="radioButtonDebugmodeDisabled">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>30</y> <y>30</y>
<width>81</width> <width>80</width>
<height>23</height> <height>23</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>EGL</string> <string>Disabled</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="labelDebugmodeInfoIcon">
<property name="geometry">
<rect>
<x>10</x>
<y>56</y>
<width>21</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_info.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="labelDebugmodeNote">
<property name="geometry">
<rect>
<x>40</x>
<y>60</y>
<width>241</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Debud Mode overrides dev mode!</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tabCSHW">
<attribute name="title"> <attribute name="title">
<string>CS HW</string> <string>CS HW</string>
</attribute> </attribute>
@ -3352,7 +3480,7 @@ subcontrol-position: center left;
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="labelHardwareRTC_2"> <widget class="QLabel" name="labelHardwareTZ">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -3403,7 +3531,7 @@ subcontrol-position: center left;
<rect> <rect>
<x>2</x> <x>2</x>
<y>425</y> <y>425</y>
<width>646</width> <width>644</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>