Skip to content

Commit

Permalink
make league auto-detecting optional
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed Jul 21, 2023
1 parent 7052de3 commit 431d65e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CSLOLToolsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void CSLOLToolsImpl::doReportError(QString name, QString message, QString trace)
logFile_->write(trace.toUtf8() + "\n");
}
if (message.contains("OpenProcess: ") || trace.contains("OpenProcess: ")) {
QFile file(prog_ + "/admin_allow.txt");
QFile file(prog_ + "/admin_allowed.txt");
file.open(QIODevice::WriteOnly);
file.close();
trace += '\n';
Expand Down
2 changes: 1 addition & 1 deletion src/CSLOLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ QString CSLOLUtils::detectGamePath() {

bool CSLOLUtils::isUnnecessaryAdmin() {
return false;
if (QFileInfo info(QCoreApplication::applicationDirPath() + "/admin_allow.txt"); info.exists()) {
if (QFileInfo info(QCoreApplication::applicationDirPath() + "/admin_allowed.txt"); info.exists()) {
return false;
}
bool result = 0;
Expand Down
7 changes: 7 additions & 0 deletions src/qml/CSLOLDialogSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Dialog {
}

property bool isBussy: false
property alias detectGamePath: detectGamePathCheck.checked
property alias blacklist: blacklistCheck.checked
property alias ignorebad: ignorebadCheck.checked
property alias enableUpdates: enableUpdatesCheck.checkState
Expand Down Expand Up @@ -90,6 +91,12 @@ Dialog {
onClicked: cslolDialogSettings.changeGamePath()
Layout.fillWidth: true
}
Switch {
id: detectGamePathCheck
text: qsTr("Automatically detect game path")
checked: true
Layout.fillWidth: true
}
Switch {
id: blacklistCheck
text: qsTr("Blacklist extra gamemods")
Expand Down
3 changes: 2 additions & 1 deletion src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ApplicationWindow {
id: settings
property alias leaguePath: cslolTools.leaguePath

property alias detectGamePath: cslolDialogSettings.detectGamePath
property alias blacklist: cslolDialogSettings.blacklist
property alias ignorebad: cslolDialogSettings.ignorebad
property alias suppressInstallConflicts: cslolDialogSettings.suppressInstallConflicts
Expand Down Expand Up @@ -55,7 +56,7 @@ ApplicationWindow {
}

function checkGamePath() {
let detected = CSLOLUtils.detectGamePath();
let detected = settings.detectGamePath ? CSLOLUtils.detectGamePath() : "";
if (detected === "" && cslolTools.leaguePath === "") {
cslolDialogGame.open();
return false;
Expand Down

0 comments on commit 431d65e

Please sign in to comment.