Add Presence.saved_status option
Controls how many previous status to keep saved in account menues, see previous commit.
This commit is contained in:
parent
3402a1d5f8
commit
86c0cb1bf2
|
@ -49,6 +49,10 @@ class Presence:
|
||||||
# This currently only works on Linux X11.
|
# This currently only works on Linux X11.
|
||||||
auto_away_after: int = 60 * 10
|
auto_away_after: int = 60 * 10
|
||||||
|
|
||||||
|
# Number of previously set status messages to keep saved. Available for
|
||||||
|
# quick access in the context menu when right-clicking an account.
|
||||||
|
saved_status: int = 5
|
||||||
|
|
||||||
class Notifications:
|
class Notifications:
|
||||||
# Default global notification level when starting the application.
|
# Default global notification level when starting the application.
|
||||||
# Allows muting (i.e. preventing desktop bubbles, sounds and flashes)
|
# Allows muting (i.e. preventing desktop bubbles, sounds and flashes)
|
||||||
|
|
|
@ -20,6 +20,14 @@ HMenu {
|
||||||
py.callClientCoro(userId, "set_presence", [presence, statusMsg])
|
py.callClientCoro(userId, "set_presence", [presence, statusMsg])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resizeStatusList() {
|
||||||
|
if (statusRepeater.count <= window.settings.Presence.saved_status)
|
||||||
|
return
|
||||||
|
|
||||||
|
statusRepeater.items.length = window.settings.Presence.saved_status
|
||||||
|
statusRepeater.itemsChanged()
|
||||||
|
}
|
||||||
|
|
||||||
function statusFieldApply(newStatus=null) {
|
function statusFieldApply(newStatus=null) {
|
||||||
if (newStatus === null) newStatus = statusField.editText.trim()
|
if (newStatus === null) newStatus = statusField.editText.trim()
|
||||||
|
|
||||||
|
@ -28,7 +36,7 @@ HMenu {
|
||||||
if (existing !== -1) statusRepeater.items.splice(existing, 1)
|
if (existing !== -1) statusRepeater.items.splice(existing, 1)
|
||||||
|
|
||||||
statusRepeater.items.unshift(newStatus)
|
statusRepeater.items.unshift(newStatus)
|
||||||
statusRepeater.items.length = Math.min(statusRepeater.count, 5)
|
resizeStatusList()
|
||||||
statusRepeater.itemsChanged()
|
statusRepeater.itemsChanged()
|
||||||
window.saveState(statusRepeater)
|
window.saveState(statusRepeater)
|
||||||
}
|
}
|
||||||
|
@ -38,6 +46,7 @@ HMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
onOpened: statusField.forceActiveFocus()
|
onOpened: statusField.forceActiveFocus()
|
||||||
|
Component.onCompleted: resizeStatusList()
|
||||||
|
|
||||||
HLabeledItem {
|
HLabeledItem {
|
||||||
id: statusMsgLabel
|
id: statusMsgLabel
|
||||||
|
|
Loading…
Reference in New Issue
Block a user