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 5, 2024
2 parents a047065 + 6008a7e commit 775ed74
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Nero's been confirmed to build and work on the following:
- Arch Linux (btw), w/ Qt 5.15.16
- 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!).
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:
Expand Down Expand Up @@ -92,6 +92,8 @@ The backend tool that Nero relies on, *umu,* is *allegedly* based around a cooki
## TODOs (to do):
- Add built-in downloader without external curl use ([#12](https://github.com/SeongGino/Nero-umu/issues/12))
- Add `dxvk.conf` configuration dialog in shortcut settings.
- Make process force-shutdown in runner more reliable
- Since umu can't shut down the processes it spawns, Nero invokes a wineboot end command manually in the prefix, but sometimes the process is still running for some reason and needs external process killing)
- Add favorites system
- Add shortcuts list sorting system (currently only does ascending alphabetical)
- Import shortcuts for newly installed applications to prefix Shortcuts list?
Expand Down
16 changes: 8 additions & 8 deletions src/nerofs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ QStringList NeroFS::GetPrefixes()
return prefixes;
}

void NeroFS::CreateUserLinks(QString prefixName)
void NeroFS::CreateUserLinks(const QString &prefixName)
{
QDir prefixDir(NeroFS::GetPrefixesPath().path() + '/' + prefixName);
if(prefixDir.exists()) {
Expand Down Expand Up @@ -221,7 +221,7 @@ QString NeroFS::GetWinetricks(const QString &runner)
}
}

void NeroFS::SetCurrentPrefix(const QString prefix)
void NeroFS::SetCurrentPrefix(const QString &prefix)
{
currentPrefix = prefix;

Expand All @@ -243,7 +243,7 @@ QSettings* NeroFS::GetCurrentPrefixCfg()
}
}

bool NeroFS::SetCurrentPrefixCfg(const QString group, const QString key, const QVariant value)
bool NeroFS::SetCurrentPrefixCfg(const QString &group, const QString &key, const QVariant &value)
{
GetCurrentPrefixCfg();
if(prefixCfg != nullptr) {
Expand Down Expand Up @@ -273,7 +273,7 @@ QMap<QString, QVariant> NeroFS::GetCurrentPrefixSettings()
return settingsMap;
}

void NeroFS::AddNewPrefix(const QString newPrefix, const QString runner)
void NeroFS::AddNewPrefix(const QString &newPrefix, const QString &runner)
{
prefixes.append(newPrefix);
SetCurrentPrefix(newPrefix);
Expand Down Expand Up @@ -310,7 +310,7 @@ void NeroFS::AddNewPrefix(const QString newPrefix, const QString runner)
currentPrefix.clear();
}

void NeroFS::AddNewShortcut(const QString newShortcutHash, const QString newShortcutName, const QString newAppPath) {
void NeroFS::AddNewShortcut(const QString &newShortcutHash, const QString &newShortcutName, const QString &newAppPath) {
SetCurrentPrefixCfg("Shortcuts", newShortcutHash, newShortcutName);
SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "Name", newShortcutName);
SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "Path", newAppPath);
Expand Down Expand Up @@ -343,7 +343,7 @@ void NeroFS::AddNewShortcut(const QString newShortcutHash, const QString newShor
SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "PostRunScript", {""});
}

QMap<QString, QVariant> NeroFS::GetShortcutSettings(const QString shortcutHash)
QMap<QString, QVariant> NeroFS::GetShortcutSettings(const QString &shortcutHash)
{
GetCurrentPrefixCfg();
if(!prefixCfg->group().isEmpty()) prefixCfg->endGroup();
Expand Down Expand Up @@ -395,15 +395,15 @@ QMap<QString, QString> NeroFS::GetCurrentShortcutsMap()
return shortcutsMap;
}

bool NeroFS::DeletePrefix(const QString prefix)
bool NeroFS::DeletePrefix(const QString &prefix)
{
prefixes.removeOne(prefix);
if(QDir(prefixesPath.path() + '/' + prefix).removeRecursively())
return true;
else return false;
}

