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:
@@ -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")])
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user