Port back to Qt 5.

To be consistent in app launching, port back to Qt 5. Also, bump the C++ standard to 23, well, just because, and make the installer prompt display on both monitors, instead of just one.
pull/2/head
Simon Quigley 1 year ago
parent c2ac6af2d9
commit ca33c24096

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22) cmake_minimum_required(VERSION 3.22)
project(lubuntu-installer-prompt VERSION 0.3.0 LANGUAGES CXX) project(lubuntu-installer-prompt VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -8,10 +8,10 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets) find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
include_directories(${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_SOURCE_DIR}/src)
@ -21,14 +21,9 @@ file(GLOB PROJECT_SOURCES
"${PROJECT_SOURCE_DIR}/src/*.ui" "${PROJECT_SOURCE_DIR}/src/*.ui"
) )
qt_add_executable(lubuntu-installer-prompt add_executable(lubuntu-installer-prompt ${PROJECT_SOURCES})
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
target_link_libraries(lubuntu-installer-prompt PRIVATE Qt6::Widgets)
qt_finalize_executable(lubuntu-installer-prompt) target_link_libraries(lubuntu-installer-prompt Qt5::Widgets)
install(TARGETS lubuntu-installer-prompt DESTINATION bin) install(TARGETS lubuntu-installer-prompt DESTINATION bin)
install(PROGRAMS "scripts/lubuntu-installer" DESTINATION libexec) install(PROGRAMS "scripts/lubuntu-installer" DESTINATION libexec)

@ -44,10 +44,12 @@ void InstallerPrompt::installLubuntu()
ui->tryLubuntu->setVisible(false); ui->tryLubuntu->setVisible(false);
ui->installLubuntu->setVisible(false); ui->installLubuntu->setVisible(false);
QProcess *calamares = new QProcess(this); QProcess *calamares = new QProcess(this);
calamares->start("/usr/libexec/lubuntu-installer"); QStringList args;
calamares->start("/usr/libexec/lubuntu-installer", args);
// If Calamares exits, it either crashed or the user cancelled the installation. Exit the installer prompt (and start LXQt). // If Calamares exits, it either crashed or the user cancelled the installation. Exit the installer prompt (and start LXQt).
connect(calamares, &QProcess::finished, this, &InstallerPrompt::tryLubuntu); connect(calamares, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, [this](int, QProcess::ExitStatus){ this->tryLubuntu(); });
} }
InstallerPrompt::~InstallerPrompt() InstallerPrompt::~InstallerPrompt()

@ -1,11 +1,29 @@
#include "installerprompt.h" #include "installerprompt.h"
#include <QApplication> #include <QApplication>
#include <QScreen>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication app(argc, argv);
InstallerPrompt w; QList<InstallerPrompt*> windows;
w.showFullScreen();
return a.exec(); // Iterate through all available screens
for (QScreen *screen : QApplication::screens()) {
InstallerPrompt *window = new InstallerPrompt();
window->setGeometry(screen->geometry());
window->show();
windows.append(window);
}
// Connect signals and slots to synchronize state across windows
for (InstallerPrompt *window : windows) {
for (InstallerPrompt *otherWindow : windows) {
if (window != otherWindow) {
// Connect signals and slots for synchronization
// Example: connect(window, &InstallerPrompt::someSignal, otherWindow, &InstallerPrompt::someSlot);
}
}
}
return app.exec();
} }

Loading…
Cancel
Save