Add preliminary code for a WiFi dropdown, and a language selector dropdown.

pull/2/head
Simon Quigley 3 months ago
parent 215ba27500
commit 2c5bda9356

@ -2,30 +2,32 @@ cmake_minimum_required(VERSION 3.22)
project(lubuntu-installer-prompt VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Find the required Qt and KDE packages
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Network)
find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt Notifications)
set(CMAKE_AUTOUIC ON)
# Set the CMAKE variables for automatic code generation with Qt
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Network)
find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt Notifications)
# Specify project source files
include_directories(${PROJECT_SOURCE_DIR}/src)
file(GLOB PROJECT_SOURCES
"${PROJECT_SOURCE_DIR}/src/*.cpp"
"${PROJECT_SOURCE_DIR}/src/*.h"
"${PROJECT_SOURCE_DIR}/src/*.ui"
)
add_executable(lubuntu-installer-prompt ${PROJECT_SOURCES})
# Add executable target with project source files
add_executable(lubuntu-installer-prompt ${PROJECT_SOURCES} src/resource.qrc)
# Link libraries with the executable target
target_link_libraries(lubuntu-installer-prompt Qt5::Widgets Qt5::Network KF5::NetworkManagerQt KF5::Notifications)
target_link_libraries(lubuntu-installer-prompt Qt5::Widgets KF5::NetworkManagerQt KF5::Notifications)
install(TARGETS lubuntu-installer-prompt DESTINATION bin)

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

@ -6,6 +6,7 @@
#include <QScreen>
#include <QMessageBox>
#include <QLineEdit>
#include <QGraphicsDropShadowEffect>
#include "installerprompt.h"
#include "./ui_installerprompt.h"
@ -15,7 +16,7 @@ InstallerPrompt::InstallerPrompt(QWidget *parent)
ui->setupUi(this);
// Set the background image and scale it
QPixmap bg("/usr/share/lubuntu/installer-prompt/background.png");
QPixmap bg(":/background");
if (bg.isNull()) {
QMessageBox::warning(this, tr("Error"), tr("Background image cannot be loaded."));
return;

@ -21,13 +21,12 @@
</property>
<property name="styleSheet">
<string notr="true">QWidget {
color: #000000; /* Set text color to black */
color: #000000;
}
QPushButton {
background-color: rgba(30, 144, 255, 0.8);
color: #ffffff;
border: 2px solid #ffffff;
border-radius: 15px;
padding: 10px 20px;
margin: 10px;
@ -53,7 +52,14 @@ QComboBox, QLineEdit {
QLabel {
qproperty-alignment: 'AlignCenter';
}</string>
color: #ffffff;
}
QLabel#logoLabel {
image: url(:/logo);
background-color: transparent;
}
</string>
</property>
<widget class="QWidget" name="centralwidget">
<property name="sizePolicy">
@ -107,7 +113,7 @@ QLabel {
</spacer>
</item>
<item>
<widget class="QLabel" name="title">
<widget class="QLabel" name="logoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -117,7 +123,7 @@ QLabel {
<property name="minimumSize">
<size>
<width>750</width>
<height>64</height>
<height>100</height>
</size>
</property>
<property name="baseSize">
@ -129,7 +135,6 @@ QLabel {
<property name="font">
<font>
<family>Ubuntu</family>
<pointsize>25</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
@ -139,15 +144,10 @@ QLabel {
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
color : white;
font: 25pt &quot;Ubuntu&quot;;
background-color: rgba(0, 104, 200, 200);
border-radius: 15px;
}</string>
<string notr="true"/>
</property>
<property name="text">
<string>Lubuntu - Welcome to the Next Universe</string>
<string/>
</property>
<property name="textFormat">
<enum>Qt::MarkdownText</enum>
@ -207,7 +207,7 @@ QLabel {
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>20</pointsize>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -221,7 +221,7 @@ QLabel {
<widget class="QComboBox" name="languageComboBox">
<property name="minimumSize">
<size>
<width>400</width>
<width>352</width>
<height>50</height>
</size>
</property>
@ -280,13 +280,13 @@ QLabel {
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>20</pointsize>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Select a WiFi Network:</string>
<string>Select a Wi-Fi Network:</string>
</property>
</widget>
</item>
@ -294,7 +294,7 @@ QLabel {
<widget class="QComboBox" name="networkComboBox">
<property name="minimumSize">
<size>
<width>400</width>
<width>352</width>
<height>50</height>
</size>
</property>
@ -311,18 +311,17 @@ QLabel {
<property name="minimumSize">
<size>
<width>100</width>
<height>50</height>
<height>65</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
<height>65</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -366,7 +365,6 @@ QLabel {
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -449,20 +447,22 @@ QLabel {
<widget class="QPushButton" name="tryLubuntu">
<property name="minimumSize">
<size>
<width>250</width>
<height>75</height>
<width>300</width>
<height>125</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>75</height>
<height>125</height>
</size>
</property>
<property name="font">
<font>
<family>Ubuntu</family>
<pointsize>24</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
@ -480,7 +480,17 @@ QToolTip {
}</string>
</property>
<property name="text">
<string>Try Lubuntu</string>
<string> Try Lubuntu</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/symbol</normaloff>:/symbol</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
@ -514,20 +524,22 @@ QToolTip {
<widget class="QPushButton" name="installLubuntu">
<property name="minimumSize">
<size>
<width>250</width>
<height>75</height>
<width>300</width>
<height>125</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>75</height>
<height>125</height>
</size>
</property>
<property name="font">
<font>
<family>Ubuntu</family>
<pointsize>24</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
@ -542,7 +554,17 @@ QToolTip {
}</string>
</property>
<property name="text">
<string>Install Lubuntu</string>
<string> Install Lubuntu</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/installer</normaloff>:/installer</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
@ -658,7 +680,9 @@ QToolTip {
<widget class="QLabel" name="connectionStatusLabel">
<property name="font">
<font>
<pointsize>16</pointsize>
<pointsize>18</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
@ -699,6 +723,8 @@ QToolTip {
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>

@ -5,22 +5,21 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QList<InstallerPrompt*> windows;
QList<InstallerPrompt*> ws;
// Iterate through all available screens
for (QScreen *screen : QApplication::screens()) {
InstallerPrompt *window = new InstallerPrompt();
window->setGeometry(screen->geometry());
window->show();
windows.append(window);
InstallerPrompt *w = new InstallerPrompt();
w->setGeometry(screen->geometry());
w->show();
ws.append(w);
}
// Connect signals and slots to synchronize state across windows
for (InstallerPrompt *window : windows) {
for (InstallerPrompt *otherWindow : windows) {
if (window != otherWindow) {
for (InstallerPrompt *w : ws) {
for (InstallerPrompt *otherWindow : ws) {
if (w != otherWindow) {
// Connect signals and slots for synchronization
// Example: connect(window, &InstallerPrompt::someSignal, otherWindow, &InstallerPrompt::someSlot);
// Example: connect(ws.last(), &InstallerPrompt::someSignal, otherWindow, &InstallerPrompt::someSlot);
}
}
}

@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/">
<file alias="logo">../img/lubuntu-logo.png</file>
<file alias="background">../img/background.png</file>
<file alias="installer">../img/installer.png</file>
<file alias="symbol">../img/symbol.png</file>
</qresource>
</RCC>
Loading…
Cancel
Save