Add watcher for .show file in config directory

Draw attention when the .show file is created.
It is created when attempting to open another
instance of Mirage with the same configuration.
This commit is contained in:
vslg
2020-09-04 17:26:01 -03:00
parent 56ad0b9975
commit 9ee4b14aa2
2 changed files with 32 additions and 11 deletions

View File

@@ -3,6 +3,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import Qt.labs.platform 1.1
import Qt.labs.folderlistmodel 2.12
import "Base"
import "PythonBridge"
@@ -23,7 +24,7 @@ ApplicationWindow {
property var uiState: ({})
property var history: ({})
property var theme: null
property bool closing: false
property string configDir
readonly property var visibleMenus: ({})
readonly property var visiblePopups: ({})
@@ -142,4 +143,21 @@ ApplicationWindow {
}
}
}
FolderListModel {
id: showUpWatcher
folder: window.configDir
showDirs: false
showHidden: true
nameFilters: [".show"]
onCountChanged: {
if (count) {
window.drawAttention()
py.importModule("os", () => {
py.call("os.remove", [get(0, "filePath")])
})
}
}
}
}