void NeroFS::DeleteShortcut(const QString shortcutHash)
void NeroFS::DeleteShortcut(const QString &shortcutHash)
{
GetCurrentPrefixCfg();
if(!prefixCfg->group().isEmpty()) prefixCfg->endGroup();
Expand Down
18 changes: 9 additions & 9 deletions src/nerofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ class NeroFS
static QStringList GetCurrentPrefixShortcuts();
static QMap<QString, QVariant> GetCurrentPrefixSettings();
static QMap<QString, QString> GetCurrentShortcutsMap();
static QMap<QString, QVariant> GetShortcutSettings(const QString);
static QMap<QString, QVariant> GetShortcutSettings(const QString &);
static QSettings GetManagerCfg() { return QSettings(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/Nero-UMU.ini", QSettings::IniFormat); }
static void CreateUserLinks(const QString);
static void AddNewPrefix(const QString, const QString);
static void AddNewShortcut(const QString, const QString, const QString);
static bool DeletePrefix(const QString);
static void DeleteShortcut(const QString);
static void CreateUserLinks(const QString &);
static void AddNewPrefix(const QString &, const QString &);
static void AddNewShortcut(const QString &, const QString &, const QString &);
static bool DeletePrefix(const QString &);
static void DeleteShortcut(const QString &);

static QSettings* GetCurrentPrefixCfg();

Expand All @@ -70,9 +70,9 @@ class NeroFS
static QString GetUmU();
static QString GetWinetricks(const QString & = "");

static void SetCurrentPrefix(const QString);
static bool SetCurrentPrefixCfg(const QString, const QString, const QVariant);
static void AddNewShortcutSetting(const QString shortcutHash, const QString key, const QVariant value) {
static void SetCurrentPrefix(const QString &);
static bool SetCurrentPrefixCfg(const QString &, const QString &, const QVariant &);
static void AddNewShortcutSetting(const QString &shortcutHash, const QString &key, const QVariant &value) {
SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(shortcutHash), key, value);
}
};
Expand Down
14 changes: 6 additions & 8 deletions src/neromanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <QFileDialog>
#include <QProcess>
#include <QTimer>
#include <QWindow>

NeroManagerWindow::NeroManagerWindow(QWidget *parent)
: QMainWindow(parent)
Expand Down Expand Up @@ -267,7 +266,7 @@ void NeroManagerWindow::RenderPrefixList()
}
}

void NeroManagerWindow::CreatePrefix(const QString newPrefix, const QString runner, QStringList tricksToInstall)
void NeroManagerWindow::CreatePrefix(const QString &newPrefix, const QString &runner, QStringList tricksToInstall)
{
QProcess umu;
QMessageBox waitBox(QMessageBox::NoIcon,
Expand All @@ -282,7 +281,7 @@ void NeroManagerWindow::CreatePrefix(const QString newPrefix, const QString runn
env.insert("WINEPREFIX", NeroFS::GetPrefixesPath().path() + '/' + newPrefix);
env.insert("GAMEID", "0");
env.insert("PROTONPATH", NeroFS::GetProtonsPath().path() + '/' + runner);
env.insert("UMU_RUNTIME_UPDATE", "0");
//env.insert("UMU_RUNTIME_UPDATE", "0");
umu.setProcessEnvironment(env);
umu.setProcessChannelMode(QProcess::MergedChannels);

Expand Down Expand Up @@ -393,7 +392,7 @@ void NeroManagerWindow::CheckWinetricks()
}
}

void NeroManagerWindow::AddTricks(QStringList verbs, const QString prefix)
void NeroManagerWindow::AddTricks(QStringList verbs, const QString &prefix)
{
QProcess umu;
QMessageBox waitBox(QMessageBox::NoIcon,
Expand All @@ -407,14 +406,13 @@ void NeroManagerWindow::AddTricks(QStringList verbs, const QString prefix)

QMap<QString, QVariant> settingsMap = NeroFS::GetCurrentPrefixSettings();

env.insert("WINEPREFIX", QString("%1/%2").arg(NeroFS::GetPrefixesPath().path(), prefix));
env.insert("WINEPREFIX", NeroFS::GetPrefixesPath().path() + '/' + prefix);
env.insert("GAMEID", "0");
env.insert("PROTONPATH", QString("%1/%2").arg(NeroFS::GetProtonsPath().path(), settingsMap["CurrentRunner"].toString()));
env.insert("UMU_RUNTIME_UPDATE", "0");
env.insert("PROTONPATH", NeroFS::GetProtonsPath().path() + '/' + settingsMap["CurrentRunner"].toString());
//env.insert("UMU_RUNTIME_UPDATE", "0");
umu.setProcessEnvironment(env);
umu.setProcessChannelMode(QProcess::MergedChannels);


verbs.prepend("winetricks");
umu.start(NeroFS::GetUmU(), verbs);
verbs.removeFirst();
Expand Down
4 changes: 2 additions & 2 deletions src/neromanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ private slots:
void CheckWinetricks();
void RenderPrefixes();
void RenderPrefixList();
void CreatePrefix(const QString newPrefix, const QString runner, QStringList tricksToInstall = {});
void AddTricks(QStringList verbs, const QString prefix);
void CreatePrefix(const QString &, const QString &, QStringList tricksToInstall = {});
void AddTricks(QStringList, const QString &);
void RenderShortcuts();
void CleanupShortcuts();
void StartBlinkTimer();
Expand Down

0 comments on commit 775ed74

Please sign in to comment.