Add preliminary code for a WiFi dropdown, and a language selector dropdown.
This commit is contained in:
parent
215ba27500
commit
2c5bda9356
@ -2,30 +2,32 @@ cmake_minimum_required(VERSION 3.22)
|
|||||||
|
|
||||||
project(lubuntu-installer-prompt VERSION 1.0.0 LANGUAGES CXX)
|
project(lubuntu-installer-prompt VERSION 1.0.0 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
# Find the required Qt and KDE packages
|
||||||
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_AUTORCC ON)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
find_package(ECM REQUIRED NO_MODULE)
|
find_package(ECM REQUIRED NO_MODULE)
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||||
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Network)
|
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Network)
|
||||||
find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt Notifications)
|
find_package(KF5 REQUIRED COMPONENTS NetworkManagerQt Notifications)
|
||||||
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/src)
|
# 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)
|
||||||
|
|
||||||
|
# Specify project source files
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/src)
|
||||||
file(GLOB PROJECT_SOURCES
|
file(GLOB PROJECT_SOURCES
|
||||||
"${PROJECT_SOURCE_DIR}/src/*.cpp"
|
"${PROJECT_SOURCE_DIR}/src/*.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/*.h"
|
"${PROJECT_SOURCE_DIR}/src/*.h"
|
||||||
"${PROJECT_SOURCE_DIR}/src/*.ui"
|
"${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)
|
target_link_libraries(lubuntu-installer-prompt Qt5::Widgets KF5::NetworkManagerQt KF5::Notifications)
|
||||||
|
|
||||||
install(TARGETS lubuntu-installer-prompt DESTINATION bin)
|
install(TARGETS lubuntu-installer-prompt DESTINATION bin)
|
||||||
|
BIN
img/installer.png
Normal file
BIN
img/installer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
BIN
img/lubuntu-logo.png
Normal file
BIN
img/lubuntu-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
img/symbol.png
Normal file
BIN
img/symbol.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
@ -6,6 +6,7 @@
|
|||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QGraphicsDropShadowEffect>
|
||||||
#include "installerprompt.h"
|
#include "installerprompt.h"
|
||||||
#include "./ui_installerprompt.h"
|
#include "./ui_installerprompt.h"
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ InstallerPrompt::InstallerPrompt(QWidget *parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Set the background image and scale it
|
// Set the background image and scale it
|
||||||
QPixmap bg("/usr/share/lubuntu/installer-prompt/background.png");
|
QPixmap bg(":/background");
|
||||||
if (bg.isNull()) {
|
if (bg.isNull()) {
|
||||||
QMessageBox::warning(this, tr("Error"), tr("Background image cannot be loaded."));
|
QMessageBox::warning(this, tr("Error"), tr("Background image cannot be loaded."));
|
||||||
return;
|
return;
|
||||||
|
@ -21,13 +21,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QWidget {
|
<string notr="true">QWidget {
|
||||||
color: #000000; /* Set text color to black */
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton {
|
QPushButton {
|
||||||
background-color: rgba(30, 144, 255, 0.8);
|
background-color: rgba(30, 144, 255, 0.8);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border: 2px solid #ffffff;
|
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
@ -53,7 +52,14 @@ QComboBox, QLineEdit {
|
|||||||
|
|
||||||
QLabel {
|
QLabel {
|
||||||
qproperty-alignment: 'AlignCenter';
|
qproperty-alignment: 'AlignCenter';
|
||||||
}</string>
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel#logoLabel {
|
||||||
|
image: url(:/logo);
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -107,7 +113,7 @@ QLabel {
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="title">
|
<widget class="QLabel" name="logoLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -117,7 +123,7 @@ QLabel {
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>750</width>
|
<width>750</width>
|
||||||
<height>64</height>
|
<height>100</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="baseSize">
|
<property name="baseSize">
|
||||||
@ -129,7 +135,6 @@ QLabel {
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Ubuntu</family>
|
<family>Ubuntu</family>
|
||||||
<pointsize>25</pointsize>
|
|
||||||
<weight>50</weight>
|
<weight>50</weight>
|
||||||
<italic>false</italic>
|
<italic>false</italic>
|
||||||
<bold>false</bold>
|
<bold>false</bold>
|
||||||
@ -139,15 +144,10 @@ QLabel {
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QLabel {
|
<string notr="true"/>
|
||||||
color : white;
|
|
||||||
font: 25pt "Ubuntu";
|
|
||||||
background-color: rgba(0, 104, 200, 200);
|
|
||||||
border-radius: 15px;
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Lubuntu - Welcome to the Next Universe</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::MarkdownText</enum>
|
<enum>Qt::MarkdownText</enum>
|
||||||
@ -207,7 +207,7 @@ QLabel {
|
|||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>20</pointsize>
|
<pointsize>14</pointsize>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
@ -221,7 +221,7 @@ QLabel {
|
|||||||
<widget class="QComboBox" name="languageComboBox">
|
<widget class="QComboBox" name="languageComboBox">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>352</width>
|
||||||
<height>50</height>
|
<height>50</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -280,13 +280,13 @@ QLabel {
|
|||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>20</pointsize>
|
<pointsize>14</pointsize>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Select a WiFi Network:</string>
|
<string>Select a Wi-Fi Network:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -294,7 +294,7 @@ QLabel {
|
|||||||
<widget class="QComboBox" name="networkComboBox">
|
<widget class="QComboBox" name="networkComboBox">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>352</width>
|
||||||
<height>50</height>
|
<height>50</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -311,18 +311,17 @@ QLabel {
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>100</width>
|
<width>100</width>
|
||||||
<height>50</height>
|
<height>65</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>50</height>
|
<height>65</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>14</pointsize>
|
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
@ -366,7 +365,6 @@ QLabel {
|
|||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>14</pointsize>
|
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
@ -449,20 +447,22 @@ QLabel {
|
|||||||
<widget class="QPushButton" name="tryLubuntu">
|
<widget class="QPushButton" name="tryLubuntu">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>250</width>
|
<width>300</width>
|
||||||
<height>75</height>
|
<height>125</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>75</height>
|
<height>125</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Ubuntu</family>
|
<family>Ubuntu</family>
|
||||||
<pointsize>24</pointsize>
|
<pointsize>24</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -480,7 +480,17 @@ QToolTip {
|
|||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -514,20 +524,22 @@ QToolTip {
|
|||||||
<widget class="QPushButton" name="installLubuntu">
|
<widget class="QPushButton" name="installLubuntu">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>250</width>
|
<width>300</width>
|
||||||
<height>75</height>
|
<height>125</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>75</height>
|
<height>125</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Ubuntu</family>
|
<family>Ubuntu</family>
|
||||||
<pointsize>24</pointsize>
|
<pointsize>24</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -542,7 +554,17 @@ QToolTip {
|
|||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -658,7 +680,9 @@ QToolTip {
|
|||||||
<widget class="QLabel" name="connectionStatusLabel">
|
<widget class="QLabel" name="connectionStatusLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>16</pointsize>
|
<pointsize>18</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -699,6 +723,8 @@ QToolTip {
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="resource.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
19
src/main.cpp
19
src/main.cpp
@ -5,22 +5,21 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QList<InstallerPrompt*> windows;
|
QList<InstallerPrompt*> ws;
|
||||||
|
|
||||||
// Iterate through all available screens
|
// Iterate through all available screens
|
||||||
for (QScreen *screen : QApplication::screens()) {
|
for (QScreen *screen : QApplication::screens()) {
|
||||||
InstallerPrompt *window = new InstallerPrompt();
|
InstallerPrompt *w = new InstallerPrompt();
|
||||||
window->setGeometry(screen->geometry());
|
w->setGeometry(screen->geometry());
|
||||||
window->show();
|
w->show();
|
||||||
windows.append(window);
|
ws.append(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect signals and slots to synchronize state across windows
|
for (InstallerPrompt *w : ws) {
|
||||||
for (InstallerPrompt *window : windows) {
|
for (InstallerPrompt *otherWindow : ws) {
|
||||||
for (InstallerPrompt *otherWindow : windows) {
|
if (w != otherWindow) {
|
||||||
if (window != otherWindow) {
|
|
||||||
// Connect signals and slots for synchronization
|
// Connect signals and slots for synchronization
|
||||||
// Example: connect(window, &InstallerPrompt::someSignal, otherWindow, &InstallerPrompt::someSlot);
|
// Example: connect(ws.last(), &InstallerPrompt::someSignal, otherWindow, &InstallerPrompt::someSlot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
src/resource.qrc
Normal file
8
src/resource.qrc
Normal file
@ -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…
x
Reference in New Issue
Block a user