From 07c2d5971cbc8c4ff5b64e8d26c39113e99edd23 Mon Sep 17 00:00:00 2001 From: SeongGino Date: Wed, 4 Dec 2024 22:02:02 -0500 Subject: [PATCH 1/5] meh --- src/neromanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neromanager.cpp b/src/neromanager.cpp index c7232ad..ce0dad0 100644 --- a/src/neromanager.cpp +++ b/src/neromanager.cpp @@ -878,6 +878,7 @@ void NeroManagerWindow::actionExit_activated() void NeroManagerWindow::on_actionAbout_Nero_triggered() { + // TODO: better about screen pls QString vInfo; #ifdef NERO_VERSION vInfo.append(QString("v%1").arg(NERO_VERSION)); From 4bd49d75967bd0929f3465800d18d5e180074692 Mon Sep 17 00:00:00 2001 From: SeongGino Date: Fri, 6 Dec 2024 13:49:52 -0500 Subject: [PATCH 2/5] Have CMake default to Qt6 only Otherwise, Arch's way of preferring Qt causes issues where it will always use Qt5, regardless of Qt6 presence. Those who want to use Qt5 can use `-DNERO_QT_VERSIONS=Qt5`. --- CMakeLists.txt | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d78c208..a640c75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(Nero-UMU VERSION 0.9 LANGUAGES CXX) +project(Nero-UMU LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) @@ -9,8 +9,12 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools) -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools) +if(NOT NERO_QT_VERSIONS) + set(NERO_QT_VERSIONS Qt6) +endif() + +find_package(QT NAMES ${NERO_QT_VERSIONS} COMPONENTS Widgets LinguistTools REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED) set(TS_FILES translations/Nero-Launcher_en_US.ts) @@ -52,6 +56,7 @@ set(PROJECT_SOURCES src/neroonetimedialog.cpp src/neroonetimedialog.ui ${TS_FILES} + img/pics.qrc ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) @@ -65,26 +70,12 @@ else() find_package(QuaZip-Qt5) add_executable(nero-umu ${PROJECT_SOURCES} - img/pics.qrc ) qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) endif() target_link_libraries(nero-umu PRIVATE Qt${QT_VERSION_MAJOR}::Widgets QuaZip::QuaZip) -# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. -# If you are developing for iOS or macOS you should consider setting an -# explicit, fixed bundle identifier manually though. -if(${QT_VERSION} VERSION_LESS 6.1.0) - set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER xyz.ThatOneSeong.Nero) -endif() -set_target_properties(nero-umu PROPERTIES - ${BUNDLE_ID_OPTION} - MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - MACOSX_BUNDLE TRUE -) - include(GNUInstallDirs) install(TARGETS nero-umu BUNDLE DESTINATION . From eea32c2a307f48a68aa36a39b81ca1091b4f151e Mon Sep 17 00:00:00 2001 From: SeongGino Date: Fri, 6 Dec 2024 13:53:06 -0500 Subject: [PATCH 3/5] Use NeroFS's Prefix List exclusively, avoid using pushbutton text. For whatever reason, somewhere between Qt6.4 and Qt6.8, PushButtons adds a mysterious ampersand `&` - BUT ONLY *AFTER* BEING MADE for some fucking reason - which causes a lot of strangeness. So we just use NeroFS's prefix list only for accessing the names of prefixes, which seems to resolve issues when running on Qt 6.8. Addresses #30 --- src/neromanager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/neromanager.cpp b/src/neromanager.cpp index ce0dad0..7cdc24e 100644 --- a/src/neromanager.cpp +++ b/src/neromanager.cpp @@ -572,17 +572,17 @@ void NeroManagerWindow::prefixMainButtons_clicked() { int slot = sender()->property("slot").toInt(); - if(NeroFS::GetCurrentPrefix() != prefixMainButton.at(slot)->text()) { + if(NeroFS::GetCurrentPrefix() != NeroFS::GetPrefixes().at(slot)) { if(prefixShortcutLabel.count()) CleanupShortcuts(); - NeroFS::SetCurrentPrefix(prefixMainButton.at(slot)->text()); + NeroFS::SetCurrentPrefix(NeroFS::GetPrefixes().at(slot)); RenderPrefixList(); if(!NeroFS::GetAvailableProtons().contains(NeroFS::GetCurrentRunner())) { NeroFS::SetCurrentPrefixCfg("PrefixSettings", "CurrentRunner", NeroFS::GetAvailableProtons().constFirst()); - NeroFS::SetCurrentPrefix(prefixMainButton.at(slot)->text()); + NeroFS::SetCurrentPrefix(NeroFS::GetPrefixes().at(slot)); QMessageBox::warning(this, "Current Runner not found!", "The runner that was assigned to this prefix could not be found in the list of available Proton runners.\n" @@ -605,11 +605,11 @@ void NeroManagerWindow::prefixDeleteButtons_clicked() QString("Are you sure you wish to delete %1?\n\n" "All data inside the prefix will be deleted.\n" "This operation CAN NOT BE UNDONE.") - .arg(prefixMainButton.at(slot)->text()) + .arg(NeroFS::GetPrefixes().at(slot)) ) == QMessageBox::Yes) { - if(NeroFS::DeletePrefix(prefixMainButton.at(slot)->text())) { - if(NeroFS::GetCurrentPrefix() == prefixMainButton.at(slot)->text()) + if(NeroFS::DeletePrefix(NeroFS::GetPrefixes().at(slot))) { + if(NeroFS::GetCurrentPrefix() == NeroFS::GetPrefixes().at(slot)) CleanupShortcuts(); delete prefixMainButton.at(slot); From 39cca97ee1aa4e96854a032680973748938d4457 Mon Sep 17 00:00:00 2001 From: That One Seong Date: Fri, 6 Dec 2024 14:06:34 -0500 Subject: [PATCH 4/5] Update build stuff. Nyeh --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53c7f85..858983d 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,17 @@ Because Nero itself does NOT manage runners--only prefixes--you need at least *o It's highly recommend to use utilities such as *[ProtonUp-Qt](https://github.com/DavidoTek/ProtonUp-Qt)* or *[ProtonPlus](https://github.com/Vysp3r/ProtonPlus)* to install new Steam runners. Nero's been confirmed to build and work on the following: - - Arch Linux (btw), w/ Qt 5.15.16 + - Arch Linux (btw), w/ Qt 5.15.16 & Qt 6.8.1 - Linux Mint 22, Qt 6.4 For Arch users, Nero can be installed from the AUR @ [`nero-umu`](https://aur.archlinux.org/packages/nero-umu) with your favorite helper app. For others, see building steps below (don't worry, it's not that hard!). ## Building Requirements for building Nero from source: - - `Qt5` or `Qt6` - the Base and Network libraries are required. Tested mainly on Qt 5, but should also be compatible up through Qt 6.8 LTS. - - `QuaZip` - Needed for extracting zip archives (mainly the Discord RPC bridge utility). For Qt6, QuaZip additionally requires the Qt5Compat layer. + - `Qt6` - the Base and Network libraries are required. + - If you're building with *Qt 5.x*, add the argument `-DNERO_QT_VERSIONS=Qt5` to the cmake command. + - `QuaZip` - Needed for extracting zip archives (mainly the Discord RPC bridge utility). + - For Qt 6.x, QuaZip additionally requires the Qt5Compat layer. #### Arch ``` From e012fe41169458dce2b7ae3785b3833cc0212ca9 Mon Sep 17 00:00:00 2001 From: SeongGino Date: Fri, 6 Dec 2024 15:05:41 -0500 Subject: [PATCH 5/5] Add proper version+hash appending in about dialog --- CMakeLists.txt | 11 +++++++++++ src/neromanager.cpp | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a640c75..ed2ce02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,17 @@ if(NOT NERO_QT_VERSIONS) set(NERO_QT_VERSIONS Qt6) endif() +option(NERO_VERSION "Sets Nero version number" OFF) +option(NERO_GITHASH "Sets Nero git hash" OFF) + +if(NERO_VERSION) + add_compile_definitions(NERO_VERSION="${NERO_VERSION}") +endif() + +if(NERO_GITHASH) + add_compile_definitions(NERO_GITHASH="${NERO_GITHASH}") +endif() + find_package(QT NAMES ${NERO_QT_VERSIONS} COMPONENTS Widgets LinguistTools REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED) diff --git a/src/neromanager.cpp b/src/neromanager.cpp index 7cdc24e..fd99dda 100644 --- a/src/neromanager.cpp +++ b/src/neromanager.cpp @@ -881,12 +881,12 @@ void NeroManagerWindow::on_actionAbout_Nero_triggered() // TODO: better about screen pls QString vInfo; #ifdef NERO_VERSION - vInfo.append(QString("v%1").arg(NERO_VERSION)); + vInfo.append(" v" + QString(NERO_VERSION)); #endif // NERO_VERSION #ifdef NERO_GITHASH - vInfo.append(QString("-%1").arg(NERO_GITHASH)); + vInfo.append("-" + QString(NERO_GITHASH)); #endif // NERO_GITHASH - vInfo.append("\nRunning on Qt" + + vInfo.append("\nRunning on Qt " + QString::number(QT_VERSION_MAJOR) + '.' + QString::number(QT_VERSION_MINOR) + '.' + QString::number(QT_VERSION_PATCH));