Skip to content

Commit

Permalink
allow searching while running
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed Aug 27, 2022
1 parent 2fb8068 commit 69cae86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/qml/CSLOLModsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ ColumnLayout {
}

RowLayout {
enabled: !isBussy
enabled: !isBussy || window.patcherRunning
spacing: cslolModsScrollView.spacing
Layout.fillWidth: true
Layout.margins: cslolModsScrollView.padding
Expand Down
7 changes: 3 additions & 4 deletions src/qml/CSLOLToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ToolBar {
id: cslolToolBar

property bool isBussy: false
property bool patcherRunning: false
property var profilesModel: []
property alias profilesCurrentIndex: profilesComboBox.currentIndex
property alias profilesCurrentName: profilesComboBox.currentText
Expand Down Expand Up @@ -104,15 +103,15 @@ ToolBar {
}
}
ToolButton {
text: patcherRunning ? qsTr("Stop") : qsTr("Run")
text: window.patcherRunning ? qsTr("Stop") : qsTr("Run")
onClicked: {
if (patcherRunning) {
if (window.patcherRunning) {
cslolToolBar.stopProfile()
} else {
cslolToolBar.saveProfileAndRun(true)
}
}
enabled: !isBussy || patcherRunning
enabled: !isBussy || window.patcherRunning
ToolTip {
text: qsTr("Runs patcher for currently selected mods")
visible: parent.hovered
Expand Down
6 changes: 3 additions & 3 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ApplicationWindow {
fileName: "config.ini"
}

property bool patcherRunning: cslolTools.state === CSLOLTools.StateRunning
property bool isBussy: cslolTools.state !== CSLOLTools.StateIdle
property var validName: new RegExp(/[\p{L}\p{M}\p{Z}\p{N}\w]{3,50}/u)
property var validVersion: new RegExp(/([0-9]{1,3})(\.[0-9]{1,3}){0,3}/)
Expand Down Expand Up @@ -85,7 +86,6 @@ ApplicationWindow {
header: CSLOLToolBar {
id: cslolToolBar
isBussy: window.isBussy
patcherRunning: cslolTools.state === CSLOLTools.StateRunning

profilesModel: [ "Default Profile" ]

Expand Down Expand Up @@ -139,9 +139,9 @@ ApplicationWindow {
onTriggered: window.visible ? window.hide() : window.show()
}
MenuItem {
text: cslolToolBar.patcherRunning ? qsTr("Stop") : qsTr("Run")
text: window.patcherRunning ? qsTr("Stop") : qsTr("Run")
onTriggered: {
if (cslolToolBar.patcherRunning) {
if (window.patcherRunning) {
cslolToolBar.stopProfile()
} else if (!window.isBussy) {
cslolToolBar.saveProfileAndRun(true)
Expand Down

0 comments on commit 69cae86

Please sign in to comment.