|
|
|
@ -64,7 +64,7 @@ InstallerPrompt::InstallerPrompt(QWidget *parent)
|
|
|
|
|
// Set up signal-slot connections for buttons
|
|
|
|
|
connect(ui->tryLubuntu, &QAbstractButton::clicked, this, &InstallerPrompt::tryLubuntu);
|
|
|
|
|
connect(ui->installLubuntu, &QAbstractButton::clicked, this, &InstallerPrompt::installLubuntu);
|
|
|
|
|
connect(ui->connectWiFiButton, &QAbstractButton::clicked, this, &InstallerPrompt::onConnectWifiClicked);
|
|
|
|
|
connect(ui->connectWifiButton, &QAbstractButton::clicked, this, &InstallerPrompt::onConnectWifiClicked);
|
|
|
|
|
connect(ui->confirmButton, &QAbstractButton::clicked, this, &InstallerPrompt::onLanguageConfirm);
|
|
|
|
|
|
|
|
|
|
// Set up the language combo box with available languages
|
|
|
|
@ -80,7 +80,7 @@ InstallerPrompt::InstallerPrompt(QWidget *parent)
|
|
|
|
|
foreach (const NetworkManager::Device::Ptr &device, NetworkManager::networkInterfaces()) {
|
|
|
|
|
if (device->type() == NetworkManager::Device::Wifi) {
|
|
|
|
|
wifiDevice = device.objectCast<NetworkManager::WirelessDevice>();
|
|
|
|
|
connect(wifiDevice.data(), &NetworkManager::Device::stateChanged, this, &InstallerPrompt::handleWiFiConnectionChange);
|
|
|
|
|
connect(wifiDevice.data(), &NetworkManager::Device::stateChanged, this, &InstallerPrompt::handleWifiConnectionChange);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -146,14 +146,14 @@ void InstallerPrompt::updateConnectionStatus() {
|
|
|
|
|
bool connectable = !online && wifiEnabled;
|
|
|
|
|
if (connectable) refreshNetworkList();
|
|
|
|
|
|
|
|
|
|
ui->connectWiFiButton->setVisible(connectable);
|
|
|
|
|
ui->WiFiLabel->setVisible(connectable);
|
|
|
|
|
ui->connectWifiButton->setVisible(connectable);
|
|
|
|
|
ui->wifiLabel->setVisible(connectable);
|
|
|
|
|
ui->networkComboBox->setVisible(connectable);
|
|
|
|
|
ui->WiFiInfoLabel->setVisible(connectable);
|
|
|
|
|
ui->WiFiSpacer->changeSize(connectable ? 40 : 0, connectable ? 20 : 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
|
|
|
ui->wifiInfoLabel->setVisible(connectable);
|
|
|
|
|
ui->wifiSpacer->changeSize(connectable ? 40 : 0, connectable ? 20 : 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void InstallerPrompt::handleWiFiConnectionChange(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason)
|
|
|
|
|
void InstallerPrompt::handleWifiConnectionChange(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason)
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker locker(&wifiChangeMutex);
|
|
|
|
|
if (reason == NetworkManager::Device::NoSecretsReason && !wifiWrongHandling) {
|
|
|
|
@ -327,7 +327,7 @@ void InstallerPrompt::showWifiOptions() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!foundWifiDevice) {
|
|
|
|
|
QMessageBox::information(this, tr("WiFi Not Available"), tr("No WiFi devices were found on this system."));
|
|
|
|
|
QMessageBox::information(this, tr("Wi-Fi Not Available"), tr("No Wi-Fi devices were found on this system."));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -346,7 +346,7 @@ void InstallerPrompt::refreshNetworkList() {
|
|
|
|
|
if (!wirelessDevice) {
|
|
|
|
|
// No wireless device found, handle appropriately
|
|
|
|
|
ui->networkComboBox->setVisible(false);
|
|
|
|
|
ui->connectWiFiButton->setVisible(false);
|
|
|
|
|
ui->connectWifiButton->setVisible(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -366,7 +366,7 @@ void InstallerPrompt::refreshNetworkList() {
|
|
|
|
|
|
|
|
|
|
// Adjust visibility
|
|
|
|
|
ui->networkComboBox->setVisible(!networks.isEmpty());
|
|
|
|
|
ui->connectWiFiButton->setVisible(!networks.isEmpty());
|
|
|
|
|
ui->connectWifiButton->setVisible(!networks.isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString InstallerPrompt::getDisplayNameForLocale(const QLocale &locale) {
|
|
|
|
|