diff --git a/CMakeLists.txt b/CMakeLists.txt index cdda9d6..b07edaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core Widgets Network LinguistTools) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Network LinguistTools) -find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt Notifications) +find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt WidgetsAddons) set(TS_FILES src/translations/lubuntu-installer-prompt_en_US.ts @@ -44,7 +44,7 @@ add_executable(lubuntu-installer-prompt add_dependencies(lubuntu-installer-prompt translations) -target_link_libraries(lubuntu-installer-prompt PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt5::Network KF5::NetworkManagerQt KF5::Notifications) +target_link_libraries(lubuntu-installer-prompt PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt5::Network KF5::NetworkManagerQt KF5::WidgetsAddons) install(TARGETS lubuntu-installer-prompt BUNDLE DESTINATION . diff --git a/src/installerprompt.cpp b/src/installerprompt.cpp index c17ecb2..08d6473 100644 --- a/src/installerprompt.cpp +++ b/src/installerprompt.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include "installerprompt.h" #include "./ui_installerprompt.h" @@ -79,34 +80,41 @@ InstallerPrompt::InstallerPrompt(QWidget *parent) void InstallerPrompt::updateConnectionStatus() { auto status = NetworkManager::status(); bool online = false; - QString statusText, statusIndicator; + QString statusText; switch (status) { case NetworkManager::Status::Disconnected: case NetworkManager::ConnectedLinkLocal: case NetworkManager::Asleep: statusText = tr("Not Connected"); - statusIndicator = " " + statusText; + ui->connectionLED->setColor(Qt::red); + ui->connectionLED->setState(KLed::Off); break; case NetworkManager::Status::Connected: online = true; statusText = tr("Connected"); - statusIndicator = "🟢 " + statusText; + ui->connectionLED->setColor(Qt::green); + ui->connectionLED->setState(KLed::On); break; case NetworkManager::Status::Connecting: statusText = tr("Connecting..."); - statusIndicator = "🟡 " + statusText; + ui->connectionLED->setColor(Qt::yellow); + ui->connectionLED->setState(KLed::On); break; case NetworkManager::Status::Disconnecting: statusText = tr("Disconnecting..."); - statusIndicator = "🟡 " + statusText; + ui->connectionLED->setColor(Qt::yellow); + ui->connectionLED->setState(KLed::On); break; default: qDebug() << "Unknown status:" << status; statusText = tr("Unknown Status"); - statusIndicator = " " + statusText; + ui->connectionLED->setColor(Qt::gray); + ui->connectionLED->setState(KLed::Off); + break; } - ui->connectionStatusLabel->setText(statusIndicator); + + ui->connectionStatusLabel->setText(statusText); const auto devices = NetworkManager::networkInterfaces(); bool wifiEnabled = false; diff --git a/src/installerprompt.ui b/src/installerprompt.ui index 6f97c9d..3920835 100644 --- a/src/installerprompt.ui +++ b/src/installerprompt.ui @@ -172,7 +172,7 @@ QLabel#incorrectPassword { - + Qt::Vertical @@ -185,35 +185,34 @@ QLabel#incorrectPassword { - - - - - Qt::Horizontal + + + + + + 175 + 65 + - + - 40 - 20 + 175 + 65 - - - - - 18 + 14 75 true - Select Your Language: + ✅ Confirm - + @@ -223,7 +222,7 @@ QLabel#incorrectPassword { - 400 + 550 50 @@ -234,8 +233,39 @@ QLabel#incorrectPassword { - - + + + + true + + + + 16 + 75 + true + + + + You entered an incorrect password. Please try again. + + + + + + + + 18 + 75 + true + + + + Select a Wi-Fi Network: + + + + + Qt::Horizontal @@ -247,63 +277,47 @@ QLabel#incorrectPassword { - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - + - 150 + 175 65 - 150 + 175 65 + 14 75 true - Connect + ✅ Connect - - - - - 75 - true - + + + + Qt::Horizontal - - (For advanced network configuration, select "Try Lubuntu") + + + 40 + 20 + - + - - + + 18 @@ -312,11 +326,11 @@ QLabel#incorrectPassword { - Select a Wi-Fi Network: + Select Your Language: - + Qt::Horizontal @@ -329,46 +343,20 @@ QLabel#incorrectPassword { - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 - + @@ -389,23 +377,32 @@ QLabel#incorrectPassword { - - - - true - + + - 16 75 true - You entered an incorrect password. Please try again. + (For advanced network configuration, select "Try Lubuntu") + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -449,19 +446,6 @@ QLabel#incorrectPassword { - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -479,7 +463,7 @@ QLabel#incorrectPassword { Ubuntu - 24 + 26 75 true @@ -526,19 +510,6 @@ QToolTip { - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -556,7 +527,7 @@ QToolTip { Ubuntu - 24 + 26 75 true @@ -600,19 +571,6 @@ QToolTip { - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -628,19 +586,6 @@ QToolTip { - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -654,19 +599,6 @@ QToolTip { - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -695,17 +627,51 @@ QToolTip { + + + + + 0 + 0 + + + + + 40 + 40 + + + + KLed::On + + + KLed::Circular + + + KLed::Flat + + + 0 + + + + + + 0 + 0 + + - 24 + 26 75 true - Connection Status: + Connected @@ -743,6 +709,13 @@ QToolTip { + + + KLed + QWidget +
kled.h
+
+