Skip to content

Commit

Permalink
Merge branch 'main' into cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongGino committed Dec 6, 2024
2 parents 775ed74 + e012fe4 commit b873762
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
36 changes: 19 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -9,8 +9,23 @@ 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()

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)

set(TS_FILES translations/Nero-Launcher_en_US.ts)

Expand Down Expand Up @@ -52,6 +67,7 @@ set(PROJECT_SOURCES
src/neroonetimedialog.cpp
src/neroonetimedialog.ui
${TS_FILES}
img/pics.qrc
)

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
Expand All @@ -65,26 +81,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 .
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
19 changes: 10 additions & 9 deletions src/neromanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);
Expand Down Expand Up @@ -878,14 +878,15 @@ 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));
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));
Expand Down

0 comments on commit b873762

Please sign in to comment.