Sync state with kubuntu-installer-prompt, add open WiFi support

ubuntu/noble ubuntu/24.04.2
Aaron Rainbolt 8 months ago
parent 352376a8d9
commit 0174e9622b

10
debian/changelog vendored

@ -1,3 +1,13 @@
lubuntu-installer-prompt (24.04.2) noble; urgency=medium
* Remove a spurious d/source/options file resulting in the whole Git repo
being uploaded with the source package.
* Don't start the prompt using sudo, it's unnecessary and results in odd
permissions issues.
* Add support for open WiFi networks. (LP: #2056603)
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Fri, 08 Mar 2024 23:49:22 +0000
lubuntu-installer-prompt (24.04.1) noble; urgency=medium
* Switch to native packaging.

@ -1 +0,0 @@
tar-ignore=.gitignore

@ -12,7 +12,7 @@ export QT_QPA_PLATFORMTHEME="lxqt"
openbox &
picom &
sudo -E lubuntu-installer-prompt # This is intentionally *not* backgrounded.
lubuntu-installer-prompt # This is intentionally *not* backgrounded.
# If it exits...
killall picom
killall openbox

@ -190,9 +190,21 @@ void InstallerPrompt::onNetworkSelected(int index)
}
} else { // this is a Wifi connection
wifiSsid = networkId.right(networkId.length() - 4);
bool isPasswordProtected = true;
for (const auto &network : wifiDevice->networks()) {
if (network->ssid() == wifiSsid) {
NetworkManager::AccessPoint::Ptr ap = network->referenceAccessPoint();
if (!ap->capabilities().testFlag(NetworkManager::AccessPoint::Privacy)) {
isPasswordProtected = false;
}
}
}
QDBusPendingReply reply = wifiDevice->disconnectInterface();
reply.waitForFinished();
NetworkManager::Connection::Ptr targetConnection;
foreach (const NetworkManager::Connection::Ptr &connection, NetworkManager::listConnections()) {
if (connection->settings()->connectionType() == NetworkManager::ConnectionSettings::Wireless) {
auto wirelessSetting = connection->settings()->setting(NetworkManager::Setting::Wireless).dynamicCast<NetworkManager::WirelessSetting>();
@ -201,17 +213,11 @@ void InstallerPrompt::onNetworkSelected(int index)
}
}
}
if (targetConnection) {
NetworkManager::activateConnection(targetConnection->path(), wifiDevice->uni(), QString());
cpd->setNetworkName(wifiSsid);
} else {
WifiPasswordDialog wpd(wifiSsid);
wpd.exec();
QString password = wpd.getPassword();
if (password.isEmpty()) {
return;
}
NMVariantMapMap wifiSettings;
if (!wifiDevice) {
qWarning() << "WiFi device not found. Unable to set interface name.";
@ -230,10 +236,18 @@ void InstallerPrompt::onNetworkSelected(int index)
wifiSettings.insert(key, value.toMap());
}
QVariantMap wirelessSecurity;
wirelessSecurity["key-mgmt"] = "wpa-psk";
wirelessSecurity["psk"] = password;
wifiSettings["802-11-wireless-security"] = wirelessSecurity;
if (isPasswordProtected) {
WifiPasswordDialog wpd(wifiSsid);
wpd.exec();
QString password = wpd.getPassword();
if (password.isEmpty()) {
return;
}
QVariantMap wirelessSecurity;
wirelessSecurity["key-mgmt"] = "wpa-psk";
wirelessSecurity["psk"] = password;
wifiSettings["802-11-wireless-security"] = wirelessSecurity;
}
QDBusPendingReply<QDBusObjectPath> reply = NetworkManager::addConnection(wifiSettings);
reply.waitForFinished();

Loading…
Cancel
Save