Add keybind to reload config file (default Alt+R)
This commit is contained in:
parent
cf5d76dd10
commit
eb97f08d6a
|
@ -108,10 +108,10 @@ class UISettings(JSONConfigFile):
|
|||
"theme": "Default.qpl",
|
||||
"writeAliases": {},
|
||||
"keys": {
|
||||
"reloadConfig": ["Alt+R"],
|
||||
"scrollUp": ["Alt+Up", "Alt+K"],
|
||||
"scrollDown": ["Alt+Down", "Alt+J"],
|
||||
"startDebugger": ["Alt+Shift+D"],
|
||||
"reloadConfig": ["Alt+R"],
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,16 @@ Python {
|
|||
callCoro(backend_attribute + ".write", [data], callback)
|
||||
}
|
||||
|
||||
function loadSettings(callback=null) {
|
||||
callCoro("load_settings", [], ([settings, uiState, theme]) => {
|
||||
window.settings = settings
|
||||
window.uiState = uiState
|
||||
window.theme = Qt.createQmlObject(theme, window, "theme")
|
||||
|
||||
if (callback) { callback(settings, uiState, theme) }
|
||||
})
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
for (var func in EventHandlers) {
|
||||
if (EventHandlers.hasOwnProperty(func)) {
|
||||
|
@ -53,11 +63,7 @@ Python {
|
|||
call("APP.is_debug_on", [Qt.application.arguments], on => {
|
||||
window.debug = on
|
||||
|
||||
callCoro("load_settings", [], ([settings, uiState, theme]) => {
|
||||
window.settings = settings
|
||||
window.uiState = uiState
|
||||
window.theme = Qt.createQmlObject(theme, window, "theme")
|
||||
|
||||
loadSettings(() => {
|
||||
callCoro("saved_accounts.any_saved", [], any => {
|
||||
py.ready = true
|
||||
willLoadAccounts(any)
|
||||
|
|
|
@ -17,6 +17,11 @@ Item {
|
|||
flickTarget.flick(0, baseVelocity * (fast ? fastMultiply : 1))
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequences: settings.keys ? settings.keys.reloadConfig : []
|
||||
onActivated: py.loadSettings()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequences: settings.keys ? settings.keys.scrollUp : []
|
||||
onActivated: smartVerticalFlick(-335)
|
||||
|
@ -28,7 +33,7 @@ Item {
|
|||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: settings.keys ? settings.keys.startDebugger : []
|
||||
sequences: settings.keys ? settings.keys.startDebugger : []
|
||||
onActivated: if (window.debug) { py.call("APP.pdb") }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user